apify-test-tools 0.4.0 → 0.5.1
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/.prettierrc +5 -0
- package/.vscode/settings.json +3 -0
- package/CHANGELOG.md +14 -0
- package/bin/git.ts +11 -16
- package/bin/github.ts +5 -14
- package/bin/main.ts +38 -38
- package/bin/slack.ts +13 -16
- package/dist/bin/git.d.ts +2 -2
- package/dist/bin/git.d.ts.map +1 -1
- package/dist/bin/git.js +3 -6
- package/dist/bin/git.js.map +1 -1
- package/dist/bin/github.d.ts +1 -1
- package/dist/bin/github.d.ts.map +1 -1
- package/dist/bin/github.js +3 -9
- package/dist/bin/github.js.map +1 -1
- package/dist/bin/main.js +5 -7
- package/dist/bin/main.js.map +1 -1
- package/dist/bin/slack.d.ts +2 -2
- package/dist/bin/slack.d.ts.map +1 -1
- package/dist/bin/slack.js +4 -2
- package/dist/bin/slack.js.map +1 -1
- package/dist/lib/consts.d.ts +1 -1
- package/dist/lib/consts.d.ts.map +1 -1
- package/dist/lib/consts.js +2 -4
- package/dist/lib/consts.js.map +1 -1
- package/dist/lib/extend-expect.d.ts.map +1 -1
- package/dist/lib/extend-expect.js +11 -0
- package/dist/lib/extend-expect.js.map +1 -1
- package/dist/lib/lib.d.ts +1 -1
- package/dist/lib/lib.d.ts.map +1 -1
- package/dist/lib/lib.js +10 -7
- package/dist/lib/lib.js.map +1 -1
- package/dist/lib/run-test-result.d.ts +1 -1
- package/dist/lib/run-test-result.d.ts.map +1 -1
- package/dist/lib/run-test-result.js +1 -0
- package/dist/lib/run-test-result.js.map +1 -1
- package/dist/lib/types.d.ts +4 -0
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/test/unit/custom-matchers.test.js +2 -2
- package/dist/test/unit/custom-matchers.test.js.map +1 -1
- package/dist/test/unit/parse-commit.test.js +5 -5
- package/dist/test/unit/parse-commit.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/lib/consts.ts +3 -5
- package/lib/extend-expect.ts +37 -22
- package/lib/lib.ts +29 -40
- package/lib/run-test-result.ts +9 -10
- package/lib/types.ts +70 -67
- package/package.json +4 -1
- package/test/unit/custom-matchers.test.ts +6 -9
- package/test/unit/parse-commit.test.ts +6 -7
- package/tsconfig.json +4 -8
- package/test/unit/test-actor.test.ts +0 -17
package/.prettierrc
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.1
|
|
4
|
+
|
|
5
|
+
fix: properly check on maxRetriesPerRequest
|
|
6
|
+
fix: change module resolution to nodenext and fix types
|
|
7
|
+
|
|
8
|
+
## 0.5.0
|
|
9
|
+
|
|
10
|
+
feat: feat: add maxRetriesPerRequest test
|
|
11
|
+
|
|
12
|
+
## 0.4.0
|
|
13
|
+
|
|
14
|
+
- feat: verbose message for toFinishWith failed assertions
|
|
15
|
+
- docs: update retry count default value to 1
|
|
16
|
+
|
|
3
17
|
## 0.3.0
|
|
4
18
|
|
|
5
19
|
### Lib
|
package/bin/git.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { Commit, Config } from './types';
|
|
1
|
+
import { Commit, Config } from './types.js';
|
|
2
2
|
import { spawnCommandInGhWorkspace } from './utils.js';
|
|
3
3
|
|
|
4
4
|
export const GIT_FORMAT_SEPARATOR = '»¦«';
|
|
5
5
|
const GIT_LOG_FORMAT = ['%H', '%aN<%aE>', '%aD', '%s'].join(GIT_FORMAT_SEPARATOR);
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
export const getBranchLastCommit = (branch: string): Commit => {
|
|
9
8
|
const commitString = spawnCommandInGhWorkspace(`git log -1 --pretty=format:'${GIT_LOG_FORMAT}' ${branch}`);
|
|
10
9
|
const commit = parseCommit(commitString);
|
|
@@ -12,17 +11,14 @@ export const getBranchLastCommit = (branch: string): Commit => {
|
|
|
12
11
|
};
|
|
13
12
|
|
|
14
13
|
export const getChangedFiles = (commits: Commit[]) => {
|
|
15
|
-
const changedFiles =
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const changedFiles =
|
|
15
|
+
commits.length === 1
|
|
16
|
+
? spawnCommandInGhWorkspace(`git show --pretty='format:' --name-only ${commits[0].sha}`)
|
|
17
|
+
: spawnCommandInGhWorkspace(`git diff --name-only ${commits[0].sha}..${commits[commits.length - 1].sha}`);
|
|
18
18
|
return changedFiles.split('\n');
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
export const getCommits = ({
|
|
22
|
-
sourceBranch,
|
|
23
|
-
targetBranch,
|
|
24
|
-
baseCommit: baseCommitSha,
|
|
25
|
-
}: Config): Commit[] => {
|
|
21
|
+
export const getCommits = ({ sourceBranch, targetBranch, baseCommit: baseCommitSha }: Config): Commit[] => {
|
|
26
22
|
const targetBranchCommit = getBranchLastCommit(targetBranch);
|
|
27
23
|
const sourceBranchCommit = getBranchLastCommit(sourceBranch);
|
|
28
24
|
let baseCommit: Commit | undefined;
|
|
@@ -38,13 +34,12 @@ export const getCommits = ({
|
|
|
38
34
|
// console.log(`git log --pretty=format:"${gitOutputFormat}" ${targetBranch}..${sourceBranch}`);
|
|
39
35
|
// return [];
|
|
40
36
|
const base = getBaseCommit(sourceBranchCommit, targetBranchCommit);
|
|
41
|
-
const commitsStrings = spawnCommandInGhWorkspace(
|
|
42
|
-
|
|
37
|
+
const commitsStrings = spawnCommandInGhWorkspace(
|
|
38
|
+
`git log --pretty=format:'${GIT_LOG_FORMAT}' ${base.sha}..${sourceBranchCommit.sha}`
|
|
39
|
+
).split('\n');
|
|
43
40
|
const commits = commitsStrings.map((commitString) => parseCommit(commitString)) as Commit[];
|
|
44
41
|
commits.reverse();
|
|
45
|
-
const baseCommitIndex = baseCommit
|
|
46
|
-
? commits.findIndex(({ sha }) => sha === baseCommit.sha)
|
|
47
|
-
: -1;
|
|
42
|
+
const baseCommitIndex = baseCommit ? commits.findIndex(({ sha }) => sha === baseCommit.sha) : -1;
|
|
48
43
|
return commits.slice(baseCommitIndex + 1);
|
|
49
44
|
};
|
|
50
45
|
|
|
@@ -72,4 +67,4 @@ export const parseCommit = (commitString: string): Commit => {
|
|
|
72
67
|
date,
|
|
73
68
|
message,
|
|
74
69
|
};
|
|
75
|
-
}
|
|
70
|
+
};
|
package/bin/github.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fs from 'fs/promises';
|
|
2
|
-
import { Commit, GitHubEventPush } from './types';
|
|
2
|
+
import { Commit, GitHubEventPush } from './types.js';
|
|
3
3
|
import { spawnCommandInGhWorkspace } from './utils.js';
|
|
4
4
|
|
|
5
5
|
export const getPushData = async (path: string) => {
|
|
@@ -8,7 +8,7 @@ export const getPushData = async (path: string) => {
|
|
|
8
8
|
const {
|
|
9
9
|
commits: ghCommits,
|
|
10
10
|
repository: { ssh_url: repoUrl, name },
|
|
11
|
-
head_commit: { author }
|
|
11
|
+
head_commit: { author },
|
|
12
12
|
} = event;
|
|
13
13
|
const commits: Commit[] = ghCommits.map(({ author, message, id, timestamp }) => ({
|
|
14
14
|
author: author.username,
|
|
@@ -25,7 +25,7 @@ export const getPushData = async (path: string) => {
|
|
|
25
25
|
repoUrl,
|
|
26
26
|
changelog,
|
|
27
27
|
repository: name,
|
|
28
|
-
author: author.name
|
|
28
|
+
author: author.name,
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
|
|
@@ -39,22 +39,13 @@ const getChangedFiles = ({ after, before }: GitHubEventPush): string[] => {
|
|
|
39
39
|
return changedFiles.split('\n');
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
export const getChangelogChanges = (
|
|
43
|
-
changedFiles: string[],
|
|
44
|
-
event: GitHubEventPush,
|
|
45
|
-
): string | null => {
|
|
42
|
+
export const getChangelogChanges = (changedFiles: string[], event: GitHubEventPush): string | null => {
|
|
46
43
|
const changelogPath = 'CHANGELOG.md';
|
|
47
44
|
if (!changedFiles.includes(changelogPath)) {
|
|
48
45
|
return null;
|
|
49
46
|
}
|
|
50
47
|
const { after, before } = event;
|
|
51
|
-
const diff = spawnCommandInGhWorkspace('git', [
|
|
52
|
-
'diff',
|
|
53
|
-
before,
|
|
54
|
-
after,
|
|
55
|
-
'--',
|
|
56
|
-
changelogPath,
|
|
57
|
-
]);
|
|
48
|
+
const diff = spawnCommandInGhWorkspace('git', ['diff', before, after, '--', changelogPath]);
|
|
58
49
|
|
|
59
50
|
const added: string[] = [];
|
|
60
51
|
let startedChangelog = false;
|
package/bin/main.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import process from 'process';
|
|
4
|
-
import yargs from 'yargs';
|
|
4
|
+
import yargs, { type Argv } from 'yargs';
|
|
5
5
|
import { hideBin } from 'yargs/helpers';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
getRepoActors,
|
|
9
|
-
getChangedActors,
|
|
10
|
-
spawnCommandInGhWorkspace,
|
|
11
|
-
setCwd,
|
|
12
|
-
} from './utils.js';
|
|
7
|
+
import { getRepoActors, getChangedActors, spawnCommandInGhWorkspace, setCwd } from './utils.js';
|
|
13
8
|
import { runBuilds } from './build.js';
|
|
14
9
|
import { getChangedFiles, getCommits } from './git.js';
|
|
15
10
|
import { getPushData } from './github.js';
|
|
@@ -21,7 +16,7 @@ import { reportTestRestuls } from './test-report.js';
|
|
|
21
16
|
*/
|
|
22
17
|
const middlewares = [setCwd];
|
|
23
18
|
|
|
24
|
-
const buildOptions = (y:
|
|
19
|
+
const buildOptions = (y: Argv) => {
|
|
25
20
|
return y
|
|
26
21
|
.option('target-branch', {
|
|
27
22
|
type: 'string',
|
|
@@ -33,7 +28,7 @@ const buildOptions = (y: yargs.Argv) => {
|
|
|
33
28
|
})
|
|
34
29
|
.option('base-commit', {
|
|
35
30
|
type: 'string',
|
|
36
|
-
})
|
|
31
|
+
});
|
|
37
32
|
};
|
|
38
33
|
|
|
39
34
|
await yargs()
|
|
@@ -61,10 +56,15 @@ await yargs()
|
|
|
61
56
|
const changedFiles = getChangedFiles(commits);
|
|
62
57
|
console.log(JSON.stringify(changedFiles));
|
|
63
58
|
})
|
|
64
|
-
.command(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
.command(
|
|
60
|
+
'get-actor-configs',
|
|
61
|
+
'',
|
|
62
|
+
(_) => _,
|
|
63
|
+
async () => {
|
|
64
|
+
const actorConfigs = await getRepoActors();
|
|
65
|
+
console.log(JSON.stringify(actorConfigs));
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
68
|
.command('get-affected-actors', '', buildOptions, async (args) => {
|
|
69
69
|
const commits = getCommits(args);
|
|
70
70
|
const changedFiles = getChangedFiles(commits);
|
|
@@ -75,19 +75,20 @@ await yargs()
|
|
|
75
75
|
.command(
|
|
76
76
|
'report-tests',
|
|
77
77
|
'',
|
|
78
|
-
(args) =>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
(args) =>
|
|
79
|
+
args
|
|
80
|
+
.option('report-file', { type: 'string', demandOption: true })
|
|
81
|
+
.option('job-url', { type: 'string' })
|
|
82
|
+
.option('workflow-name', { type: 'string' })
|
|
83
|
+
.option('repository', { type: 'string' }),
|
|
83
84
|
async (args) => {
|
|
84
85
|
await reportTestRestuls(args);
|
|
85
|
-
}
|
|
86
|
+
}
|
|
87
|
+
)
|
|
86
88
|
.command(
|
|
87
89
|
'build',
|
|
88
90
|
'',
|
|
89
|
-
(args) => buildOptions(args)
|
|
90
|
-
.option('dry-run', { type: 'boolean', default: false }),
|
|
91
|
+
(args) => buildOptions(args).option('dry-run', { type: 'boolean', default: false }),
|
|
91
92
|
async (args) => {
|
|
92
93
|
const commits = getCommits(args);
|
|
93
94
|
const changedFiles = getChangedFiles(commits);
|
|
@@ -98,8 +99,10 @@ await yargs()
|
|
|
98
99
|
});
|
|
99
100
|
// https://github.com/apify-store/google-maps#:actors/lukaskrivka_google-maps-with-contact-details
|
|
100
101
|
// git@github.com:apify-store/google-maps#:actors/lukaskrivka_google-maps-with-contact-details
|
|
101
|
-
const repoUrl = spawnCommandInGhWorkspace(`git remote get-url origin`)
|
|
102
|
-
|
|
102
|
+
const repoUrl = spawnCommandInGhWorkspace(`git remote get-url origin`).replace(
|
|
103
|
+
/^https:\/\/github\.com\//,
|
|
104
|
+
'git@github.com:'
|
|
105
|
+
);
|
|
103
106
|
|
|
104
107
|
const builds = await runBuilds({
|
|
105
108
|
repoUrl,
|
|
@@ -108,23 +111,19 @@ await yargs()
|
|
|
108
111
|
dryRun: args.dryRun,
|
|
109
112
|
});
|
|
110
113
|
console.log(JSON.stringify(builds));
|
|
111
|
-
}
|
|
114
|
+
}
|
|
115
|
+
)
|
|
112
116
|
.command(
|
|
113
117
|
'release',
|
|
114
118
|
'',
|
|
115
|
-
(args) =>
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
(args) =>
|
|
120
|
+
args
|
|
121
|
+
.option('push-event-path', { type: 'string', demandOption: true })
|
|
122
|
+
.option('dry-run', { type: 'boolean', default: false }),
|
|
118
123
|
async (args) => {
|
|
119
|
-
const {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
repoUrl,
|
|
123
|
-
commits,
|
|
124
|
-
changelog,
|
|
125
|
-
repository,
|
|
126
|
-
author,
|
|
127
|
-
} = await getPushData(args.pushEventPath);
|
|
124
|
+
const { branch, changedFiles, repoUrl, commits, changelog, repository, author } = await getPushData(
|
|
125
|
+
args.pushEventPath
|
|
126
|
+
);
|
|
128
127
|
const isLatest = true;
|
|
129
128
|
const actorConfigs = await getRepoActors();
|
|
130
129
|
const { actorsChanged } = getChangedActors({
|
|
@@ -149,9 +148,10 @@ await yargs()
|
|
|
149
148
|
changelog,
|
|
150
149
|
repository,
|
|
151
150
|
dryRun,
|
|
152
|
-
author
|
|
151
|
+
author,
|
|
153
152
|
});
|
|
154
|
-
}
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
155
|
.strictCommands()
|
|
156
156
|
.demandCommand(1, 'Command is required')
|
|
157
157
|
.parse(hideBin(process.argv));
|
package/bin/slack.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { WebClient } from '@slack/web-api';
|
|
2
|
-
import { Commit } from './types';
|
|
2
|
+
import { Commit } from './types.js';
|
|
3
3
|
import { getEnvVar } from './utils.js';
|
|
4
4
|
|
|
5
5
|
type NotifyToSlackOptions = {
|
|
6
|
-
repository: string
|
|
7
|
-
changedFiles: string[]
|
|
8
|
-
changelog: string | null
|
|
9
|
-
commits: Commit[]
|
|
10
|
-
dryRun: boolean
|
|
11
|
-
author: string
|
|
12
|
-
}
|
|
6
|
+
repository: string;
|
|
7
|
+
changedFiles: string[];
|
|
8
|
+
changelog: string | null;
|
|
9
|
+
commits: Commit[];
|
|
10
|
+
dryRun: boolean;
|
|
11
|
+
author: string;
|
|
12
|
+
};
|
|
13
13
|
|
|
14
14
|
export const notifyToSlack = async ({
|
|
15
15
|
changedFiles,
|
|
@@ -17,7 +17,7 @@ export const notifyToSlack = async ({
|
|
|
17
17
|
changelog,
|
|
18
18
|
repository,
|
|
19
19
|
dryRun,
|
|
20
|
-
author
|
|
20
|
+
author,
|
|
21
21
|
}: NotifyToSlackOptions) => {
|
|
22
22
|
const slack = new WebClient(getEnvVar('SLACK_TOKEN_RELEASES_BOT'));
|
|
23
23
|
|
|
@@ -42,7 +42,9 @@ export const notifyToSlack = async ({
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
const commitsMessage = `${commits
|
|
45
|
+
const commitsMessage = `${commits
|
|
46
|
+
.map(({ author, message }, index) => `${index + 1}. Commit message: ${message}\n\tAuthor: ${author}.`)
|
|
47
|
+
.join('\n')}`;
|
|
46
48
|
const changedFilesMessage = `**Files changed**: ${changedFiles.join(', ')}`;
|
|
47
49
|
const longMessage = `${shortMessage}\n**Commit list**:\n${commitsMessage}\n\n${changedFilesMessage}`;
|
|
48
50
|
|
|
@@ -59,12 +61,7 @@ export const notifyToSlack = async ({
|
|
|
59
61
|
}
|
|
60
62
|
};
|
|
61
63
|
|
|
62
|
-
export const sendSlackMessage = async (
|
|
63
|
-
channel: string,
|
|
64
|
-
text: string,
|
|
65
|
-
blocks: string[],
|
|
66
|
-
token: string,
|
|
67
|
-
) => {
|
|
64
|
+
export const sendSlackMessage = async (channel: string, text: string, blocks: string[], token: string) => {
|
|
68
65
|
const slack = new WebClient(token);
|
|
69
66
|
const { ts } = await slack.chat.postMessage({ text, channel });
|
|
70
67
|
if (blocks.length > 0 && ts) {
|
package/dist/bin/git.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Commit, Config } from './types';
|
|
1
|
+
import { Commit, Config } from './types.js';
|
|
2
2
|
export declare const GIT_FORMAT_SEPARATOR = "\u00BB\u00A6\u00AB";
|
|
3
3
|
export declare const getBranchLastCommit: (branch: string) => Commit;
|
|
4
4
|
export declare const getChangedFiles: (commits: Commit[]) => string[];
|
|
5
|
-
export declare const getCommits: ({ sourceBranch, targetBranch, baseCommit: baseCommitSha
|
|
5
|
+
export declare const getCommits: ({ sourceBranch, targetBranch, baseCommit: baseCommitSha }: Config) => Commit[];
|
|
6
6
|
export declare const getBaseCommit: (target: Commit, source: Commit) => Commit;
|
|
7
7
|
export declare const getCommitInfo: (commitSha: string) => Commit;
|
|
8
8
|
export declare const parseCommit: (commitString: string) => Commit;
|
package/dist/bin/git.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../bin/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../bin/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAG5C,eAAO,MAAM,oBAAoB,uBAAQ,CAAC;AAG1C,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,KAAG,MAIpD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,EAAE,aAMhD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,2DAA2D,MAAM,KAAG,MAAM,EAuBpG,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM,KAAG,MAI9D,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,WAAW,MAAM,KAAG,MAIjD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,cAAc,MAAM,KAAG,MAYlD,CAAC"}
|
package/dist/bin/git.js
CHANGED
|
@@ -12,7 +12,7 @@ export const getChangedFiles = (commits) => {
|
|
|
12
12
|
: spawnCommandInGhWorkspace(`git diff --name-only ${commits[0].sha}..${commits[commits.length - 1].sha}`);
|
|
13
13
|
return changedFiles.split('\n');
|
|
14
14
|
};
|
|
15
|
-
export const getCommits = ({ sourceBranch, targetBranch, baseCommit: baseCommitSha
|
|
15
|
+
export const getCommits = ({ sourceBranch, targetBranch, baseCommit: baseCommitSha }) => {
|
|
16
16
|
const targetBranchCommit = getBranchLastCommit(targetBranch);
|
|
17
17
|
const sourceBranchCommit = getBranchLastCommit(sourceBranch);
|
|
18
18
|
let baseCommit;
|
|
@@ -29,13 +29,10 @@ export const getCommits = ({ sourceBranch, targetBranch, baseCommit: baseCommitS
|
|
|
29
29
|
// console.log(`git log --pretty=format:"${gitOutputFormat}" ${targetBranch}..${sourceBranch}`);
|
|
30
30
|
// return [];
|
|
31
31
|
const base = getBaseCommit(sourceBranchCommit, targetBranchCommit);
|
|
32
|
-
const commitsStrings = spawnCommandInGhWorkspace(`git log --pretty=format:'${GIT_LOG_FORMAT}' ${base.sha}..${sourceBranchCommit.sha}`)
|
|
33
|
-
.split('\n');
|
|
32
|
+
const commitsStrings = spawnCommandInGhWorkspace(`git log --pretty=format:'${GIT_LOG_FORMAT}' ${base.sha}..${sourceBranchCommit.sha}`).split('\n');
|
|
34
33
|
const commits = commitsStrings.map((commitString) => parseCommit(commitString));
|
|
35
34
|
commits.reverse();
|
|
36
|
-
const baseCommitIndex = baseCommit
|
|
37
|
-
? commits.findIndex(({ sha }) => sha === baseCommit.sha)
|
|
38
|
-
: -1;
|
|
35
|
+
const baseCommitIndex = baseCommit ? commits.findIndex(({ sha }) => sha === baseCommit.sha) : -1;
|
|
39
36
|
return commits.slice(baseCommitIndex + 1);
|
|
40
37
|
};
|
|
41
38
|
export const getBaseCommit = (target, source) => {
|
package/dist/bin/git.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../bin/git.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAC1C,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../bin/git.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAC1C,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAElF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAc,EAAU,EAAE;IAC1D,MAAM,YAAY,GAAG,yBAAyB,CAAC,+BAA+B,cAAc,KAAK,MAAM,EAAE,CAAC,CAAC;IAC3G,MAAM,MAAM,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;IACzC,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,C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MAAM,CAAC;IAC5C,OAAO;QACH,GAAG;QACH,MAAM;QACN,IAAI;QACJ,OAAO;KACV,CAAC;AACN,CAAC,CAAC"}
|
package/dist/bin/github.d.ts
CHANGED
package/dist/bin/github.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../bin/github.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../bin/github.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGrD,eAAO,MAAM,WAAW,GAAU,MAAM,MAAM;;;;;;;;EAyB7C,CAAC;AAEF,eAAO,MAAM,eAAe,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,eAAe,CAG3E,CAAC;AAOF,eAAO,MAAM,mBAAmB,GAAI,cAAc,MAAM,EAAE,EAAE,OAAO,eAAe,KAAG,MAAM,GAAG,IA0B7F,CAAC"}
|
package/dist/bin/github.js
CHANGED
|
@@ -3,7 +3,7 @@ import { spawnCommandInGhWorkspace } from './utils.js';
|
|
|
3
3
|
export const getPushData = async (path) => {
|
|
4
4
|
const event = await loadGitHubEvent(path);
|
|
5
5
|
const branch = event.ref.replace('refs/heads/', '');
|
|
6
|
-
const { commits: ghCommits, repository: { ssh_url: repoUrl, name }, head_commit: { author } } = event;
|
|
6
|
+
const { commits: ghCommits, repository: { ssh_url: repoUrl, name }, head_commit: { author }, } = event;
|
|
7
7
|
const commits = ghCommits.map(({ author, message, id, timestamp }) => ({
|
|
8
8
|
author: author.username,
|
|
9
9
|
sha: id,
|
|
@@ -19,7 +19,7 @@ export const getPushData = async (path) => {
|
|
|
19
19
|
repoUrl,
|
|
20
20
|
changelog,
|
|
21
21
|
repository: name,
|
|
22
|
-
author: author.name
|
|
22
|
+
author: author.name,
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
25
|
export const loadGitHubEvent = async (path) => {
|
|
@@ -36,13 +36,7 @@ export const getChangelogChanges = (changedFiles, event) => {
|
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
38
|
const { after, before } = event;
|
|
39
|
-
const diff = spawnCommandInGhWorkspace('git', [
|
|
40
|
-
'diff',
|
|
41
|
-
before,
|
|
42
|
-
after,
|
|
43
|
-
'--',
|
|
44
|
-
changelogPath,
|
|
45
|
-
]);
|
|
39
|
+
const diff = spawnCommandInGhWorkspace('git', ['diff', before, after, '--', changelogPath]);
|
|
46
40
|
const added = [];
|
|
47
41
|
let startedChangelog = false;
|
|
48
42
|
for (const line of diff.split('\n')) {
|
package/dist/bin/github.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.js","sourceRoot":"","sources":["../../bin/github.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAE7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,IAAY,EAAE,EAAE;IAC9C,MAAM,KAAK,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;IACpD,MAAM,EACF,OAAO,EAAE,SAAS,EAClB,UAAU,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EACtC,WAAW,EAAE,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"github.js","sourceRoot":"","sources":["../../bin/github.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAE7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,IAAY,EAAE,EAAE;IAC9C,MAAM,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C,CAAC"}
|
package/dist/bin/main.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import process from 'process';
|
|
3
3
|
import yargs from 'yargs';
|
|
4
4
|
import { hideBin } from 'yargs/helpers';
|
|
5
|
-
import { getRepoActors, getChangedActors, spawnCommandInGhWorkspace, setCwd
|
|
5
|
+
import { getRepoActors, getChangedActors, spawnCommandInGhWorkspace, setCwd } from './utils.js';
|
|
6
6
|
import { runBuilds } from './build.js';
|
|
7
7
|
import { getChangedFiles, getCommits } from './git.js';
|
|
8
8
|
import { getPushData } from './github.js';
|
|
@@ -69,8 +69,7 @@ await yargs()
|
|
|
69
69
|
.option('repository', { type: 'string' }), async (args) => {
|
|
70
70
|
await reportTestRestuls(args);
|
|
71
71
|
})
|
|
72
|
-
.command('build', '', (args) => buildOptions(args)
|
|
73
|
-
.option('dry-run', { type: 'boolean', default: false }), async (args) => {
|
|
72
|
+
.command('build', '', (args) => buildOptions(args).option('dry-run', { type: 'boolean', default: false }), async (args) => {
|
|
74
73
|
const commits = getCommits(args);
|
|
75
74
|
const changedFiles = getChangedFiles(commits);
|
|
76
75
|
const actorConfigs = await getRepoActors();
|
|
@@ -80,8 +79,7 @@ await yargs()
|
|
|
80
79
|
});
|
|
81
80
|
// https://github.com/apify-store/google-maps#:actors/lukaskrivka_google-maps-with-contact-details
|
|
82
81
|
// git@github.com:apify-store/google-maps#:actors/lukaskrivka_google-maps-with-contact-details
|
|
83
|
-
const repoUrl = spawnCommandInGhWorkspace(`git remote get-url origin`)
|
|
84
|
-
.replace(/^https:\/\/github\.com\//, 'git@github.com:');
|
|
82
|
+
const repoUrl = spawnCommandInGhWorkspace(`git remote get-url origin`).replace(/^https:\/\/github\.com\//, 'git@github.com:');
|
|
85
83
|
const builds = await runBuilds({
|
|
86
84
|
repoUrl,
|
|
87
85
|
actorConfigs: actorsChanged,
|
|
@@ -93,7 +91,7 @@ await yargs()
|
|
|
93
91
|
.command('release', '', (args) => args
|
|
94
92
|
.option('push-event-path', { type: 'string', demandOption: true })
|
|
95
93
|
.option('dry-run', { type: 'boolean', default: false }), async (args) => {
|
|
96
|
-
const { branch, changedFiles, repoUrl, commits, changelog, repository, author
|
|
94
|
+
const { branch, changedFiles, repoUrl, commits, changelog, repository, author } = await getPushData(args.pushEventPath);
|
|
97
95
|
const isLatest = true;
|
|
98
96
|
const actorConfigs = await getRepoActors();
|
|
99
97
|
const { actorsChanged } = getChangedActors({
|
|
@@ -117,7 +115,7 @@ await yargs()
|
|
|
117
115
|
changelog,
|
|
118
116
|
repository,
|
|
119
117
|
dryRun,
|
|
120
|
-
author
|
|
118
|
+
author,
|
|
121
119
|
});
|
|
122
120
|
})
|
|
123
121
|
.strictCommands()
|
package/dist/bin/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../bin/main.ts"],"names":[],"mappings":";AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../bin/main.ts"],"names":[],"mappings":";AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,GAAG,CAAC,MAAM,CAAC,CAAC;AAE7B,MAAM,YAAY,G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MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAC/D,KAAK,EAAE,IAAI,EAAE,EAAE;IACX,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,WAAW,CAC/F,IAAI,CAAC,aAAa,CACrB,CAAC;IACF,MAAM,QAAQ,GAAG,IAAI,CAAC;IACtB,MAAM,YAAY,GAAG,MAAM,aAAa,EAAE,CAAC;IAC3C,MAAM,EAAE,aAAa,EAAE,GAAG,gBAAgB,CAAC;QACvC,gBAAgB,EAAE,YAAY;QAC9B,YAAY;QACZ,QAAQ;KACX,CAAC,CAAC;IACH,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC;QAC3B,QAAQ;QACR,OAAO;QACP,YAAY,EAAE,aAAa;QAC3B,MAAM;QACN,MAAM;KACT,CAAC,CAAC;IACH,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAEtC,4BAA4B;IAC5B,MAAM,aAAa,CAAC;QAChB,YAAY;QACZ,OAAO;QACP,SAAS;QACT,UAAU;QACV,MAAM;QACN,MAAM;KACT,CAAC,CAAC;AACP,CAAC,CACJ;KACA,cAAc,EAAE;KAChB,aAAa,CAAC,CAAC,EAAE,qBAAqB,CAAC;KACvC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC"}
|
package/dist/bin/slack.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Commit } from './types';
|
|
1
|
+
import { Commit } from './types.js';
|
|
2
2
|
type NotifyToSlackOptions = {
|
|
3
3
|
repository: string;
|
|
4
4
|
changedFiles: string[];
|
|
@@ -7,7 +7,7 @@ type NotifyToSlackOptions = {
|
|
|
7
7
|
dryRun: boolean;
|
|
8
8
|
author: string;
|
|
9
9
|
};
|
|
10
|
-
export declare const notifyToSlack: ({ changedFiles, commits, changelog, repository, dryRun, author }: NotifyToSlackOptions) => Promise<void>;
|
|
10
|
+
export declare const notifyToSlack: ({ changedFiles, commits, changelog, repository, dryRun, author, }: NotifyToSlackOptions) => Promise<void>;
|
|
11
11
|
export declare const sendSlackMessage: (channel: string, text: string, blocks: string[], token: string) => Promise<void>;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=slack.d.ts.map
|
package/dist/bin/slack.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../../bin/slack.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../../bin/slack.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC,KAAK,oBAAoB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,mEAOjC,oBAAoB,kBAyCtB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,SAAS,MAAM,EAAE,MAAM,MAAM,EAAE,QAAQ,MAAM,EAAE,EAAE,OAAO,MAAM,kBAUpG,CAAC"}
|
package/dist/bin/slack.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WebClient } from '@slack/web-api';
|
|
2
2
|
import { getEnvVar } from './utils.js';
|
|
3
|
-
export const notifyToSlack = async ({ changedFiles, commits, changelog, repository, dryRun, author }) => {
|
|
3
|
+
export const notifyToSlack = async ({ changedFiles, commits, changelog, repository, dryRun, author, }) => {
|
|
4
4
|
const slack = new WebClient(getEnvVar('SLACK_TOKEN_RELEASES_BOT'));
|
|
5
5
|
if (!changelog) {
|
|
6
6
|
console.warn('No new changelog entries found, did you forget to update it?');
|
|
@@ -20,7 +20,9 @@ export const notifyToSlack = async ({ changedFiles, commits, changelog, reposito
|
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
const commitsMessage = `${commits
|
|
23
|
+
const commitsMessage = `${commits
|
|
24
|
+
.map(({ author, message }, index) => `${index + 1}. Commit message: ${message}\n\tAuthor: ${author}.`)
|
|
25
|
+
.join('\n')}`;
|
|
24
26
|
const changedFilesMessage = `**Files changed**: ${changedFiles.join(', ')}`;
|
|
25
27
|
const longMessage = `${shortMessage}\n**Commit list**:\n${commitsMessage}\n\n${changedFilesMessage}`;
|
|
26
28
|
// This one is for devs and project managers that need to know more details
|
package/dist/bin/slack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slack.js","sourceRoot":"","sources":["../../bin/slack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAWvC,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,EAChC,YAAY,EACZ,OAAO,EACP,SAAS,EACT,UAAU,EACV,MAAM,EACN,MAAM,
|
|
1
|
+
{"version":3,"file":"slack.js","sourceRoot":"","sources":["../../bin/slack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAWvC,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,EAChC,YAAY,EACZ,OAAO,EACP,SAAS,EACT,UAAU,EACV,MAAM,EACN,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,2CAA2C,CAAC,CAAC;IAC3D,OAAO,CAAC,KAAK,CAAC,qCAAqC,YAAY,QAAQ,WAAW,EAAE,CAAC,CAAC;IACtF,OAAO,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC3D,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,MAAM,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC;YACzB,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,YAAY;SACxB,CAAC,CAAC;IACP,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,OAAe,EAAE,IAAY,EAAE,MAAgB,EAAE,KAAa,EAAE,EAAE;IACrG,MAAM,KAAK,GAAG,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/D,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;QAC1B,MAAM,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC;YACzB,OAAO;YACP,SAAS,EAAE,EAAE;YACb,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;SACtF,CAAC,CAAC;IACP,CAAC;AACL,CAAC,CAAC"}
|
package/dist/lib/consts.d.ts
CHANGED
package/dist/lib/consts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../lib/consts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../lib/consts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAElE,eAAO,MAAM,sBAAsB,EAAE,+BAUpC,CAAC"}
|
package/dist/lib/consts.js
CHANGED
|
@@ -6,9 +6,7 @@ export const TO_FINISH_WITH_OPTIONS = {
|
|
|
6
6
|
},
|
|
7
7
|
failedRequests: 0,
|
|
8
8
|
requestsRetries: { max: 3 },
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
'TypeError',
|
|
12
|
-
],
|
|
9
|
+
maxRetriesPerRequest: null,
|
|
10
|
+
forbiddenLogs: ['ReferenceError', 'TypeError'],
|
|
13
11
|
};
|
|
14
12
|
//# sourceMappingURL=consts.js.map
|
package/dist/lib/consts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../lib/consts.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAoC;IACnE,MAAM,EAAE,WAAW;IACnB,QAAQ,EAAE;QACN,GAAG,EAAE,GAAG,EAAE,UAAU;QACpB,GAAG,EAAE,OAAO,EAAE,SAAS;KAC1B;IACD,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE;IAC3B,
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../lib/consts.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAoC;IACnE,MAAM,EAAE,WAAW;IACnB,QAAQ,EAAE;QACN,GAAG,EAAE,GAAG,EAAE,UAAU;QACpB,GAAG,EAAE,OAAO,EAAE,SAAS;KAC1B;IACD,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE;IAC3B,oBAAoB,EAAE,IAAI;IAC1B,aAAa,EAAE,CAAC,gBAAgB,EAAE,WAAW,CAAC;CACjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extend-expect.d.ts","sourceRoot":"","sources":["../../lib/extend-expect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,QAAQ,CAAC;AAMtD,eAAO,MAAM,YAAY,GAAI,QAAQ,YAAY,KAAG,
|
|
1
|
+
{"version":3,"file":"extend-expect.d.ts","sourceRoot":"","sources":["../../lib/extend-expect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,QAAQ,CAAC;AAMtD,eAAO,MAAM,YAAY,GAAI,QAAQ,YAAY,KAAG,YAwQnD,CAAC"}
|