Socket
Socket
Sign inDemoInstall

@appsemble/cli

Package Overview
Dependencies
Maintainers
2
Versions
226
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appsemble/cli - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

assets/icon.svg

32

lib/util/loadConfig.js

@@ -0,4 +1,9 @@

const path = require('path');
const fs = require('fs-extra');
const log = require('winston');
const CLIError = require('./CLIError');
const explorer = require('./explorer');
const idFromPackageName = require('./idFromPackageName');

@@ -9,3 +14,3 @@

*
* @param {string} path - The project root to load the configuration from.
* @param {string} projectPath - The project root to load the configuration from.
*

@@ -15,6 +20,25 @@ * @returns {Object} The resulting configuration.

module.exports = async function loadConfig(projectPath) {
const { config, filepath } = await explorer.load(projectPath);
const data = await explorer.load(projectPath);
if (data == null) {
throw new CLIError('Appsemble configuration file not found');
}
const {
config,
filepath,
} = data;
log.info('Using configuration file:', filepath);
log.debug('configuration:', config);
return config;
const pkgPath = path.resolve(filepath, '..', 'package.json');
if (!fs.existsSync(pkgPath)) {
return config;
}
const pkg = await fs.readJson(pkgPath);
if (!pkg.private) {
log.warn('It is recommended to set "private" to true in package.json to prevent accidental publishing to npm.');
}
return {
id: idFromPackageName(pkg.name),
description: pkg.description,
version: pkg.version,
...config,
};
};

@@ -1,5 +0,11 @@

const request = require('request-promise-native');
const {
promisify,
} = require('util');
const request = promisify(require('request'));
const log = require('winston');
const CLIError = require('./CLIError');
let baseUrl;

@@ -25,3 +31,9 @@

const response = await request(options);
return JSON.parse(response);
if (response.statusCode >= 500) {
throw new Error(response);
}
if (response.statusCode >= 400) {
throw new CLIError(JSON.parse(response.body).reason);
}
return JSON.parse(response.body);
}

@@ -28,0 +40,0 @@

7

package.json
{
"name": "@appsemble/cli",
"version": "0.0.2",
"version": "0.1.0",
"description": "A CLI for the Appsemble extension platform",

@@ -12,3 +12,3 @@ "homepage": "https://www.appsemble.com",

"bin": {
"appsemble": "./lib/cli/cli.js"
"appsemble": "./lib/cli.js"
},

@@ -22,5 +22,4 @@ "dependencies": {

"request": "^2.83.0",
"request-promise-native": "^1.0.5",
"winston": "^2.4.0",
"yargs": "^10.1.2"
"yargs": "^11.0.0"
},

@@ -27,0 +26,0 @@ "devDependencies": {

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