Compare commits

...

4 Commits
master ... v8

Author SHA1 Message Date
c454f5b154 Merge pull request #1366 from balena-io/mixpanel-args-v8
Update mixpanel tracking (v8)
2019-07-22 10:00:00 +00:00
25308387f3 v8.1.1 2019-07-24 14:16:38 +01:00
4f33dc540f Update mixpanel tracking
Change-type: patch
Signed-off-by: Paulo Castro <paulo@balena.io>
2019-07-24 14:16:38 +01:00
3df1187285 Fix typescript and prettier errors to allow backport changes
Change-type: patch
Signed-off-by: Paulo Castro <paulo@balena.io>
2019-07-24 14:16:38 +01:00
10 changed files with 40 additions and 38 deletions

View File

@ -16,4 +16,4 @@ deploy:
on:
tags: true
condition: "$TRAVIS_TAG =~ ^v?[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+"
repo: resin-io/resin-cli
repo: balena-io/balena-cli

View File

@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
This project adheres to [Semantic Versioning](http://semver.org/).
## v8.1.1 - 2019-07-24
* [BACKPORT] Update mixpanel tracking [Paulo Castro]
* [BACKPORT] Fix typescript and prettier errors to allow backport changes [Paulo Castro]
## v8.1.0 - 2018-10-24
* README: Add development guidelines section [Thodoris Greasidis]

View File

@ -24,7 +24,7 @@ execPkg(['--target', 'host', '--output', 'build-bin/resin', 'package.json'])
.then(nativeExtensions => {
console.log(`\nCopying to build-bin:\n${nativeExtensions.join('\n')}`);
return nativeExtensions.map(extPath => {
return nativeExtensions.map((extPath: string) => {
return fs.copy(
extPath,
extPath.replace(

View File

@ -44,10 +44,9 @@ function getBuildTarget(appOrDevice: string): BuildTarget | null {
}
async function getAppOwner(sdk: ResinSDK, appName: string) {
const {
exitWithExpectedError,
selectFromList,
} = await import('../utils/patterns');
const { exitWithExpectedError, selectFromList } = await import(
'../utils/patterns'
);
const _ = await import('lodash');
const applications = await sdk.models.application.getAll({
@ -89,9 +88,7 @@ async function getAppOwner(sdk: ResinSDK, appName: string) {
});
const selected = await selectFromList(
`${
entries.length
} applications found with that name, please select the application you would like to push to`,
`${entries.length} applications found with that name, please select the application you would like to push to`,
entries,
);

View File

@ -14,6 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License.
###
# Assign bluebird as the global promise library
# stream-to-promise will produce native promises if not
# for this module, which could wreak havoc in this
# bluebird-only codebase.
require('any-promise/register/bluebird')
Raven = require('raven')
Raven.disableConsoleAlerts()
Raven.config require('./config').sentryDsn,
@ -79,12 +85,6 @@ events = require('./events')
update = require('./utils/update')
{ exitWithExpectedError } = require('./utils/patterns')
# Assign bluebird as the global promise library
# stream-to-promise will produce native promises if not
# for this module, which could wreak havoc in this
# bluebird-only codebase.
require('any-promise/register/bluebird')
capitano.permission 'user', (done) ->
resin.auth.isLoggedIn().then (isLoggedIn) ->
if not isLoggedIn

View File

@ -30,16 +30,19 @@ export function trackCommand(capitanoCli: Capitano.Cli) {
username,
},
});
// `command.signature.toString()` results in a string like, for example:
// "push <applicationOrDevice>"
// That's literally so: "applicationOrDevice" is NOT replaced with
// the actual application ID or device ID. The purpose is find out the
// most / least used command verbs, so we can focus our development
// effort where it is most beneficial to end users.
return mixpanel.track(`[CLI] ${command.signature.toString()}`, {
distinct_id: username,
argv: process.argv.join(' '),
version: packageJSON.version,
node: process.version,
arch: process.arch,
resinUrl,
platform: process.platform,
command: capitanoCli,
});
});
})

View File

@ -45,9 +45,7 @@ export async function deployToDevice(opts: DeviceDeployOptions): Promise<void> {
await api.ping();
} catch (e) {
exitWithExpectedError(
`Could not communicate with local mode device at address ${
opts.deviceHost
}`,
`Could not communicate with local mode device at address ${opts.deviceHost}`,
);
}

View File

@ -46,13 +46,9 @@ export function stateToString(state: OperationState) {
switch (state.operation.command) {
case 'copy':
return `${result} ${state.operation.from.path} -> ${
state.operation.to.path
}`;
return `${result} ${state.operation.from.path} -> ${state.operation.to.path}`;
case 'replace':
return `${result} ${state.operation.file.path}, ${
state.operation.copy
} -> ${state.operation.replace}`;
return `${result} ${state.operation.file.path}, ${state.operation.copy} -> ${state.operation.replace}`;
case 'run-script':
return `${result} ${state.operation.script}`;
default:

View File

@ -1,6 +1,6 @@
{
"name": "resin-cli",
"version": "8.1.0",
"version": "8.1.1",
"description": "The official resin.io CLI tool",
"main": "./build/actions/index.js",
"homepage": "https://github.com/resin-io/resin-cli",
@ -79,7 +79,7 @@
"gulp-mocha": "^2.0.0",
"gulp-shell": "^0.5.2",
"mochainon": "^2.0.0",
"pkg": "^4.3.0-beta.1",
"pkg": "4.3.8",
"prettier": "^1.14.2",
"publish-release": "^1.3.3",
"require-npm4-to-publish": "^1.0.0",

View File

@ -478,15 +478,18 @@ declare module 'resin-sdk-preconfigured' {
interface ResinSDK {
auth: {
register: (
credentials: { email: string; password: string },
) => Promise<string>;
authenticate: (
credentials: { email: string; password: string },
) => Promise<string>;
login: (
credentials: { email: string; password: string },
) => Promise<void>;
register: (credentials: {
email: string;
password: string;
}) => Promise<string>;
authenticate: (credentials: {
email: string;
password: string;
}) => Promise<string>;
login: (credentials: {
email: string;
password: string;
}) => Promise<void>;
loginWithToken: (authToken: string) => Promise<void>;
logout: () => Promise<void>;
getToken: () => Promise<string>;