Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-native-windows/cli

Package Overview
Dependencies
Maintainers
2
Versions
417
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native-windows/cli - npm Package Compare versions

Comparing version 0.0.0-canary.40 to 0.0.0-canary.41

17

CHANGELOG.json

@@ -5,3 +5,18 @@ {

{
"date": "Fri, 20 Nov 2020 05:06:58 GMT",
"date": "Tue, 24 Nov 2020 05:06:33 GMT",
"tag": "@react-native-windows/cli_v0.0.0-canary.41",
"version": "0.0.0-canary.41",
"comments": {
"prerelease": [
{
"comment": "Add more eslint rules",
"author": "ngerlem@microsoft.com",
"commit": "adc0617836a0fba4112646595645e65f93e0106f",
"package": "@react-native-windows/cli"
}
]
}
},
{
"date": "Fri, 20 Nov 2020 05:08:43 GMT",
"tag": "@react-native-windows/cli_v0.0.0-canary.40",

@@ -8,0 +23,0 @@ "version": "0.0.0-canary.40",

# Change Log - @react-native-windows/cli
This log was last generated on Wed, 18 Nov 2020 03:10:51 GMT and should not be manually modified.
This log was last generated on Tue, 24 Nov 2020 05:06:33 GMT and should not be manually modified.
<!-- Start content -->
## 0.0.0-canary.41
Tue, 24 Nov 2020 05:06:33 GMT
### Changes
- Add more eslint rules (ngerlem@microsoft.com)
## 0.0.0-canary.39

@@ -8,0 +16,0 @@

10

lib-commonjs/config/configUtils.js

@@ -80,3 +80,3 @@ "use strict";

}
var solutionFiles = [];
const solutionFiles = [];
// Try to find any solution file that appears to be a React Native solution

@@ -122,3 +122,3 @@ for (const solutionFile of allSolutions) {

}
var dependencyProjectFiles = [];
const dependencyProjectFiles = [];
// Try to find any project file that appears to be a dependency project

@@ -163,3 +163,3 @@ for (const projectFile of allProjects) {

}
var appProjectFiles = [];
const appProjectFiles = [];
// Try to find any project file that appears to be an app project

@@ -206,3 +206,3 @@ for (const projectFile of allProjects) {

function tryFindPropertyValue(projectContents, propertyName) {
var nodes = msbuildSelect(`//msbuild:PropertyGroup/msbuild:${propertyName}`, projectContents);
const nodes = msbuildSelect(`//msbuild:PropertyGroup/msbuild:${propertyName}`, projectContents);
if (nodes.length > 0) {

@@ -230,3 +230,3 @@ // Take the last one

function importProjectExists(projectContents, projectName) {
var nodes = msbuildSelect(`//msbuild:Import[contains(@Project,'${projectName}')]`, projectContents);
const nodes = msbuildSelect(`//msbuild:Import[contains(@Project,'${projectName}')]`, projectContents);
return nodes.length > 0;

@@ -233,0 +233,0 @@ }

@@ -9,2 +9,6 @@ "use strict";

exports.dependencyConfigWindows = void 0;
// Types in this file are inaccurate compared to usage in terms of falsiness.
// We should try to rewrite some of this to do automated schema validation to
// guarantee correct types
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
const path = require("path");

@@ -17,2 +21,4 @@ const configUtils = require("./configUtils");

*/
// Disabled due to existing high cyclomatic complexity
// eslint-disable-next-line complexity
function dependencyConfigWindows(folder, userConfig = {}) {

@@ -24,3 +30,3 @@ if (userConfig === null) {

const usingManualNugetPackagesOverride = 'nugetPackages' in userConfig && Array.isArray(userConfig.nugetPackages);
var result = {
const result = {
folder,

@@ -80,3 +86,3 @@ projects: usingManualProjectsOverride ? userConfig.projects : [],

const usingManualSolutionFile = 'solutionFile' in userConfig;
var solutionFile = null;
let solutionFile = null;
if (usingManualSolutionFile && userConfig.solutionFile !== null) {

@@ -101,5 +107,5 @@ // Manually provided solutionFile, so extract it

];
for (let project of result.projects) {
for (const project of result.projects) {
// Verifying (req) items
var errorFound = false;
let errorFound = false;
alwaysRequired.forEach(item => {

@@ -149,6 +155,6 @@ if (!(item in project)) {

const directDependency = true;
let cppHeaders = [];
let cppPackageProviders = [];
let csNamespaces = [];
let csPackageProviders = [];
const cppHeaders = [];
const cppPackageProviders = [];
const csNamespaces = [];
const csPackageProviders = [];
if (projectNamespace !== null) {

@@ -155,0 +161,0 @@ const cppNamespace = projectNamespace.replace(/\./g, '::');

@@ -9,2 +9,6 @@ "use strict";

exports.projectConfigWindows = void 0;
// Types in this file are inaccurate compared to usage in terms of falsiness.
// We should try to rewrite some of this to do automated schema validation to
// guarantee correct types
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
const path = require("path");

@@ -30,7 +34,7 @@ const configUtils = require("./configUtils");

}
var result = {
const result = {
folder: folder,
sourceDir: path.relative(folder, sourceDir),
};
var validProject = false;
let validProject = false;
if (usingManualOverride) {

@@ -37,0 +41,0 @@ // Manual override, try to use it for solutionFile

@@ -82,3 +82,3 @@ "use strict";

const userConfig = rnc.dependency.platforms.windows;
let expectedConfig = rnc.expectedConfig;
const expectedConfig = rnc.expectedConfig;
if (expectedConfig !== null) {

@@ -85,0 +85,0 @@ expectedConfig.folder = folder;

@@ -82,3 +82,3 @@ "use strict";

const userConfig = rnc.project.windows;
let expectedConfig = rnc.expectedConfig;
const expectedConfig = rnc.expectedConfig;
if (expectedConfig !== null) {

@@ -85,0 +85,0 @@ expectedConfig.folder = folder;

@@ -69,3 +69,3 @@ "use strict";

const extension = path.extname(srcPath);
if (binaryExtensions.indexOf(extension) !== -1) {
if (binaryExtensions.includes(extension)) {
// Binary file

@@ -103,3 +103,3 @@ let shouldOverwrite = 'overwrite';

const srcPermissions = fs.statSync(srcPath).mode;
let content = resolveContents(srcPath, replacements);
const content = resolveContents(srcPath, replacements);
let shouldOverwrite = 'overwrite';

@@ -106,0 +106,0 @@ if (contentChangedCallback) {

@@ -24,3 +24,2 @@ "use strict";

console.log('Generating self-signed certificate...');
let toCopyTempKey = false;
if (os.platform() === 'win32') {

@@ -41,13 +40,7 @@ try {

catch (err) {
console.log(chalk.yellow('Failed to generate Self-signed certificate. Using Default Certificate. Use Visual Studio to renew it.'));
toCopyTempKey = true;
console.log(chalk.yellow('Failed to generate Self-signed certificate.'));
}
}
else {
console.log(chalk.yellow('Using Default Certificate. Use Visual Studio to renew it.'));
toCopyTempKey = true;
}
if (toCopyTempKey) {
await generator_common_1.copyAndReplaceWithChangedCallback(path.join(srcPath, 'keys', 'MyApp_TemporaryKey.pfx'), destPath, path.join(windowsDir, newProjectName, newProjectName + '_TemporaryKey.pfx'));
}
console.log(chalk.yellow('Using Default Certificate. Use Visual Studio to renew it.'));
await generator_common_1.copyAndReplaceWithChangedCallback(path.join(srcPath, 'keys', 'MyApp_TemporaryKey.pfx'), destPath, path.join(windowsDir, newProjectName, newProjectName + '_TemporaryKey.pfx'));
return null;

@@ -59,2 +52,4 @@ }

}
// Existing high cyclomatic complexity
// eslint-disable-next-line complexity
async function copyProjectTemplateAndReplace(srcRootPath, destPath, newProjectName, namespace, options) {

@@ -298,3 +293,3 @@ if (!srcRootPath) {

if (fs.existsSync(path.join(sharedPath, projDir))) {
let sharedProjMappings = [];
const sharedProjMappings = [];
// Once we are publishing to nuget.org, this shouldn't be needed anymore

@@ -301,0 +296,0 @@ if (options.experimentalNuGetDependency) {

@@ -39,3 +39,3 @@ "use strict";

async function generateWindows(projectDir, name, ns, options) {
var _a, _b, _c;
var _a;
let error;

@@ -73,9 +73,9 @@ try {

}
catch (_d) { }
catch (_b) { }
const optScrubbed = scrubOptions(options);
(_b = telemetry_1.Telemetry.client) === null || _b === void 0 ? void 0 : _b.trackEvent({
telemetry_1.Telemetry.client.trackEvent({
name: 'generate-windows',
properties: Object.assign(Object.assign({ error: error }, optScrubbed), { 'react-native': rnVersion, 'cli-version': cliVersion }),
});
(_c = telemetry_1.Telemetry.client) === null || _c === void 0 ? void 0 : _c.flush();
telemetry_1.Telemetry.client.flush();
}

@@ -82,0 +82,0 @@ }

@@ -100,3 +100,2 @@ "use strict";

release: options.release,
root: options.root !== undefined,
arch: options.arch,

@@ -201,3 +200,3 @@ singleproc: options.singleproc,

const buildType = deploy.getBuildConfiguration(options);
let msBuildProps = build.parseMsBuildProps(options);
const msBuildProps = build.parseMsBuildProps(options);
// Disable the autolink check since we just ran it

@@ -204,0 +203,0 @@ msBuildProps.RunAutolinkCheck = 'false';

@@ -9,2 +9,6 @@ "use strict";

exports.autoLinkCommand = void 0;
// Types in this file are inaccurate compared to usage in terms of falsiness.
// We should try to rewrite some of this to do automated schema validation to
// guarantee correct types
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
const fs = require("fs");

@@ -54,3 +58,3 @@ const path = require("path");

// Template files are CRLF, JS-generated replacements are LF, normalize replacements to CRLF
for (var key in replacements) {
for (const key of Object.keys(replacements)) {
replacements[key] = replacements[key].replace(/\n/g, '\r\n');

@@ -97,2 +101,4 @@ }

*/
// Disabling lint warnings due to high existing cyclomatic complexity
// eslint-disable-next-line complexity
async function updateAutoLink(args, config, options) {

@@ -102,3 +108,3 @@ const startTime = perf_hooks_1.performance.now();

const checkMode = options.check;
var changesNecessary = false;
let changesNecessary = false;
const spinner = commandWithProgress_1.newSpinner(checkMode ? 'Checking auto-linked files...' : 'Auto-linking...');

@@ -169,4 +175,4 @@ verboseMessage('', verbose);

const dependenciesConfig = config.dependencies;
let windowsDependencies = {};
for (const dependencyName in dependenciesConfig) {
const windowsDependencies = {};
for (const dependencyName of Object.keys(dependenciesConfig)) {
const windowsDependency = dependenciesConfig[dependencyName].platforms.windows;

@@ -176,3 +182,3 @@ if (windowsDependency) {

verboseMessage(windowsDependency, verbose);
var dependencyIsValid = true;
let dependencyIsValid = true;
dependencyIsValid = !!(dependencyIsValid &&

@@ -207,3 +213,3 @@ 'sourceDir' in windowsDependency &&

let csReactPackageProviders = '';
for (const dependencyName in windowsDependencies) {
for (const dependencyName of Object.keys(windowsDependencies)) {
windowsDependencies[dependencyName].projects.forEach(project => {

@@ -237,3 +243,3 @@ if (project.directDependency) {

let cppPackageProviders = '';
for (const dependencyName in windowsDependencies) {
for (const dependencyName of Object.keys(windowsDependencies)) {
windowsDependencies[dependencyName].projects.forEach(project => {

@@ -271,5 +277,5 @@ if (project.directDependency) {

let propertiesForProps = '';
let csModuleNames = [];
const csModuleNames = [];
if (projectLang === 'cpp') {
for (const dependencyName in windowsDependencies) {
for (const dependencyName of Object.keys(windowsDependencies)) {
windowsDependencies[dependencyName].projects.forEach(project => {

@@ -298,3 +304,3 @@ if (project.directDependency && project.projectLang === 'cs') {

let projectReferencesForTargets = '';
for (const dependencyName in windowsDependencies) {
for (const dependencyName of Object.keys(windowsDependencies)) {
windowsDependencies[dependencyName].projects.forEach(project => {

@@ -322,4 +328,4 @@ if (project.directDependency) {

// Generating project entries for solution
let projectsForSolution = [];
for (const dependencyName in windowsDependencies) {
const projectsForSolution = [];
for (const dependencyName of Object.keys(windowsDependencies)) {
// Process dependency projects

@@ -358,3 +364,3 @@ windowsDependencies[dependencyName].projects.forEach(project => {

spinner.succeed();
var endTime = perf_hooks_1.performance.now();
const endTime = perf_hooks_1.performance.now();
if (!changesNecessary) {

@@ -373,3 +379,3 @@ console.log(`${chalk.green('Success:')} No auto-linking changes necessary. (${Math.round(endTime - startTime)}ms)`);

spinner.fail();
var endTime = perf_hooks_1.performance.now();
const endTime = perf_hooks_1.performance.now();
console.log(`${chalk.red('Error:')} ${e.toString()}. (${Math.round(endTime - startTime)}ms)`);

@@ -376,0 +382,0 @@ throw e;

@@ -70,8 +70,8 @@ "use strict";

function parseMsBuildProps(options) {
let result = {};
const result = {};
if (options.msbuildprops) {
const props = options.msbuildprops.split(',');
for (let i = 0; i < props.length; i++) {
const prop = props[i].split('=');
result[prop[0]] = prop[1];
for (const prop of props) {
const propAssignment = prop.split('=');
result[propAssignment[0]] = propAssignment[1];
}

@@ -78,0 +78,0 @@ }

@@ -53,3 +53,3 @@ "use strict";

function commandWithProgress(spinner, taskDoingName, command, args, verbose) {
return new Promise(function (resolve, reject) {
return new Promise((resolve, reject) => {
const spawnOptions = verbose ? { stdio: 'inherit' } : {};

@@ -71,5 +71,2 @@ if (verbose) {

}
if (verbose) {
console.error(chalk.red(text));
}
if (text) {

@@ -87,3 +84,3 @@ setSpinnerText(spinner, taskDoingName + ': ERROR: ', firstErrorLine);

reject(e);
}).on('close', function (code) {
}).on('close', code => {
if (code === 0) {

@@ -90,0 +87,0 @@ spinner.succeed(taskDoingName);

@@ -57,3 +57,3 @@ "use strict";

const rootGlob = `${options.root}/windows/{*/AppPackages,AppPackages/*}`;
const newGlob = `${rootGlob}/*_${options.arch === 'x86' ? '{Win32,x86}' : options.arch}_${options.release ? '' : 'Debug_'}Test`;
const newGlob = `${rootGlob}/*_${options.arch === 'x86' ? '{Win32,x86}' : options.arch}_Test`;
const result = glob.sync(newGlob);

@@ -93,3 +93,3 @@ if (result.length > 1 && projectName) {

else {
const filteredGlobs = globs.filter(x => x.indexOf(projectName) !== -1);
const filteredGlobs = globs.filter(x => x.includes(projectName));
if (filteredGlobs.length > 1) {

@@ -130,3 +130,3 @@ commandWithProgress_1.newWarn(`More than one appxmanifest for ${projectName}: ${filteredGlobs.join(',')}`);

const shouldLaunch = shouldLaunchApp(options);
const identity = appxManifest.root.children.filter(function (x) {
const identity = appxManifest.root.children.filter(x => {
return x.name === 'mp:PhoneIdentity';

@@ -168,3 +168,3 @@ })[0];

const appxManifest = parseAppxManifest(appxManifestPath);
const identity = appxManifest.root.children.filter(function (x) {
const identity = appxManifest.root.children.filter(x => {
return x.name === 'Identity';

@@ -184,3 +184,3 @@ })[0];

}
let args = [];
const args = [];
if (options.remoteDebugging) {

@@ -200,3 +200,3 @@ args.push('--remote-debugging');

await commandWithProgress_1.runPowerShellScriptFunction('Installing dependent framework packages', windowsStoreAppUtils, `Install-AppDependencies ${appxManifestPath} ${appPackageFolder} ${options.arch}`, verbose);
await build.buildSolution(buildTools, slnFile, options.release ? 'Release' : 'Debug', options.arch, { DeployLayout: 'true' }, verbose, 'deploy', options.buildLogDirectory);
await build.buildSolution(buildTools, slnFile, 'Debug', options.arch, { DeployLayout: 'true' }, verbose, 'deploy', options.buildLogDirectory);
}

@@ -203,0 +203,0 @@ const appFamilyName = child_process_1.execSync(`powershell -NoProfile -c $(Get-AppxPackage -Name ${appName}).PackageFamilyName`)

@@ -43,10 +43,7 @@ "use strict";

commandWithProgress_1.newInfo(`Build platform: ${buildArch}`);
if (target) {
commandWithProgress_1.newInfo(`Build target: ${target}`);
}
const verbosityOption = verbose ? 'normal' : 'minimal';
const logPrefix = path.join(buildLogDirectory || os.tmpdir(), `msbuild_${process.pid}${target ? '_' + target : ''}`);
const logPrefix = path.join(buildLogDirectory || os.tmpdir(), `msbuild_${process.pid}_${target}`);
const errorLog = logPrefix + '.err';
const warnLog = logPrefix + '.wrn';
const localBinLog = target ? `:${target}.binlog` : '';
const localBinLog = target === 'build' ? '' : ':deploy.binlog';
const binlog = buildLogDirectory ? `:${logPrefix}.binlog` : localBinLog;

@@ -74,10 +71,8 @@ const args = [

}
else if (target === 'deploy') {
else {
args.push(`/t:Deploy`);
}
if (msBuildProps) {
Object.keys(msBuildProps).forEach(function (key) {
args.push(`/p:${key}=${msBuildProps[key]}`);
});
}
Object.keys(msBuildProps).forEach(key => {
args.push(`/p:${key}=${msBuildProps[key]}`);
});
try {

@@ -84,0 +79,0 @@ checkRequirements.isWinSdkPresent('10.0');

@@ -7,6 +7,6 @@ /**

export default class Version {
private major;
private minor;
private build;
private qfe;
private readonly major;
private readonly minor;
private readonly build;
private readonly qfe;
constructor(major: number, minor?: number, build?: number, qfe?: number);

@@ -13,0 +13,0 @@ eq(other: Version): boolean;

@@ -25,3 +25,3 @@ "use strict";

if (block.length > 0) {
var startIndex = lines.indexOf(block[0]);
const startIndex = lines.indexOf(block[0]);
if (startIndex >= 0) {

@@ -88,3 +88,3 @@ for (let i = 1; i < block.length; i++) {

}
let slnLines = fs
const slnLines = fs
.readFileSync(slnFile)

@@ -115,3 +115,3 @@ .toString()

const slnConfigs = getBlockContentsFromLines(slnLines, '\tGlobalSection(SolutionConfigurationPlatforms) = preSolution', '\tEndGlobalSection', false).map(line => line.match(/\s+([\w|]+)\s=/)[1]);
let projectConfigLines = [];
const projectConfigLines = [];
slnConfigs.forEach(slnConfig => {

@@ -127,3 +127,3 @@ projectConfigLines.push(`\t\t${projectGuid}.${slnConfig}.ActiveCfg = ${project.projectLang === 'cpp'

projectConfigLines.forEach(projectConfigLine => {
if (slnLines.indexOf(projectConfigLine) < 0) {
if (!slnLines.includes(projectConfigLine)) {
if (verbose) {

@@ -130,0 +130,0 @@ const configLine = projectConfigLine.substr(projectConfigLine.indexOf('= ') + 2);

@@ -10,4 +10,4 @@ /**

readonly ip: string;
private index;
private type;
private readonly index;
private readonly type;
constructor(name: string, guid: string, ip: string, index: number, type: string);

@@ -17,3 +17,3 @@ toString(): string;

export default class WinAppDeployTool {
private path;
private readonly path;
constructor();

@@ -20,0 +20,0 @@ get isAvailable(): boolean;

@@ -42,5 +42,4 @@ "use strict";

const sortedList = devices.sort(sortDevices);
for (let i = 0; i < sortedList.length; i++) {
const sortedItem = sortedList[i];
if (sortedItem.toString().indexOf(target) > -1) {
for (const sortedItem of sortedList) {
if (sortedItem.toString().includes(target)) {
return sortedItem;

@@ -47,0 +46,0 @@ }

{
"name": "@react-native-windows/cli",
"version": "0.0.0-canary.40",
"version": "0.0.0-canary.41",
"license": "MIT",

@@ -20,3 +20,3 @@ "main": "lib-commonjs/index.js",

"dependencies": {
"@react-native-windows/telemetry": "^0.0.0-canary.9",
"@react-native-windows/telemetry": "^0.0.0-canary.10",
"chalk": "^4.1.0",

@@ -39,3 +39,3 @@ "cli-spinners": "^2.2.0",

"@react-native-community/cli-types": "^4.10.1",
"@rnw-scripts/eslint-config": "0.1.5",
"@rnw-scripts/eslint-config": "0.1.6",
"@rnw-scripts/jest-unittest-config": "0.1.1",

@@ -42,0 +42,0 @@ "@rnw-scripts/just-task": "0.0.6",

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

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

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc