Skip to content

Commit

Permalink
Merge pull request #841 from steveukx/feat/remove-legacy-promise
Browse files Browse the repository at this point in the history
Fully deprecate legacy /promise interface
  • Loading branch information
steveukx committed Aug 13, 2022
2 parents a6168ae + 87b0d75 commit a975980
Show file tree
Hide file tree
Showing 25 changed files with 111 additions and 606 deletions.
5 changes: 5 additions & 0 deletions .changeset/friendly-apples-watch.md
@@ -0,0 +1,5 @@
---
"simple-git": minor
---

Increase the level of deprecation notices for use of `simple-git/promise`, which will be fully removed in the next major
2 changes: 1 addition & 1 deletion packages/test-typescript-consumer/package.json
Expand Up @@ -12,7 +12,7 @@
},
"scripts": {
"test": "yarn test:types && yarn test:jest",
"test:types": "tsc -p tsconfig-standard.json && tsc -p tsconfig-promise.json",
"test:types": "tsc",
"test:jest": "jest"
},
"dependencies": {
Expand Down
29 changes: 0 additions & 29 deletions packages/test-typescript-consumer/test/ts-promise-consumer.spec.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/test-typescript-consumer/tsconfig-promise.json

This file was deleted.

10 changes: 0 additions & 10 deletions packages/test-typescript-consumer/tsconfig-standard.json

This file was deleted.

8 changes: 5 additions & 3 deletions packages/test-typescript-consumer/tsconfig.json
Expand Up @@ -5,8 +5,10 @@
"moduleResolution": "Node",
"noEmit": true,
"composite": false,
"esModuleInterop": true,
"baseUrl": ".",
"paths": {}
}
"paths": {},
"esModuleInterop": false,
"allowSyntheticDefaultImports": false
},
"files": ["test/ts-default-from-root.spec.ts"]
}
69 changes: 0 additions & 69 deletions simple-git/promise.d.ts

This file was deleted.

7 changes: 3 additions & 4 deletions simple-git/promise.js
@@ -1,8 +1,7 @@
// TODO: deprecation warning
console.warn(`=============================================
console.error(`=============================================
simple-git has supported promises / async await since version 2.6.0.
Importing from 'simple-git/promise' has been deprecated and will be
removed by July 2022.
Importing from 'simple-git/promise' has been deprecated and will
report this error until the next major release of version 4.
To upgrade, change all 'simple-git/promise' imports to just 'simple-git'
=============================================`);
Expand Down
7 changes: 0 additions & 7 deletions simple-git/test/__fixtures__/instance.ts
Expand Up @@ -4,10 +4,3 @@ export function newSimpleGit(...args: [] | [string] | [Partial<SimpleGitOptions>
const simpleGit = require('../..');
return simpleGit(...args);
}

export function newSimpleGitP(baseDir: unknown | string = '/tmp/example-repo') {
if (typeof baseDir !== 'string') {
throw new Error('Bad arguments to newSimpleGitP');
}
return require('../../promise')(baseDir);
}
79 changes: 0 additions & 79 deletions simple-git/test/consumer/ts-default-from-root.spec.ts

This file was deleted.

36 changes: 0 additions & 36 deletions simple-git/test/consumer/ts-gitp-from-root.spec.ts

This file was deleted.

41 changes: 0 additions & 41 deletions simple-git/test/consumer/ts-promise-consumer.spec.ts

This file was deleted.

14 changes: 0 additions & 14 deletions simple-git/test/consumer/tsconfig-promise.json

This file was deleted.

13 changes: 0 additions & 13 deletions simple-git/test/consumer/tsconfig-standard.json

This file was deleted.

18 changes: 1 addition & 17 deletions simple-git/test/integration/bad-initial-path.spec.ts
@@ -1,10 +1,8 @@
import { promiseError } from '@kwsites/promise-result';
import {
assertGitError,
createTestContext,
like,
newSimpleGit,
newSimpleGitP,
SimpleGitTestContext,
} from '../__fixtures__';

Expand All @@ -15,24 +13,10 @@ describe('bad initial path', () => {

beforeEach(async () => (context = await createTestContext()));

it('simple-git/promise', async () => {
const baseDir = context.path('foo');
const git = newSimpleGitP(baseDir);

const errorInstance = await promiseError(git.init());
assertGitError(errorInstance, `does not exist`, GitConstructError);
expect(errorInstance).toHaveProperty(
'config',
like({
baseDir,
})
);
});

it('simple-git', async () => {
const baseDir = context.path('foo');

let errorInstance: Error | undefined;
let errorInstance: Error | unknown;
try {
newSimpleGit(baseDir);
} catch (e) {
Expand Down

0 comments on commit a975980

Please sign in to comment.