@aws-amplify/amplify-prompts
Advanced tools
Comparing version 2.8.0-replace-lambda-callouts-branch.0 to 2.8.0-split-deploy-step.0
@@ -22,3 +22,3 @@ ## API Report File for "@aws-amplify/amplify-prompts" | ||
// (undocumented) | ||
error: (line: string) => void; | ||
error: (line: string, error?: any) => void; | ||
// Warning: (ae-forgotten-export) The symbol "Color" needs to be exported by the entry point index.d.ts | ||
@@ -184,3 +184,3 @@ // | ||
warn: (line: string) => void; | ||
error: (line: string) => void; | ||
error: (line: string, error?: any) => void; | ||
}; | ||
@@ -187,0 +187,0 @@ |
@@ -6,3 +6,3 @@ # Change Log | ||
# [2.8.0-replace-lambda-callouts-branch.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-prompts@2.6.8...@aws-amplify/amplify-prompts@2.8.0-replace-lambda-callouts-branch.0) (2023-05-30) | ||
# [2.8.0-split-deploy-step.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-prompts@2.7.0...@aws-amplify/amplify-prompts@2.8.0-split-deploy-step.0) (2023-06-10) | ||
@@ -12,3 +12,3 @@ | ||
* mock and mock function adds capabilities for function and resource selection ([#12268](https://github.com/aws-amplify/amplify-cli/issues/12268)) ([d18e1a6](https://github.com/aws-amplify/amplify-cli/commit/d18e1a65f885ebd289637d4f77e197b2c6cfe44c)) | ||
* display error message instead of object ([#12636](https://github.com/aws-amplify/amplify-cli/issues/12636)) ([811e8fc](https://github.com/aws-amplify/amplify-cli/commit/811e8fcd48f15b37401643b9b13f628acb4708bd)) | ||
@@ -15,0 +15,0 @@ |
@@ -10,3 +10,3 @@ /// <reference types="node" /> | ||
warn: (line: string) => void; | ||
error: (line: string) => void; | ||
error: (line: string, error?: any) => void; | ||
private writeSilenceableLine; | ||
@@ -22,3 +22,3 @@ private writeLine; | ||
warn: (line: string) => void; | ||
error: (line: string) => void; | ||
error: (line: string, error?: any) => void; | ||
}; | ||
@@ -25,0 +25,0 @@ type Color = 'green' | 'blue' | 'yellow' | 'red' | 'reset'; |
@@ -30,4 +30,9 @@ "use strict"; | ||
}; | ||
this.error = (line) => { | ||
this.error = (line, error) => { | ||
var _a; | ||
this.writeLine(`${flags_1.isHeadless ? '' : '🛑 '}${chalk_1.default.red(line)}`); | ||
const errorMessage = (_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error; | ||
if (errorMessage) { | ||
this.writeLine(`${chalk_1.default.red(errorMessage)}`); | ||
} | ||
}; | ||
@@ -34,0 +39,0 @@ this.writeSilenceableLine = (line) => { |
{ | ||
"name": "@aws-amplify/amplify-prompts", | ||
"version": "2.8.0-replace-lambda-callouts-branch.0", | ||
"version": "2.8.0-split-deploy-step.0", | ||
"description": "Utility functions for Amplify CLI terminal I/O", | ||
@@ -34,3 +34,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@aws-amplify/amplify-cli-shared-interfaces": "1.2.2", | ||
"@aws-amplify/amplify-cli-shared-interfaces": "1.2.3-split-deploy-step.0", | ||
"chalk": "^4.1.1", | ||
@@ -44,3 +44,5 @@ "enquirer": "^2.3.6" | ||
"collectCoverage": true, | ||
"testURL": "http://localhost", | ||
"testEnvironmentOptions": { | ||
"url": "http://localhost" | ||
}, | ||
"roots": [ | ||
@@ -62,3 +64,8 @@ "<rootDir>/src" | ||
}, | ||
"gitHead": "6a354cebfc457695cdde29be34d250ea0e525cd1" | ||
"berry": { | ||
"plugins": [ | ||
"@yarn/plugin-typescript" | ||
] | ||
}, | ||
"gitHead": "d19990b66d0335642cb7d045ad2da9714891ad74" | ||
} |
@@ -84,1 +84,7 @@ import { AmplifyPrinter } from '../printer'; | ||
}); | ||
it('prints error message when the error is an object', () => { | ||
printer.error('', new Error(testInput)); | ||
expect(writeStream_stub.write.mock.calls[1][0].trim()).toMatchInlineSnapshot(`"[31mthis is a test line[39m"`); | ||
}); |
@@ -33,4 +33,9 @@ import chalk from 'chalk'; | ||
error = (line: string): void => { | ||
// disable-eslint-next-line @typescript-eslint/no-explicit-any | ||
error = (line: string, error?: any): void => { | ||
this.writeLine(`${isHeadless ? '' : '🛑 '}${chalk.red(line)}`); | ||
const errorMessage = error?.message ?? error; | ||
if (errorMessage) { | ||
this.writeLine(`${chalk.red(errorMessage)}`); | ||
} | ||
}; | ||
@@ -63,5 +68,5 @@ | ||
warn: (line: string) => void; | ||
error: (line: string) => void; | ||
error: (line: string, error?: any) => void; | ||
}; | ||
type Color = 'green' | 'blue' | 'yellow' | 'red' | 'reset'; |
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
267190
3184
+ Added@aws-amplify/amplify-cli-shared-interfaces@1.2.3-split-deploy-step.0(transitive)
- Removed@aws-amplify/amplify-cli-shared-interfaces@1.2.2(transitive)
Updated@aws-amplify/amplify-cli-shared-interfaces@1.2.3-split-deploy-step.0