Skip to content

Commit 6255b8b

Browse files
authored
fix: rm amplify-prompts and use console log (#373)
1 parent c145691 commit 6255b8b

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

packages/amplify-codegen/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@
3737
"js-yaml": "^4.0.0",
3838
"ora": "^4.0.3",
3939
"semver": "^7.3.5",
40-
"slash": "^3.0.0",
41-
"amplify-prompts": "^1.6.2"
40+
"slash": "^3.0.0"
4241
},
4342
"peerDependencies": {
4443
"amplify-cli-core": "^2.3.0",

packages/amplify-codegen/src/utils/validateAmplifyFlutterCapableZeroThreeFeatures.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const yaml = require('js-yaml');
22
const path = require('path');
33
const fs = require('fs-extra');
44
const semver = require('semver');
5-
const { printer } = require('amplify-prompts');
65

76
const PUBSPEC_LOCK_FILE_NAME = 'pubspec.lock';
87
const MINIMUM_VERSION_CONSTRAIN = '>= 0.3.0 || >= 0.3.0-rc.2';
@@ -21,11 +20,11 @@ function validateAmplifyFlutterCapableZeroThreeFeatures(projectRoot) {
2120
return false;
2221
} catch (e) {
2322
if (e.stack) {
24-
printer.error(e.stack);
25-
printer.error(e.message);
23+
console.log(e.stack);
24+
console.log(e.message);
2625
}
2726

28-
printer.error('An error occurred while parsing ' + PUBSPEC_LOCK_FILE_NAME + '.');
27+
console.log('An error occurred while parsing ' + PUBSPEC_LOCK_FILE_NAME + '.');
2928
return false;
3029
}
3130
}

packages/amplify-codegen/tests/utils/validateAmplifyFlutterCapableForNonModel.test.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,11 @@ const {
66
const mockFs = require('mock-fs');
77
const { join } = require('path');
88
const yaml = require('js-yaml');
9-
const { printer } = require('amplify-prompts');
10-
11-
jest.mock('amplify-prompts', () => ({
12-
printer: {
13-
error: jest.fn()
14-
},
15-
}));
169

1710
const MOCK_PROJECT_ROOT = 'project';
1811
const MOCK_PUBSPEC_FILE_PATH = join(MOCK_PROJECT_ROOT, PUBSPEC_LOCK_FILE_NAME);
19-
const mockErrorPrinter = printer.error;
12+
global.console = {log: jest.fn()}
13+
const mockErrorPrinter = console.log;
2014

2115
describe('Validate amplify flutter version tests', () => {
2216
afterEach(() => {

0 commit comments

Comments
 (0)