Skip to content

Commit

Permalink
Revert "feat(cli): usage measurement (#3641)"
Browse files Browse the repository at this point in the history
This reverts commit a755863.
  • Loading branch information
ammarkarachi authored Jun 25, 2020
1 parent a755863 commit 6a6122b
Show file tree
Hide file tree
Showing 70 changed files with 189 additions and 695 deletions.
1 change: 1 addition & 0 deletions .circleci/config.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: 2.1
machine:
environment:
PATH: '${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin'

defaults: &defaults
working_directory: ~/repo
docker:
Expand Down
1 change: 0 additions & 1 deletion packages/amplify-appsync-simulator/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export class AmplifyAppSyncSimulator {
} catch (e) {
console.log('Could not start AppSync mock endpoint');
console.log(e);
throw e;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@ module.exports = {
print.success('Some next steps:');
print.info('"amplify push" builds all of your local backend resources and provisions them in the cloud');
print.info(
'"amplify publish" builds all your local backend and front-end resources (if you have hosting category added) and provisions them in the cloud',
'"amplify publish" builds all your local backend and front-end resources (if you have hosting category added) and provisions them in the cloud'
);
print.info('');
})
.catch(err => {
context.print.info(err.stack);
context.print.error('There was an error adding the analytics resource');
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module.exports = {
return amplify.pushResources(context, category, resourceName).catch(err => {
context.print.info(err.stack);
context.print.error('An error occurred when pushing the analytics resource');
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module.exports = {
return amplify.removeResource(context, category, resourceName).catch(err => {
context.print.info(err.stack);
context.print.error('An error occurred when removing the analytics resource');
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ module.exports = {
.catch(err => {
context.print.info(err.stack);
context.print.error(`There was an error updating the ${category} resource`);
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module.exports = {
answers.secretStoreArn,
answers.dbClusterArn,
answers.databaseName,
AWS,
AWS
);

/**
Expand Down Expand Up @@ -148,14 +148,13 @@ module.exports = {
print.success('Some next steps:');
print.info('"amplify push" will build all your local backend resources and provision it in the cloud');
print.info(
'"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud',
'"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud'
);
print.info('');
})
.catch(err => {
context.print.info(err.stack);
context.print.error('There was an error adding the datasource');
context.telemetry.emitError(err);
});
},
};
Expand Down
3 changes: 1 addition & 2 deletions packages/amplify-category-api/commands/api/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@ module.exports = {
print.success('Some next steps:');
print.info('"amplify push" will build all your local backend resources and provision it in the cloud');
print.info(
'"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud',
'"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud'
);
print.info('');
})
.catch(err => {
context.print.info(err.stack);
context.print.error('There was an error adding the API resource');
context.telemetry.emitError(err);
});
},
};
1 change: 0 additions & 1 deletion packages/amplify-category-api/commands/api/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module.exports = {
.catch(err => {
context.print.error('Error opening console.');
context.print.info(err.message);
context.telemetry.emitError(err);
});
},
};
1 change: 0 additions & 1 deletion packages/amplify-category-api/commands/api/gql-compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module.exports = {
});
} catch (err) {
context.print.error(err.toString());
context.telemetry.emitError(err);
}
},
};
1 change: 0 additions & 1 deletion packages/amplify-category-api/commands/api/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module.exports = {
return amplify.pushResources(context, category, resourceName).catch(err => {
context.print.error('There was an error pushing the API resource');
context.print.error(err.toString());
context.telemetry.emitError(err);
});
},
};
1 change: 0 additions & 1 deletion packages/amplify-category-api/commands/api/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module.exports = {
.catch(err => {
context.print.info(err.stack);
context.print.error('There was an error removing the api resource');
context.telemetry.emitError(err);
});
},
};
1 change: 0 additions & 1 deletion packages/amplify-category-api/commands/api/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module.exports = {
.catch(err => {
context.print.error(err.message);
console.log(err.stack);
context.telemetry.emitError(err);
});
},
};
1 change: 0 additions & 1 deletion packages/amplify-category-auth/commands/auth/enable.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ module.exports = {
.catch(err => {
context.print.info(err.stack);
context.print.error('There was an error adding the auth resource');
context.telemetry.emitError(err);
});
},
};
1 change: 0 additions & 1 deletion packages/amplify-category-auth/commands/auth/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module.exports = {
.catch(err => {
context.print.info(err.stack);
context.print.error('There was an error pushing the auth resource');
context.telemetry.emitError(err);
});
},
};
1 change: 0 additions & 1 deletion packages/amplify-category-auth/commands/auth/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ module.exports = {
return amplify.removeResource(context, category, resourceName).catch(err => {
context.print.info(err.stack);
context.print.error('There was an error removing the auth resource');
context.telemetry.emitError(err);
});
},
};
1 change: 0 additions & 1 deletion packages/amplify-category-auth/commands/auth/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ module.exports = {
.catch(err => {
context.print.info(err.stack);
context.print.error('There was an error adding the auth resource');
context.telemetry.emitError(err);
});
},
};
2 changes: 0 additions & 2 deletions packages/amplify-category-auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ async function add(context) {
.catch(err => {
context.print.info(err.stack);
context.print.error('There was an error adding the auth resource');
context.telemetry.emitError(err);
});
}

Expand Down Expand Up @@ -262,7 +261,6 @@ async function console(context) {
.catch(err => {
context.print.info(err.stack);
context.print.error('There was an error trying to open the auth web console.');
throw err;
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ async function uploadFile(s3Client, hostingBucketName, filePath, file) {
.promise()
.catch(e => {
console.log('e', e);
throw e;
});

return data;
Expand Down
3 changes: 0 additions & 3 deletions packages/amplify-category-auth/tests/commands/enable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ describe('auth enable: ', () => {
info: jest.fn(),
error: jest.fn(),
},
telemetry: {
emitError: jest.fn(),
},
};

it('enable run method should exist', () => {
Expand Down
3 changes: 0 additions & 3 deletions packages/amplify-category-auth/tests/commands/update.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ describe('auth update: ', () => {
info: jest.fn(),
error: jest.fn(),
},
telemetry: {
emitError: jest.fn(),
},
};
const dependencies = ['analytics', 'api', 'function', 'storage'];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ module.exports = {
.catch(err => {
context.print.info(err.stack);
context.print.error('There was an error adding the function resource');
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = {
return amplify.buildResources(context, categoryName, resourceName).catch(err => {
context.print.info(err.stack);
context.print.error('There was an error building the function resources');
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = {
return amplify.pushResources(context, categoryName, resourceName).catch(err => {
context.print.info(err.stack);
context.print.error('An error occurred when pushing the function resource');
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = {
return amplify.removeResource(context, categoryName, resourceName).catch(err => {
context.print.info(err.stack);
context.print.error('An error occurred when removing the function resource');
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module.exports = {
.then(() => context.print.success('Successfully updated resource'))
.catch(err => {
context.print.error(err.stack);
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ export async function askExecRolePermissionsQuestions(context, allDefaultValues,
} catch (e) {
context.print.warning(`Policies cannot be added for ${category}`);
context.print.info(e.stack);
context.telemetry.emitError(e);
}
}

Expand Down
1 change: 0 additions & 1 deletion packages/amplify-category-hosting/commands/hosting/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module.exports = {
return amplify.pushResources(context, category, resourceName).catch(err => {
context.print.info(err.stack);
context.print.error('There was an error pushing the hosting resource');
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ module.exports = {
} catch (err) {
context.print.info(err.stack);
context.print.error('There was an error removing the hosting resource');
context.telemetry.emitError(err);
}
} else {
process.exit(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module.exports = {
.catch(err => {
context.print.info(err.stack);
context.print.error('There was an error adding the interactions resource');
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module.exports = {
return amplify.pushResources(context, category, resourceName).catch(err => {
context.print.info(err.stack);
context.print.error('There was an error pushing the interactions resource');
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module.exports = {
return amplify.removeResource(context, category, resourceName).catch(err => {
context.print.info(err.stack);
context.print.error('There was an error removing the interactions resource');
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module.exports = {
.catch(err => {
context.print.info(err.stack);
context.print.error('There was an error updating the interactions resource');
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ module.exports = {
print.success('Some next steps:');
print.info('"amplify push" builds all of your local backend resources and provisions them in the cloud');
print.info(
'"amplify publish" builds all of your local backend and front-end resources (if you added hosting category) and provisions them in the cloud',
'"amplify publish" builds all of your local backend and front-end resources (if you added hosting category) and provisions them in the cloud'
);
print.info('');
})
.catch(err => {
context.print.info(err.stack);
context.print.error('An error occurred when adding the predictions resource');
context.telemetry.emitError(err);
}),
};
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ module.exports = {
.catch(err => {
context.print.info(err.stack);
context.print.error('An error occurred when removing the predictions resource');
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ module.exports = {
.catch(err => {
context.print.info(err.stack);
context.print.error('An error occurred when updating predictions resource!');
context.telemetry.emitError(err);
}),
};
1 change: 0 additions & 1 deletion packages/amplify-category-predictions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ async function console(context) {
.catch(err => {
context.print.error('Error opening console.');
context.print.info(err.message);
context.telemetry.emitError(err);
});
}

Expand Down
3 changes: 1 addition & 2 deletions packages/amplify-category-storage/commands/storage/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ module.exports = {
print.success('Some next steps:');
print.info('"amplify push" builds all of your local backend resources and provisions them in the cloud');
print.info(
'"amplify publish" builds all of your local backend and front-end resources (if you added hosting category) and provisions them in the cloud',
'"amplify publish" builds all of your local backend and front-end resources (if you added hosting category) and provisions them in the cloud'
);
print.info('');
})
.catch(err => {
context.print.info(err.stack);
context.print.error('An error occurred when adding the storage resource');
context.telemetry.emitError(err);
});
},
};
1 change: 0 additions & 1 deletion packages/amplify-category-storage/commands/storage/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module.exports = {
return amplify.pushResources(context, category, resourceName).catch(err => {
context.print.info(err.stack);
context.print.error('An error occurred when pushing the storage resource');
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module.exports = {
return amplify.removeResource(context, category, resourceName).catch(err => {
context.print.info(err.stack);
context.print.error('An error occurred when removing the storage resource');
context.telemetry.emitError(err);
});
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module.exports = {
.catch(err => {
context.print.info(err.stack);
context.print.error('An error occurred when updating the storage resource');
context.telemetry.emitError(err);
});
},
};
1 change: 0 additions & 1 deletion packages/amplify-category-xr/commands/xr/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = {
return context.amplify.pushResources(context, category, resourceName).catch(err => {
context.print.info(err.stack);
context.print.error('There was an error pushing the XR resource');
context.telemetry.emitError(err);
});
},
};
Loading

0 comments on commit 6a6122b

Please sign in to comment.