@whook/create 9.0.1 → 10.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/create.js +2 -2
- package/dist/index.js +47 -68
- package/dist/index.js.map +1 -1
- package/dist/services/author.js +46 -72
- package/dist/services/author.js.map +1 -1
- package/dist/services/author.test.js +86 -92
- package/dist/services/author.test.js.map +1 -1
- package/dist/services/createWhook.d.ts +8 -11
- package/dist/services/createWhook.js +142 -144
- package/dist/services/createWhook.js.map +1 -1
- package/dist/services/createWhook.test.js +392 -506
- package/dist/services/createWhook.test.js.map +1 -1
- package/dist/services/project.d.ts +2 -2
- package/dist/services/project.js +40 -62
- package/dist/services/project.js.map +1 -1
- package/dist/services/project.test.js +73 -80
- package/dist/services/project.test.js.map +1 -1
- package/package.json +50 -96
- package/src/index.ts +24 -17
- package/src/services/__snapshots__/author.test.ts.snap +3 -3
- package/src/services/__snapshots__/createWhook.test.ts.snap +712 -4
- package/src/services/author.test.ts +8 -6
- package/src/services/author.ts +2 -2
- package/src/services/createWhook.test.ts +197 -312
- package/src/services/createWhook.ts +38 -13
- package/src/services/project.test.ts +11 -6
- package/src/services/project.ts +3 -2
- package/dist/index.mjs +0 -47
- package/dist/index.mjs.map +0 -1
- package/dist/services/author.mjs +0 -63
- package/dist/services/author.mjs.map +0 -1
- package/dist/services/author.test.mjs +0 -94
- package/dist/services/author.test.mjs.map +0 -1
- package/dist/services/createWhook.mjs +0 -135
- package/dist/services/createWhook.mjs.map +0 -1
- package/dist/services/createWhook.test.mjs +0 -834
- package/dist/services/createWhook.test.mjs.map +0 -1
- package/dist/services/project.mjs +0 -50
- package/dist/services/project.mjs.map +0 -1
- package/dist/services/project.test.mjs +0 -80
- package/dist/services/project.test.mjs.map +0 -1
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import { jest } from '@jest/globals';
|
|
1
2
|
import _inquirer from 'inquirer';
|
|
2
|
-
import initAuthor from './author';
|
|
3
|
-
import YError from 'yerror';
|
|
3
|
+
import initAuthor from './author.js';
|
|
4
|
+
import { YError } from 'yerror';
|
|
5
|
+
import type { LogService, LockService } from 'common-services';
|
|
4
6
|
|
|
5
7
|
describe('initAuthor', () => {
|
|
6
8
|
const exec = jest.fn() as any;
|
|
7
9
|
const lock = {
|
|
8
|
-
take: jest.fn(),
|
|
9
|
-
release: jest.fn(),
|
|
10
|
+
take: jest.fn<LockService<unknown>['take']>(),
|
|
11
|
+
release: jest.fn<LockService<unknown>['release']>(),
|
|
10
12
|
};
|
|
11
|
-
const inquirer = { prompt: jest.fn() };
|
|
12
|
-
const log = jest.fn();
|
|
13
|
+
const inquirer = { prompt: jest.fn<typeof _inquirer['prompt']>() };
|
|
14
|
+
const log = jest.fn<LogService>();
|
|
13
15
|
|
|
14
16
|
beforeEach(() => {
|
|
15
17
|
exec.mockReset();
|
package/src/services/author.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { autoService } from 'knifecycle';
|
|
2
2
|
import _inquirer from 'inquirer';
|
|
3
|
-
import YError from 'yerror';
|
|
3
|
+
import { YError } from 'yerror';
|
|
4
4
|
import { exec as _exec } from 'child_process';
|
|
5
5
|
import type { LockService, LogService } from 'common-services';
|
|
6
6
|
|
|
@@ -41,7 +41,7 @@ export default autoService(async function initAuthor({
|
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
name: 'authorEmail',
|
|
44
|
-
message: '
|
|
44
|
+
message: 'Your email?',
|
|
45
45
|
default: userEmail,
|
|
46
46
|
},
|
|
47
47
|
])) as { authorName: string; authorEmail: string };
|