@react-native-community/cli-tools
Advanced tools
Comparing version 5.0.0 to 5.0.1-alpha.0
@@ -32,2 +32,4 @@ "use strict"; | ||
exports.inlineString = inlineString; | ||
exports.inlineString = inlineString; | ||
//# sourceMappingURL=errors.js.map |
import { RequestInit as FetchOptions, Request, Headers } from 'node-fetch'; | ||
export default function fetch(url: string | Request, options?: FetchOptions): Promise<{ | ||
/** | ||
* Downloads the given `url` to the OS's temp folder and | ||
* returns the path to it. | ||
*/ | ||
declare const fetchToTemp: (url: string) => Promise<string>; | ||
declare const fetch: (url: string | Request, options?: FetchOptions | undefined) => Promise<{ | ||
status: number; | ||
@@ -7,2 +12,3 @@ data: any; | ||
}>; | ||
export { fetch, fetchToTemp }; | ||
//# sourceMappingURL=fetch.d.ts.map |
@@ -6,4 +6,34 @@ "use strict"; | ||
}); | ||
exports.default = fetch; | ||
exports.fetchToTemp = exports.fetch = void 0; | ||
function os() { | ||
const data = _interopRequireWildcard(require("os")); | ||
os = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function path() { | ||
const data = _interopRequireWildcard(require("path")); | ||
path = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function fs() { | ||
const data = _interopRequireWildcard(require("fs")); | ||
fs = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _nodeFetch() { | ||
@@ -21,4 +51,10 @@ const data = _interopRequireDefault(require("node-fetch")); | ||
var _logger = _interopRequireDefault(require("./logger")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
async function unwrapFetchResult(response) { | ||
@@ -33,4 +69,36 @@ const data = await response.text(); | ||
} | ||
/** | ||
* Downloads the given `url` to the OS's temp folder and | ||
* returns the path to it. | ||
*/ | ||
async function fetch(url, options) { | ||
const fetchToTemp = url => { | ||
try { | ||
return new Promise((resolve, reject) => { | ||
const fileName = path().basename(url); | ||
const tmpDir = path().join(os().tmpdir(), fileName); | ||
(0, _nodeFetch().default)(url).then(result => { | ||
if (result.status >= 400) { | ||
return reject(`Fetch request failed with status ${result.status}`); | ||
} | ||
const dest = fs().createWriteStream(tmpDir); | ||
result.body.pipe(dest); | ||
result.body.on('end', () => { | ||
resolve(tmpDir); | ||
}); | ||
result.body.on('error', reject); | ||
}); | ||
}); | ||
} catch (e) { | ||
_logger.default.error(e); | ||
throw e; | ||
} | ||
}; | ||
exports.fetchToTemp = fetchToTemp; | ||
const fetch = async (url, options) => { | ||
const result = await (0, _nodeFetch().default)(url, options); | ||
@@ -48,2 +116,6 @@ const data = await unwrapFetchResult(result); | ||
}; | ||
} | ||
}; | ||
exports.fetch = fetch; | ||
//# sourceMappingURL=fetch.js.map |
@@ -8,5 +8,35 @@ "use strict"; | ||
const getDefaultUserTerminal = () => process.env.REACT_TERMINAL || process.env.TERM_PROGRAM; | ||
function _os() { | ||
const data = _interopRequireDefault(require("os")); | ||
_os = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const getDefaultUserTerminal = () => { | ||
const { | ||
REACT_TERMINAL, | ||
TERM_PROGRAM, | ||
TERM | ||
} = process.env; | ||
if (REACT_TERMINAL) { | ||
return REACT_TERMINAL; | ||
} | ||
if (_os().default.platform() === 'darwin') { | ||
return TERM_PROGRAM; | ||
} | ||
return TERM; | ||
}; | ||
var _default = getDefaultUserTerminal; | ||
exports.default = _default; | ||
exports.default = _default; | ||
//# sourceMappingURL=getDefaultUserTerminal.js.map |
@@ -51,2 +51,4 @@ "use strict"; | ||
return (0, _lodash().groupBy)(assets, type => (_mime().default.getType(type) || '').split('/')[0]); | ||
} | ||
} | ||
//# sourceMappingURL=groupFilesByType.js.map |
@@ -5,4 +5,7 @@ export { default as logger } from './logger'; | ||
export { default as getDefaultUserTerminal } from './getDefaultUserTerminal'; | ||
export { default as fetch } from './fetch'; | ||
export { fetch, fetchToTemp } from './fetch'; | ||
export { default as launchDefaultBrowser } from './launchDefaultBrowser'; | ||
export { default as launchDebugger } from './launchDebugger'; | ||
export { default as launchEditor } from './launchEditor'; | ||
export * from './errors'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -11,3 +11,7 @@ "use strict"; | ||
getDefaultUserTerminal: true, | ||
fetch: true | ||
fetch: true, | ||
fetchToTemp: true, | ||
launchDefaultBrowser: true, | ||
launchDebugger: true, | ||
launchEditor: true | ||
}; | ||
@@ -41,5 +45,29 @@ Object.defineProperty(exports, "logger", { | ||
get: function () { | ||
return _fetch.default; | ||
return _fetch.fetch; | ||
} | ||
}); | ||
Object.defineProperty(exports, "fetchToTemp", { | ||
enumerable: true, | ||
get: function () { | ||
return _fetch.fetchToTemp; | ||
} | ||
}); | ||
Object.defineProperty(exports, "launchDefaultBrowser", { | ||
enumerable: true, | ||
get: function () { | ||
return _launchDefaultBrowser.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "launchDebugger", { | ||
enumerable: true, | ||
get: function () { | ||
return _launchDebugger.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "launchEditor", { | ||
enumerable: true, | ||
get: function () { | ||
return _launchEditor.default; | ||
} | ||
}); | ||
@@ -54,4 +82,10 @@ var _logger = _interopRequireDefault(require("./logger")); | ||
var _fetch = _interopRequireDefault(require("./fetch")); | ||
var _fetch = require("./fetch"); | ||
var _launchDefaultBrowser = _interopRequireDefault(require("./launchDefaultBrowser")); | ||
var _launchDebugger = _interopRequireDefault(require("./launchDebugger")); | ||
var _launchEditor = _interopRequireDefault(require("./launchEditor")); | ||
var _errors = require("./errors"); | ||
@@ -70,2 +104,4 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
//# sourceMappingURL=index.js.map |
@@ -8,6 +8,4 @@ "use strict"; | ||
var _fetch = _interopRequireDefault(require("./fetch")); | ||
var _fetch = require("./fetch"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
@@ -32,3 +30,3 @@ * Copyright (c) Facebook, Inc. and its affiliates. | ||
data | ||
} = await (0, _fetch.default)(`http://localhost:${packagerPort}/status`); | ||
} = await (0, _fetch.fetch)(`http://localhost:${packagerPort}/status`); | ||
return data === 'packager-status:running' ? 'running' : 'unrecognized'; | ||
@@ -41,2 +39,4 @@ } catch (_error) { | ||
var _default = isPackagerRunning; | ||
exports.default = _default; | ||
exports.default = _default; | ||
//# sourceMappingURL=isPackagerRunning.js.map |
@@ -88,2 +88,4 @@ "use strict"; | ||
}; | ||
exports.default = _default; | ||
exports.default = _default; | ||
//# sourceMappingURL=logger.js.map |
{ | ||
"name": "@react-native-community/cli-tools", | ||
"version": "5.0.0", | ||
"version": "5.0.1-alpha.0", | ||
"license": "MIT", | ||
"main": "build/index.js", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"chalk": "^2.4.2", | ||
"lodash": "^4.17.5", | ||
"chalk": "^3.0.0", | ||
"lodash": "^4.17.15", | ||
"mime": "^2.4.1", | ||
"node-fetch": "^2.5.0" | ||
"node-fetch": "^2.6.0", | ||
"open": "^6.2.0", | ||
"shell-quote": "1.6.1" | ||
}, | ||
"devDependencies": { | ||
"@types/lodash": "^4.14.123", | ||
"@types/lodash": "^4.14.149", | ||
"@types/mime": "^2.0.1", | ||
"@types/node-fetch": "^2.3.3" | ||
"@types/node-fetch": "^2.5.5" | ||
}, | ||
"files": [ | ||
"build" | ||
"build", | ||
"!*.d.ts", | ||
"!*.map" | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
337657
89
1920
0
6
2
14
4
+ Addedopen@^6.2.0
+ Addedshell-quote@1.6.1
+ Addedansi-styles@4.3.0(transitive)
+ Addedarray-filter@0.0.1(transitive)
+ Addedarray-map@0.0.1(transitive)
+ Addedarray-reduce@0.0.0(transitive)
+ Addedchalk@3.0.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedis-wsl@1.1.0(transitive)
+ Addedjsonify@0.0.1(transitive)
+ Addedopen@6.4.0(transitive)
+ Addedshell-quote@1.6.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedsupports-color@5.5.0(transitive)
Updatedchalk@^3.0.0
Updatedlodash@^4.17.15
Updatednode-fetch@^2.6.0