danger 12.3.0 → 12.3.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/CHANGELOG.md +10 -1
- package/distribution/api/fetch.js +6 -2
- package/distribution/api/fetch.js.map +1 -1
- package/distribution/ci_source/ci_source.d.ts +1 -1
- package/distribution/ci_source/ci_source_helpers.js +1 -1
- package/distribution/ci_source/get_ci_source.js +6 -2
- package/distribution/ci_source/get_ci_source.js.map +1 -1
- package/distribution/ci_source/providers/AppCenter.js +6 -2
- package/distribution/ci_source/providers/AppCenter.js.map +1 -1
- package/distribution/ci_source/providers/CodeBuild.js +1 -1
- package/distribution/ci_source/providers/Codeship.js +1 -1
- package/distribution/ci_source/providers/GitHubActions.d.ts +6 -3
- package/distribution/ci_source/providers/GitHubActions.js +7 -4
- package/distribution/ci_source/providers/GitHubActions.js.map +1 -1
- package/distribution/commands/ci/resetStatus.d.ts +1 -1
- package/distribution/commands/ci/resetStatus.js +1 -1
- package/distribution/commands/ci/runner.d.ts +1 -1
- package/distribution/commands/ci/runner.js +1 -1
- package/distribution/commands/danger-init.js +6 -2
- package/distribution/commands/danger-init.js.map +1 -1
- package/distribution/commands/danger-pr.js +1 -1
- package/distribution/commands/danger-process.js +5 -1
- package/distribution/commands/danger-process.js.map +1 -1
- package/distribution/commands/danger-runner.js +1 -1
- package/distribution/commands/init/add-to-ci.js +1 -1
- package/distribution/commands/init/default-dangerfile.js +5 -1
- package/distribution/commands/init/default-dangerfile.js.map +1 -1
- package/distribution/commands/init/state-setup.js +6 -2
- package/distribution/commands/init/state-setup.js.map +1 -1
- package/distribution/commands/utils/chainsmoker.d.ts +7 -7
- package/distribution/commands/utils/fileUtils.js +12 -0
- package/distribution/commands/utils/fileUtils.js.map +1 -1
- package/distribution/commands/utils/getRuntimeCISource.js +1 -1
- package/distribution/commands/utils/reporting.d.ts +1 -1
- package/distribution/commands/utils/runDangerSubprocess.js +1 -1
- package/distribution/commands/utils/validateDangerfileExists.js +5 -1
- package/distribution/commands/utils/validateDangerfileExists.js.map +1 -1
- package/distribution/danger.d.ts +7 -7
- package/distribution/danger.js.flow +7 -7
- package/distribution/dsl/Aliases.d.ts +1 -1
- package/distribution/dsl/BitBucketCloudDSL.d.ts +1 -1
- package/distribution/dsl/BitBucketServerDSL.d.ts +2 -2
- package/distribution/dsl/GitDSL.d.ts +1 -1
- package/distribution/platforms/BitBucketCloud.d.ts +1 -1
- package/distribution/platforms/BitBucketCloud.js +1 -1
- package/distribution/platforms/BitBucketServer.d.ts +1 -1
- package/distribution/platforms/BitBucketServer.js +1 -1
- package/distribution/platforms/FakePlatform.js +1 -1
- package/distribution/platforms/GitHub.d.ts +1 -1
- package/distribution/platforms/GitHub.js +1 -1
- package/distribution/platforms/GitLab.js +1 -1
- package/distribution/platforms/LocalGit.js +1 -1
- package/distribution/platforms/bitbucket_cloud/BitBucketCloudAPI.d.ts +4 -4
- package/distribution/platforms/bitbucket_cloud/BitBucketCloudAPI.js +1 -1
- package/distribution/platforms/bitbucket_cloud/BitBucketCloudGit.js +1 -1
- package/distribution/platforms/bitbucket_cloud/_tests_/_bitbucket_cloud_api.test.js +1 -1
- package/distribution/platforms/bitbucket_cloud/_tests_/_bitbucket_cloud_git.test.js +1 -1
- package/distribution/platforms/bitbucket_server/BitBucketServerAPI.d.ts +3 -3
- package/distribution/platforms/bitbucket_server/BitBucketServerAPI.js +1 -1
- package/distribution/platforms/bitbucket_server/BitBucketServerGit.js +1 -1
- package/distribution/platforms/git/diffToGitJSONDSL.js +2 -2
- package/distribution/platforms/git/diffToGitJSONDSL.js.map +1 -1
- package/distribution/platforms/git/gitJSONToGitDSL.d.ts +2 -2
- package/distribution/platforms/git/gitJSONToGitDSL.js +6 -2
- package/distribution/platforms/git/gitJSONToGitDSL.js.map +1 -1
- package/distribution/platforms/git/localLogGitCommits.d.ts +2 -2
- package/distribution/platforms/github/GitHubAPI.d.ts +7 -6
- package/distribution/platforms/github/GitHubAPI.js +12 -2
- package/distribution/platforms/github/GitHubAPI.js.map +1 -1
- package/distribution/platforms/github/GitHubGit.d.ts +1 -1
- package/distribution/platforms/github/GitHubGit.js +1 -1
- package/distribution/platforms/github/GitHubUtils.d.ts +5 -5
- package/distribution/platforms/github/GitHubUtils.js +1 -1
- package/distribution/platforms/github/comms/checks/githubAppSupport.js +6 -2
- package/distribution/platforms/github/comms/checks/githubAppSupport.js.map +1 -1
- package/distribution/platforms/github/comms/checks/resultsToCheck.d.ts +1 -1
- package/distribution/platforms/github/comms/checks/resultsToCheck.js +1 -1
- package/distribution/platforms/github/comms/checksCommenter.d.ts +1 -1
- package/distribution/platforms/github/comms/checksCommenter.js +1 -1
- package/distribution/platforms/github/comms/issueCommenter.d.ts +1 -1
- package/distribution/platforms/github/comms/issueCommenter.js +1 -1
- package/distribution/platforms/github/customGitHubRequire.d.ts +1 -1
- package/distribution/platforms/github/customGitHubRequire.js +1 -1
- package/distribution/platforms/gitlab/GitLabAPI.d.ts +7 -7
- package/distribution/platforms/gitlab/GitLabAPI.js +1 -1
- package/distribution/platforms/gitlab/GitLabGit.js +1 -1
- package/distribution/platforms/platform.d.ts +2 -2
- package/distribution/platforms/platform.js +5 -1
- package/distribution/platforms/platform.js.map +1 -1
- package/distribution/platforms/pullRequestParser.js +5 -1
- package/distribution/platforms/pullRequestParser.js.map +1 -1
- package/distribution/runner/Dangerfile.d.ts +2 -2
- package/distribution/runner/Executor.js +1 -1
- package/distribution/runner/dslGenerator.js +1 -1
- package/distribution/runner/jsonToContext.js +1 -1
- package/distribution/runner/jsonToDSL.js +6 -2
- package/distribution/runner/jsonToDSL.js.map +1 -1
- package/distribution/runner/runners/inline.js +40 -16
- package/distribution/runner/runners/inline.js.map +1 -1
- package/distribution/runner/runners/utils/cleanDangerfile.d.ts +1 -1
- package/distribution/runner/runners/utils/transpiler.d.ts +1 -1
- package/distribution/runner/runners/utils/transpiler.js +19 -10
- package/distribution/runner/runners/utils/transpiler.js.map +1 -1
- package/distribution/runner/templates/bitbucketCloudTemplate.d.ts +1 -1
- package/distribution/runner/templates/bitbucketServerTemplate.d.ts +1 -1
- package/distribution/runner/templates/githubIssueTemplate.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { components as OctokitOpenApiTypes } from "@octokit/openapi-types";
|
|
2
2
|
import { GitHubPRDSL, GitHubUtilsDSL } from "./../../dsl/GitHubDSL";
|
|
3
|
-
export
|
|
3
|
+
export type GetContentResponseData = OctokitOpenApiTypes["schemas"]["content-file"] | OctokitOpenApiTypes["schemas"]["content-symlink"] | OctokitOpenApiTypes["schemas"]["content-submodule"];
|
|
4
4
|
export declare function isFileContents(response: GetContentResponseData): response is OctokitOpenApiTypes["schemas"]["content-file"];
|
|
5
5
|
import { Octokit as GitHub } from "@octokit/rest";
|
|
6
6
|
declare const utils: (pr: GitHubPRDSL | undefined, api: GitHub) => GitHubUtilsDSL;
|
|
7
7
|
/** Generates the fileContents function, needed so that Peril can re-create this func for an event */
|
|
8
|
-
export declare const fileContentsGenerator: (api: GitHub, defaultRepoSlug: string | undefined, defaultRef: string | undefined) => (path: string, repoSlug?: string
|
|
8
|
+
export declare const fileContentsGenerator: (api: GitHub, defaultRepoSlug: string | undefined, defaultRef: string | undefined) => (path: string, repoSlug?: string, ref?: string) => Promise<string>;
|
|
9
9
|
/** Generates the createUpdatedIssueWithID function, needed so that Peril can re-create this func for an event */
|
|
10
10
|
export declare const createUpdatedIssueWithIDGenerator: (api: GitHub) => (id: string, content: string, settings: {
|
|
11
11
|
title: string;
|
|
@@ -29,7 +29,7 @@ interface PRCreationConfig {
|
|
|
29
29
|
/** Base branch for the new branch e.g. what should Danger create the new branch from */
|
|
30
30
|
baseBranch: string;
|
|
31
31
|
}
|
|
32
|
-
export declare const createOrUpdatePR: (pr: GitHubPRDSL | undefined, api: GitHub) => (config: PRCreationConfig, fileMap: any) => Promise<import("@octokit/
|
|
32
|
+
export declare const createOrUpdatePR: (pr: GitHubPRDSL | undefined, api: GitHub) => (config: PRCreationConfig, fileMap: any) => Promise<import("@octokit/types").OctokitResponse<{
|
|
33
33
|
url: string;
|
|
34
34
|
id: number;
|
|
35
35
|
node_id: string;
|
|
@@ -581,7 +581,7 @@ export declare const createOrUpdatePR: (pr: GitHubPRDSL | undefined, api: GitHub
|
|
|
581
581
|
additions: number;
|
|
582
582
|
deletions: number;
|
|
583
583
|
changed_files: number;
|
|
584
|
-
}, 200> | import("@octokit/
|
|
584
|
+
}, 200> | import("@octokit/types").OctokitResponse<{
|
|
585
585
|
url: string;
|
|
586
586
|
id: number;
|
|
587
587
|
node_id: string;
|
|
@@ -1142,5 +1142,5 @@ export declare const createOrAddLabel: (pr: GitHubPRDSL | undefined, api: GitHub
|
|
|
1142
1142
|
owner: string;
|
|
1143
1143
|
repo: string;
|
|
1144
1144
|
id: number;
|
|
1145
|
-
}
|
|
1145
|
+
}) => Promise<void>;
|
|
1146
1146
|
export default utils;
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -33,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
33
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
34
38
|
function step(op) {
|
|
35
39
|
if (f) throw new TypeError("Generator is already executing.");
|
|
36
|
-
while (_) try {
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
37
41
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
38
42
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
39
43
|
switch (op[0]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"githubAppSupport.js","sourceRoot":"","sources":["../../../../../source/platforms/github/comms/checks/githubAppSupport.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"githubAppSupport.js","sourceRoot":"","sources":["../../../../../source/platforms/github/comms/checks/githubAppSupport.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAmC;AACnC,0DAA8B;AAE9B,SAAS;AAET,+DAA+D;AAC/D,IAAM,gBAAgB,GAAG,UAAC,KAAa,EAAE,GAAW;IAClD,IAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAA;IACnD,IAAM,OAAO,GAAW,GAAG,GAAG,GAAG,CAAA;IACjC,IAAM,UAAU,GAAG,GAAG,CAAA;IACtB,IAAM,OAAO,GAA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C,WAAW,CAAC,CAAE,CAAC,CAAA;iBACjE;gBACD,sBAAO,WAAW,CAAC,KAAe,EAAA;;;KACnC,CAAA;AARY,QAAA,6BAA6B,iCAQzC"}
|
|
@@ -36,4 +36,4 @@ export interface CheckOptions {
|
|
|
36
36
|
images?: CheckImages[];
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
export declare const resultsToCheck: (results: DangerResults, options: ExecutorOptions, pr: GitHubPRDSL, api: GitHubNodeAPI, ciCommitHash?: string
|
|
39
|
+
export declare const resultsToCheck: (results: DangerResults, options: ExecutorOptions, pr: GitHubPRDSL, api: GitHubNodeAPI, ciCommitHash?: string, name?: string) => Promise<CheckOptions>;
|
|
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
29
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
30
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
31
|
switch (op[0]) {
|
|
@@ -16,6 +16,6 @@ export declare const getCustomAppAuthFromEnv: () => {
|
|
|
16
16
|
* @param api
|
|
17
17
|
*/
|
|
18
18
|
export declare const GitHubChecksCommenter: (api: GitHubAPI) => {
|
|
19
|
-
platformResultsPreMapper: (results: DangerResults, options: ExecutorOptions, ciCommitHash?: string
|
|
19
|
+
platformResultsPreMapper: (results: DangerResults, options: ExecutorOptions, ciCommitHash?: string) => Promise<DangerResults>;
|
|
20
20
|
} | undefined;
|
|
21
21
|
export declare const tweetSizedResultsFromResults: (results: DangerResults, checksResponse: any) => DangerResults;
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -19,7 +19,7 @@ export declare const GitHubIssueCommenter: (api: GitHubAPI) => {
|
|
|
19
19
|
* Fails the current build, if status setting succeeds
|
|
20
20
|
* then return true.
|
|
21
21
|
*/
|
|
22
|
-
updateStatus: (passed: boolean | "pending", message: string, url?: string
|
|
22
|
+
updateStatus: (passed: boolean | "pending", message: string, url?: string, dangerID?: string) => Promise<boolean>;
|
|
23
23
|
/**
|
|
24
24
|
* Gets inline comments for current PR
|
|
25
25
|
*/
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -22,7 +22,7 @@ export declare function getGitHubFileContentsFromLocation(token: string, locatio
|
|
|
22
22
|
* Returns either the contents or an empty string.
|
|
23
23
|
*/
|
|
24
24
|
export declare function getGitHubFileContents(token: string, repoSlug: string, path: string, ref: string | null, showError?: boolean): Promise<string>;
|
|
25
|
-
export declare const shouldUseGitHubOverride: (request: string, parent?: NodeModule
|
|
25
|
+
export declare const shouldUseGitHubOverride: (request: string, parent?: NodeModule) => boolean;
|
|
26
26
|
export declare const customGitHubResolveRequest: (token: string) => (request: string, parent: {
|
|
27
27
|
filename: string;
|
|
28
28
|
}) => Promise<any>;
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type * as Types from "@gitbeaker/rest";
|
|
2
2
|
import { Env } from "../../ci_source/ci_source";
|
|
3
3
|
import { RepoMetaData } from "../../dsl/RepoMetaData";
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type GitLabAPIToken = string;
|
|
5
|
+
export type GitLabOAuthToken = string;
|
|
6
6
|
export interface RootGitLabAPICredentials {
|
|
7
7
|
host: string;
|
|
8
8
|
}
|
|
@@ -12,7 +12,7 @@ export interface GitLabAPICredentialsOptionsWithAccessToken extends RootGitLabAP
|
|
|
12
12
|
export interface GitLabAPICredentialsOptionsWithOAuthToken extends RootGitLabAPICredentials {
|
|
13
13
|
oauthToken: GitLabOAuthToken;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type GitLabAPICredentials = GitLabAPICredentialsOptionsWithAccessToken | GitLabAPICredentialsOptionsWithOAuthToken;
|
|
16
16
|
export declare function getGitLabHostFromEnv(env: Env): string;
|
|
17
17
|
export declare function getGitLabAPICredentialsFromEnv(env: Env): GitLabAPICredentials;
|
|
18
18
|
declare class GitLabAPI {
|
|
@@ -36,15 +36,15 @@ declare class GitLabAPI {
|
|
|
36
36
|
getMergeRequestDiscussions: () => Promise<Types.DiscussionSchema[]>;
|
|
37
37
|
getMergeRequestNotes: () => Promise<Types.MergeRequestNoteSchema[]>;
|
|
38
38
|
createMergeRequestDiscussion: (content: string, options?: {
|
|
39
|
-
position?: Types.DiscussionNotePositionOptions
|
|
40
|
-
}
|
|
39
|
+
position?: Types.DiscussionNotePositionOptions;
|
|
40
|
+
}) => Promise<Types.DiscussionSchema>;
|
|
41
41
|
createMergeRequestNote: (body: string) => Promise<Types.MergeRequestNoteSchema>;
|
|
42
42
|
updateMergeRequestDiscussionNote: (discussionId: string, noteId: number, body: string) => Promise<Types.MergeRequestDiscussionNoteSchema>;
|
|
43
43
|
updateMergeRequestNote: (id: number, body: string) => Promise<Types.MergeRequestNoteSchema>;
|
|
44
44
|
deleteMergeRequestDiscussionNote: (discussionId: string, noteId: number) => Promise<boolean>;
|
|
45
45
|
deleteMergeRequestNote: (id: number) => Promise<boolean>;
|
|
46
|
-
getFileContents: (path: string, slug?: string
|
|
47
|
-
getCompareChanges: (base?: string
|
|
46
|
+
getFileContents: (path: string, slug?: string, ref?: string) => Promise<string>;
|
|
47
|
+
getCompareChanges: (base?: string, head?: string) => Promise<Types.CommitDiffSchema[]>;
|
|
48
48
|
addLabels: (...labels: string[]) => Promise<boolean>;
|
|
49
49
|
removeLabels: (...labels: string[]) => Promise<boolean>;
|
|
50
50
|
}
|
|
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
29
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
30
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
31
|
switch (op[0]) {
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -4,9 +4,9 @@ import { DangerResults } from "../dsl/DangerResults";
|
|
|
4
4
|
import { ExecutorOptions } from "../runner/Executor";
|
|
5
5
|
import { DangerRunner } from "../runner/runners/runner";
|
|
6
6
|
/** A type that represents the downloaded metadata about a code review session */
|
|
7
|
-
export
|
|
7
|
+
export type Metadata = any;
|
|
8
8
|
/** A type that represents a comment */
|
|
9
|
-
export
|
|
9
|
+
export type Comment = {
|
|
10
10
|
/**
|
|
11
11
|
* UUID for the comment
|
|
12
12
|
*
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../../source/platforms/platform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../../source/platforms/platform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,mCAAiC;AACjC,gDAA8C;AAC9C,qDAAmD;AACnD,4EAAiH;AACjH,mDAAiD;AACjD,yEAAyG;AACzG,8DAA8E;AAC9E,oDAA6B;AAI7B,gDAAyB;AACzB,+CAA6C;AAqF7C;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,GAAQ,EAAE,MAAgB;IAC1D,mBAAmB;IACnB,IAAI,GAAG,CAAC,6BAA6B,CAAC,IAAI,GAAG,CAAC,oBAAoB,CAAC,KAAK,iCAAe,CAAC,IAAI,EAAE;QAC5F,IAAM,GAAG,GAAG,IAAI,uCAAkB,CAChC;YACE,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,QAAQ,EAAE,MAAM,CAAC,QAAQ;SAC1B,EACD,IAAA,0DAAqC,EAAC,GAAG,CAAC,CAC3C,CAAA;QACD,OAAO,IAAI,iCAAe,CAAC,GAAG,CAAC,CAAA;KAChC;IAED,kBAAkB;IAClB,IACE,GAAG,CAAC,iCAAiC,CAAC;QACtC,GAAG,CAAC,gCAAgC,CAAC;QACrC,GAAG,CAAC,wCAAwC,CAAC;QAC7C,GAAG,CAAC,oBAAoB,CAAC,KAAK,+BAAc,CAAC,IAAI,EACjD;QACA,IAAM,GAAG,GAAG,IAAI,qCAAiB,CAC/B;YACE,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,QAAQ,EAAE,MAAM,CAAC,QAAQ;SAC1B,EACD,IAAA,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CACpH,CAAA;IACD,OAAO,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAA;IAC/E,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;AAC3D,CAAC;AAhFD,8CAgFC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pullRequestParser.js","sourceRoot":"","sources":["../../source/platforms/pullRequestParser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pullRequestParser.js","sourceRoot":"","sources":["../../source/platforms/pullRequestParser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA0B;AAC1B,oEAAsC;AACtC,qDAAmD;AACnD,mCAAiC;AACjC,oDAA6B;AAC7B,mDAAiD;AAQjD,SAAgB,iBAAiB,CAAC,OAAe;IAC/C,IAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAE5C,IAAI,UAAU,IAAI,UAAU,CAAC,IAAI,EAAE;QACjC,iFAAiF;QACjF,IAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAA;QAC/F,IAAI,KAAK,EAAE;YACT,OAAO;gBACL,QAAQ,EAAE,iCAAe,CAAC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AC,MAAM,EAAE,EAAE,CAAC;oBAClC,iBAAiB,EAAE,OAAK,CAAC,CAAC,CAAC;iBAC5B,CAAA;aACF;SACF;KACF;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AA/CD,8CA+CC"}
|
|
@@ -2,13 +2,13 @@ import { DangerRuntimeContainer } from "../dsl/DangerResults";
|
|
|
2
2
|
import { DangerDSLType, PerilDSL } from "../dsl/DangerDSL";
|
|
3
3
|
import { MarkdownString } from "../dsl/Aliases";
|
|
4
4
|
/** A function with a callback function, which Danger wraps in a Promise */
|
|
5
|
-
export
|
|
5
|
+
export type CallbackableFn = (callback: (done: any) => void) => void;
|
|
6
6
|
/**
|
|
7
7
|
* Types of things which Danger will schedule for you, it's recommended that you
|
|
8
8
|
* just throw in an `async () => { [...] }` function. Can also handle a function
|
|
9
9
|
* that has a single 'done' arg.
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export type Scheduleable = Promise<any> | Promise<void> | CallbackableFn;
|
|
12
12
|
export interface DangerContext {
|
|
13
13
|
/**
|
|
14
14
|
* A Dangerfile, in Peril, is evaluated as a script, and so async code does not work
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -33,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
33
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
34
38
|
function step(op) {
|
|
35
39
|
if (f) throw new TypeError("Generator is already executing.");
|
|
36
|
-
while (_) try {
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
37
41
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
38
42
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
39
43
|
switch (op[0]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonToDSL.js","sourceRoot":"","sources":["../../source/runner/jsonToDSL.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jsonToDSL.js","sourceRoot":"","sources":["../../source/runner/jsonToDSL.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAuC;AAGvC,2DAAkF;AAClF,8CAA2D;AAC3D,6CAA8C;AAC9C,kDAAgD;AAEhD,uFAAwF;AACxF,uFAGyD;AACzD,oFAAoH;AAGpH,kCAAgC;AAChC,8CAA2D;AAC3D,yEAAyF;AACzF,2DAA4D;AAC5D,oFAAqF;AACrF,gEAAsF;AACtF,8DAAmF;AACnF,IAAM,CAAC,GAAG,IAAA,aAAK,EAAC,WAAW,CAAC,CAAA;AAE5B;;GAEG;AACI,IAAM,SAAS,GAAG,UAAO,GAAsB,EAAE,MAAgB;;;;;gBACtE,+DAA+D;gBAC/D,CAAC,CAAC,mBAAY,MAAM,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,mBAAgB,CAAC,CAAA;gBAEtE,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,CAAA;gBACpB,cAAc,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG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
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -33,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
33
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
34
38
|
function step(op) {
|
|
35
39
|
if (f) throw new TypeError("Generator is already executing.");
|
|
36
|
-
while (_) try {
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
37
41
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
38
42
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
39
43
|
switch (op[0]) {
|
|
@@ -60,6 +64,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
60
64
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
61
65
|
exports.runDangerfileEnvironment = exports.createDangerfileRuntimeEnvironment = void 0;
|
|
62
66
|
var fs = __importStar(require("fs"));
|
|
67
|
+
var path = __importStar(require("path"));
|
|
63
68
|
var debug_1 = require("../../debug");
|
|
64
69
|
var require_from_string_1 = __importDefault(require("require-from-string"));
|
|
65
70
|
var transpiler_1 = __importDefault(require("./utils/transpiler"));
|
|
@@ -116,7 +121,7 @@ var runAllScheduledTasks = function (results) { return __awaiter(void 0, void 0,
|
|
|
116
121
|
* @returns {DangerResults} the results of the run
|
|
117
122
|
*/
|
|
118
123
|
var runDangerfileEnvironment = function (filenames, originalContents, environment, injectedObjectToExport, moduleHandler) { return __awaiter(void 0, void 0, void 0, function () {
|
|
119
|
-
var customModuleHandler, customRequire, index, _a, filename, remote, fn, originalContent, content, compiled, key, element, optionalExport, error_1, errorResults, results;
|
|
124
|
+
var customModuleHandler, customRequire, index, _a, filename, remote, fn, originalContent, content, compiled, key, element, optionalExport, tmpFileName, error_1, errorResults, results;
|
|
120
125
|
return __generator(this, function (_b) {
|
|
121
126
|
switch (_b.label) {
|
|
122
127
|
case 0:
|
|
@@ -129,7 +134,7 @@ var runDangerfileEnvironment = function (filenames, originalContents, environmen
|
|
|
129
134
|
module._compile(compiled, filename);
|
|
130
135
|
};
|
|
131
136
|
customRequire = moduleHandler || customModuleHandler;
|
|
132
|
-
// Tell all these filetypes to
|
|
137
|
+
// Tell all these filetypes to get the custom compilation
|
|
133
138
|
require.extensions[".ts"] = customRequire;
|
|
134
139
|
require.extensions[".tsx"] = customRequire;
|
|
135
140
|
require.extensions[".js"] = customRequire;
|
|
@@ -137,7 +142,7 @@ var runDangerfileEnvironment = function (filenames, originalContents, environmen
|
|
|
137
142
|
index = 0;
|
|
138
143
|
_b.label = 1;
|
|
139
144
|
case 1:
|
|
140
|
-
if (!(index < filenames.length)) return [3 /*break*/,
|
|
145
|
+
if (!(index < filenames.length)) return [3 /*break*/, 13];
|
|
141
146
|
_a = filenames[index], filename = _a[0], remote = _a[1];
|
|
142
147
|
fn = filename;
|
|
143
148
|
if (remote) {
|
|
@@ -149,7 +154,7 @@ var runDangerfileEnvironment = function (filenames, originalContents, environmen
|
|
|
149
154
|
compiled = (0, transpiler_1.default)(content, filename, remote);
|
|
150
155
|
_b.label = 2;
|
|
151
156
|
case 2:
|
|
152
|
-
_b.trys.push([2,
|
|
157
|
+
_b.trys.push([2, 11, , 12]);
|
|
153
158
|
// Move all the DSL attributes into the global scope
|
|
154
159
|
for (key in environment) {
|
|
155
160
|
if (environment.hasOwnProperty(key)) {
|
|
@@ -158,37 +163,56 @@ var runDangerfileEnvironment = function (filenames, originalContents, environmen
|
|
|
158
163
|
}
|
|
159
164
|
}
|
|
160
165
|
d("Started parsing Dangerfile: ", filename);
|
|
166
|
+
optionalExport = void 0;
|
|
167
|
+
if (!filename.endsWith(".mts")) return [3 /*break*/, 4];
|
|
168
|
+
tmpFileName = path.join(process.cwd(), "._dangerfile.mjs");
|
|
169
|
+
fs.writeFileSync(tmpFileName, compiled);
|
|
170
|
+
return [4 /*yield*/, import(tmpFileName)];
|
|
171
|
+
case 3:
|
|
172
|
+
// tried but data urls have trouble with imports and I don't know how to fix
|
|
173
|
+
// optionalExport = (await import(`data:text/javascript;base64,${btoa(compiled)}`));
|
|
174
|
+
optionalExport = _b.sent();
|
|
175
|
+
return [3 /*break*/, 7];
|
|
176
|
+
case 4:
|
|
177
|
+
if (!filename.endsWith(".mjs")) return [3 /*break*/, 6];
|
|
178
|
+
return [4 /*yield*/, import(path.join(process.cwd(), filename))];
|
|
179
|
+
case 5:
|
|
180
|
+
optionalExport = _b.sent();
|
|
181
|
+
return [3 /*break*/, 7];
|
|
182
|
+
case 6:
|
|
161
183
|
optionalExport = (0, require_from_string_1.default)(compiled, filename, {});
|
|
162
|
-
|
|
184
|
+
_b.label = 7;
|
|
185
|
+
case 7:
|
|
186
|
+
if (!(typeof optionalExport.default === "function")) return [3 /*break*/, 9];
|
|
163
187
|
d("Running default export from Dangerfile", filename);
|
|
164
188
|
return [4 /*yield*/, optionalExport.default(injectedObjectToExport)];
|
|
165
|
-
case
|
|
189
|
+
case 8:
|
|
166
190
|
_b.sent();
|
|
167
|
-
_b.label =
|
|
168
|
-
case
|
|
191
|
+
_b.label = 9;
|
|
192
|
+
case 9:
|
|
169
193
|
d("Finished running dangerfile: ", filename);
|
|
170
194
|
// Don't stop all current async code from breaking,
|
|
171
195
|
// however new code (without Peril support) can run
|
|
172
196
|
// without the scheduler
|
|
173
197
|
return [4 /*yield*/, runAllScheduledTasks(environment.results)];
|
|
174
|
-
case
|
|
198
|
+
case 10:
|
|
175
199
|
// Don't stop all current async code from breaking,
|
|
176
200
|
// however new code (without Peril support) can run
|
|
177
201
|
// without the scheduler
|
|
178
202
|
_b.sent();
|
|
179
|
-
return [3 /*break*/,
|
|
180
|
-
case
|
|
203
|
+
return [3 /*break*/, 12];
|
|
204
|
+
case 11:
|
|
181
205
|
error_1 = _b.sent();
|
|
182
206
|
console.log("Unable to evaluate the Dangerfile\n", error_1);
|
|
183
207
|
d("Got a parse error: ", error_1);
|
|
184
208
|
errorResults = (0, resultsForCaughtError_1.default)(filename, content, error_1);
|
|
185
209
|
environment.markdown(errorResults.markdowns[0].message);
|
|
186
210
|
environment.fail(errorResults.fails[0].message);
|
|
187
|
-
return [3 /*break*/,
|
|
188
|
-
case
|
|
211
|
+
return [3 /*break*/, 12];
|
|
212
|
+
case 12:
|
|
189
213
|
index++;
|
|
190
214
|
return [3 /*break*/, 1];
|
|
191
|
-
case
|
|
215
|
+
case 13:
|
|
192
216
|
results = environment.results;
|
|
193
217
|
return [2 /*return*/, {
|
|
194
218
|
fails: results.fails,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline.js","sourceRoot":"","sources":["../../../source/runner/runners/inline.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inline.js","sourceRoot":"","sources":["../../../source/runner/runners/inline.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAwB;AACxB,yCAA4B;AAC5B,qCAAmC;AACnC,4EAA0C;AAO1C,kEAAwC;AACxC,4EAAqD;AACrD,wFAAiE;AAEjE,IAAM,CAAC,GAAG,IAAA,aAAK,EAAC,eAAe,CAAC,CAAA;AAEhC;;;;;GAKG;AACH,SAAsB,kCAAkC,CAAC,iBAAgC;;;YACvF,sBAAO,iBAAiB,EAAA;;;CACzB;AAFD,gFAEC;AAED,IAAM,oBAAoB,GAAG,UAAO,OAA+B;;;;qBAC7D,OAAO,CAAC,SAAS,EAAjB,wBAAiB;gBACnB,CAAC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vD,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;;;gBAlDL,KAAK,EAAE,CAAA;;;gBAsD/C,OAAO,GAAG,WAAW,CAAC,OAAO,CAAA;gBACnC,sBAAO;wBACL,KAAK,EAAE,OAAO,CAAC,KAAK;wBACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;qBAC7B,EAAA;;;KACF,CAAA;AA3FY,QAAA,wBAAwB,4BA2FpC;AAED,IAAM,aAAa,GAAiB;IAClC,kCAAkC,oCAAA;IAClC,wBAAwB,kCAAA;CACzB,CAAA;AAED,kBAAe,aAAa,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
declare const _default: (contents: string) => string;
|
|
2
1
|
/**
|
|
3
2
|
* Updates a Dangerfile to remove the import for Danger
|
|
4
3
|
* @param {string} contents the file path for the dangerfile
|
|
5
4
|
* @returns {string} the revised Dangerfile
|
|
6
5
|
*/
|
|
6
|
+
declare const _default: (contents: string) => string;
|
|
7
7
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const checkForNodeModules: () => void;
|
|
2
2
|
export declare const dirContains: (rootDir: string, dir: string) => boolean;
|
|
3
3
|
export declare const lookupTSConfig: (dir: string) => string | null;
|
|
4
|
-
export declare const typescriptify: (content: string, dir: string) => string;
|
|
4
|
+
export declare const typescriptify: (content: string, dir: string, esm?: boolean) => string;
|
|
5
5
|
export declare const babelify: (content: string, filename: string, extraPlugins: string[]) => string;
|
|
6
6
|
declare const _default: (code: string, filename: string, remoteFile?: boolean) => string;
|
|
7
7
|
export default _default;
|