Skip to content

Commit

Permalink
Merge pull request #1366 from balena-io/mixpanel-args-v8
Browse files Browse the repository at this point in the history
Update mixpanel tracking (v8)
  • Loading branch information
pdcastro committed Jul 22, 2019
2 parents 8dc4c08 + 2530838 commit c454f5b
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion automation/build-bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
11 changes: 4 additions & 7 deletions lib/actions/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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,
);

Expand Down
12 changes: 6 additions & 6 deletions lib/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions lib/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
});
})
Expand Down
4 changes: 1 addition & 3 deletions lib/utils/device/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
);
}

Expand Down
8 changes: 2 additions & 6 deletions lib/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
21 changes: 12 additions & 9 deletions typings/resin-sdk-preconfigured.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down

0 comments on commit c454f5b

Please sign in to comment.