Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove @aws-amplify/cli-core from backend-deployer
Browse files Browse the repository at this point in the history
0618 committed Jan 30, 2024
1 parent a300685 commit c3c517b
Showing 5 changed files with 9 additions and 33 deletions.
3 changes: 0 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions packages/backend-deployer/package.json
Original file line number Diff line number Diff line change
@@ -26,8 +26,5 @@
"peerDependencies": {
"aws-cdk": "^2.110.1",
"typescript": "^5.0.0"
},
"devDependencies": {
"@aws-amplify/cli-core": "^0.3.0"
}
}
18 changes: 8 additions & 10 deletions packages/backend-deployer/src/cdk_deployer.test.ts
Original file line number Diff line number Diff line change
@@ -5,11 +5,6 @@ import { AmplifyError, BackendLocator } from '@aws-amplify/platform-core';
import { DeployProps } from './cdk_deployer_singleton_factory.js';
import { CdkErrorMapper } from './cdk_error_mapper.js';
import { BackendIdentifier } from '@aws-amplify/plugin-types';
import {
LogLevel,
PackageManagerControllerFactory,
Printer,
} from '@aws-amplify/cli-core';

void describe('invokeCDKCommand', () => {
const branchBackendId: BackendIdentifier = {
@@ -31,15 +26,18 @@ void describe('invokeCDKCommand', () => {
// This is needed for `getRelativeBackendEntryPoint` to ensure that backend file exists correctly
const locateMock = mock.fn(() => 'amplify/backend.ts');
const backendLocator = { locate: locateMock } as unknown as BackendLocator;
const packageManagerControllerMock = {
installDependencies: mock.fn(),
initializeProject: mock.fn(),
getWelcomeMessage: mock.fn(() => '`npx amplify help`'),
initializeTsConfig: mock.fn(),
projectRoot: '/testProjectRoot',
};

const packageManagerControllerFactory = new PackageManagerControllerFactory(
process.cwd(),
new Printer(LogLevel.DEBUG)
);
const invoker = new CDKDeployer(
new CdkErrorMapper(),
backendLocator,
packageManagerControllerFactory.getPackageManagerController()
packageManagerControllerMock as never
);
const execaMock = mock.method(invoker, 'executeCommand', () =>
Promise.resolve()
6 changes: 1 addition & 5 deletions packages/backend-deployer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": { "rootDir": "src", "outDir": "lib" },
"references": [
{ "path": "../platform-core" },
{ "path": "../plugin-types" },
{ "path": "../cli-core" }
]
"references": [{ "path": "../platform-core" }, { "path": "../plugin-types" }]
}
12 changes: 0 additions & 12 deletions packages/create-amplify/src/amplify_project_creator.test.ts
Original file line number Diff line number Diff line change
@@ -13,12 +13,6 @@ void describe('AmplifyProjectCreator', () => {
});

void it('create project if passing `--yes` or `-y` to `npm create`', async () => {
const logMock = {
log: mock.fn(),
debug: mock.fn(),
startAnimatingEllipsis: mock.fn(),
stopAnimatingEllipsis: mock.fn(),
};
const packageManagerControllerMock = {
installDependencies: mock.fn(),
initializeProject: mock.fn(),
@@ -59,12 +53,6 @@ void describe('AmplifyProjectCreator', () => {
});

void it('should instruct users to use the custom project root', async () => {
const logMock = {
log: mock.fn(),
debug: mock.fn(),
startAnimatingEllipsis: mock.fn(),
stopAnimatingEllipsis: mock.fn(),
};
const packageManagerControllerMock = {
installDependencies: mock.fn(),
initializeProject: mock.fn(),

0 comments on commit c3c517b

Please sign in to comment.