skuba 4.2.0-beta.6 → 4.2.0
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/lib/api/buildkite/annotate.js +8 -19
- package/lib/api/buildkite/annotate.js.map +1 -1
- package/lib/api/git/commit.js +6 -17
- package/lib/api/git/commit.js.map +1 -1
- package/lib/api/git/commitAllChanges.js +4 -13
- package/lib/api/git/commitAllChanges.js.map +1 -1
- package/lib/api/git/currentBranch.js +5 -14
- package/lib/api/git/currentBranch.js.map +1 -1
- package/lib/api/git/getChangedFiles.js +3 -12
- package/lib/api/git/getChangedFiles.js.map +1 -1
- package/lib/api/git/log.js +7 -17
- package/lib/api/git/log.js.map +1 -1
- package/lib/api/git/push.js +7 -19
- package/lib/api/git/push.js.map +1 -1
- package/lib/api/git/remote.js +5 -14
- package/lib/api/git/remote.js.map +1 -1
- package/lib/api/git/reset.js +6 -15
- package/lib/api/git/reset.js.map +1 -1
- package/lib/api/github/checkRun.js +4 -13
- package/lib/api/github/checkRun.js.map +1 -1
- package/lib/api/github/environment.js +2 -3
- package/lib/api/github/environment.js.map +1 -1
- package/lib/api/github/issueComment.js +15 -28
- package/lib/api/github/issueComment.js.map +1 -1
- package/lib/api/github/pullRequest.js +8 -17
- package/lib/api/github/pullRequest.js.map +1 -1
- package/lib/api/net/compose.js +3 -12
- package/lib/api/net/compose.js.map +1 -1
- package/lib/api/net/socket.js +30 -43
- package/lib/api/net/socket.js.map +1 -1
- package/lib/api/net/waitFor.js +4 -13
- package/lib/api/net/waitFor.js.map +1 -1
- package/lib/cli/adapter/eslint.js +5 -14
- package/lib/cli/adapter/eslint.js.map +1 -1
- package/lib/cli/adapter/prettier.js +12 -24
- package/lib/cli/adapter/prettier.js.map +1 -1
- package/lib/cli/build/tsc.js +2 -11
- package/lib/cli/build/tsc.js.map +1 -1
- package/lib/cli/configure/analyseConfiguration.js +7 -16
- package/lib/cli/configure/analyseConfiguration.js.map +1 -1
- package/lib/cli/configure/analyseDependencies.js +22 -28
- package/lib/cli/configure/analyseDependencies.js.map +1 -1
- package/lib/cli/configure/analysis/files.js +3 -12
- package/lib/cli/configure/analysis/files.js.map +1 -1
- package/lib/cli/configure/analysis/git.js +4 -13
- package/lib/cli/configure/analysis/git.js.map +1 -1
- package/lib/cli/configure/analysis/package.js +7 -13
- package/lib/cli/configure/analysis/package.js.map +1 -1
- package/lib/cli/configure/analysis/project.js +13 -23
- package/lib/cli/configure/analysis/project.js.map +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.js +6 -15
- package/lib/cli/configure/ensureTemplateCompletion.js.map +1 -1
- package/lib/cli/configure/getEntryPoint.js +3 -12
- package/lib/cli/configure/getEntryPoint.js.map +1 -1
- package/lib/cli/configure/getProjectType.js +3 -13
- package/lib/cli/configure/getProjectType.js.map +1 -1
- package/lib/cli/configure/index.js +21 -30
- package/lib/cli/configure/index.js.map +1 -1
- package/lib/cli/configure/modules/eslint.js +10 -29
- package/lib/cli/configure/modules/eslint.js.map +1 -1
- package/lib/cli/configure/modules/ignore.js +3 -12
- package/lib/cli/configure/modules/ignore.js.map +1 -1
- package/lib/cli/configure/modules/jest.js +14 -33
- package/lib/cli/configure/modules/jest.js.map +1 -1
- package/lib/cli/configure/modules/package.js +21 -21
- package/lib/cli/configure/modules/package.js.map +1 -1
- package/lib/cli/configure/modules/prettier.js +9 -28
- package/lib/cli/configure/modules/prettier.js.map +1 -1
- package/lib/cli/configure/modules/renovate.js +13 -30
- package/lib/cli/configure/modules/renovate.js.map +1 -1
- package/lib/cli/configure/modules/skubaDive.js +7 -5
- package/lib/cli/configure/modules/skubaDive.js.map +1 -1
- package/lib/cli/configure/modules/tsconfig.js +12 -18
- package/lib/cli/configure/modules/tsconfig.js.map +1 -1
- package/lib/cli/configure/processing/json.js +1 -1
- package/lib/cli/configure/processing/json.js.map +1 -1
- package/lib/cli/configure/processing/package.js +5 -5
- package/lib/cli/configure/processing/package.js.map +1 -1
- package/lib/cli/configure/processing/prettier.js +4 -1
- package/lib/cli/configure/processing/prettier.js.map +1 -1
- package/lib/cli/configure/processing/typescript.js +4 -7
- package/lib/cli/configure/processing/typescript.js.map +1 -1
- package/lib/cli/configure/refreshIgnoreFiles.js +11 -20
- package/lib/cli/configure/refreshIgnoreFiles.js.map +1 -1
- package/lib/cli/format.js +5 -14
- package/lib/cli/format.js.map +1 -1
- package/lib/cli/help.js +3 -12
- package/lib/cli/help.js.map +1 -1
- package/lib/cli/init/getConfig.js +63 -56
- package/lib/cli/init/getConfig.js.map +1 -1
- package/lib/cli/init/git.js +9 -18
- package/lib/cli/init/git.js.map +1 -1
- package/lib/cli/init/index.js +14 -23
- package/lib/cli/init/index.js.map +1 -1
- package/lib/cli/init/prompts.js +3 -12
- package/lib/cli/init/prompts.js.map +1 -1
- package/lib/cli/init/types.js +7 -2
- package/lib/cli/init/types.js.map +1 -1
- package/lib/cli/init/writePackageJson.js +5 -14
- package/lib/cli/init/writePackageJson.js.map +1 -1
- package/lib/cli/lint/annotate/buildkite/index.js +3 -12
- package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
- package/lib/cli/lint/annotate/github/eslint.js +10 -2
- package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
- package/lib/cli/lint/annotate/github/index.js +3 -12
- package/lib/cli/lint/annotate/github/index.js.map +1 -1
- package/lib/cli/lint/annotate/github/tsc.js +1 -1
- package/lib/cli/lint/annotate/github/tsc.js.map +1 -1
- package/lib/cli/lint/annotate/index.js +3 -12
- package/lib/cli/lint/annotate/index.js.map +1 -1
- package/lib/cli/lint/autofix.js +13 -22
- package/lib/cli/lint/autofix.js.map +1 -1
- package/lib/cli/lint/external.js +20 -43
- package/lib/cli/lint/external.js.map +1 -1
- package/lib/cli/lint/index.js +5 -14
- package/lib/cli/lint/index.js.map +1 -1
- package/lib/cli/lint/internal.js +7 -16
- package/lib/cli/lint/internal.js.map +1 -1
- package/lib/cli/lint/tsc.js +4 -13
- package/lib/cli/lint/tsc.js.map +1 -1
- package/lib/cli/node.js +3 -12
- package/lib/cli/node.js.map +1 -1
- package/lib/cli/release.js +3 -12
- package/lib/cli/release.js.map +1 -1
- package/lib/cli/start.js +4 -14
- package/lib/cli/start.js.map +1 -1
- package/lib/cli/test/index.js +1 -2
- package/lib/cli/test/index.js.map +1 -1
- package/lib/cli/test/reporters/github/annotations.js +7 -7
- package/lib/cli/test/reporters/github/annotations.js.map +1 -1
- package/lib/cli/test/reporters/github/index.js +27 -38
- package/lib/cli/test/reporters/github/index.js.map +1 -1
- package/lib/cli/version.js +3 -12
- package/lib/cli/version.js.map +1 -1
- package/lib/skuba.js +3 -12
- package/lib/skuba.js.map +1 -1
- package/lib/utils/args.d.ts +1 -1
- package/lib/utils/args.js +7 -11
- package/lib/utils/args.js.map +1 -1
- package/lib/utils/command.d.ts +1 -1
- package/lib/utils/command.js +0 -1
- package/lib/utils/command.js.map +1 -1
- package/lib/utils/copy.js +11 -20
- package/lib/utils/copy.js.map +1 -1
- package/lib/utils/dir.js +9 -18
- package/lib/utils/dir.js.map +1 -1
- package/lib/utils/exec.js +25 -29
- package/lib/utils/exec.js.map +1 -1
- package/lib/utils/logo.js +4 -14
- package/lib/utils/logo.js.map +1 -1
- package/lib/utils/manifest.js +6 -15
- package/lib/utils/manifest.js.map +1 -1
- package/lib/utils/version.js +10 -19
- package/lib/utils/version.js.map +1 -1
- package/lib/utils/worker.js +2 -11
- package/lib/utils/worker.js.map +1 -1
- package/lib/wrapper/functionHandler.js +2 -11
- package/lib/wrapper/functionHandler.js.map +1 -1
- package/lib/wrapper/http.js +6 -15
- package/lib/wrapper/http.js.map +1 -1
- package/lib/wrapper/main.js +2 -11
- package/lib/wrapper/main.js.map +1 -1
- package/lib/wrapper/requestListener.js +3 -13
- package/lib/wrapper/requestListener.js.map +1 -1
- package/package.json +3 -12
- package/template/base/tsconfig.json +2 -1
- package/template/express-rest-api/.buildkite/pipeline.yml +3 -3
- package/template/express-rest-api/Dockerfile +3 -3
- package/template/koa-rest-api/.buildkite/pipeline.yml +3 -3
- package/template/koa-rest-api/Dockerfile +3 -3
- package/template/oss-npm-package/tsconfig.json +2 -1
- package/template/private-npm-package/tsconfig.json +2 -1
- package/lib/cli/changesets/coreAdapter.d.ts +0 -9
- package/lib/cli/changesets/coreAdapter.js +0 -19
- package/lib/cli/changesets/coreAdapter.js.map +0 -1
- package/lib/cli/changesets/gitUtils.d.ts +0 -17
- package/lib/cli/changesets/gitUtils.js +0 -128
- package/lib/cli/changesets/gitUtils.js.map +0 -1
- package/lib/cli/changesets/githubAdapter.d.ts +0 -3
- package/lib/cli/changesets/githubAdapter.js +0 -8
- package/lib/cli/changesets/githubAdapter.js.map +0 -1
- package/lib/cli/changesets/index.d.ts +0 -1
- package/lib/cli/changesets/index.js +0 -94
- package/lib/cli/changesets/index.js.map +0 -1
- package/lib/cli/changesets/readChangesetState.d.ts +0 -6
- package/lib/cli/changesets/readChangesetState.js +0 -34
- package/lib/cli/changesets/readChangesetState.js.map +0 -1
- package/lib/cli/changesets/run.d.ts +0 -22
- package/lib/cli/changesets/run.js +0 -196
- package/lib/cli/changesets/run.js.map +0 -1
- package/lib/cli/changesets/utils.d.ts +0 -30
- package/lib/cli/changesets/utils.js +0 -130
- package/lib/cli/changesets/utils.js.map +0 -1
package/lib/utils/worker.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.postWorkerOutput = exports.execWorkerThread = void 0;
|
|
13
4
|
const worker_threads_1 = require("worker_threads");
|
|
@@ -15,7 +6,7 @@ const logging_1 = require("./logging");
|
|
|
15
6
|
/**
|
|
16
7
|
* Executes a script at `filepath` in a Node.js worker thread.
|
|
17
8
|
*/
|
|
18
|
-
const execWorkerThread = (filepath, input) =>
|
|
9
|
+
const execWorkerThread = async (filepath, input) => {
|
|
19
10
|
let output;
|
|
20
11
|
let messageReceived = false;
|
|
21
12
|
return new Promise((resolve, reject) => new worker_threads_1.Worker(filepath, {
|
|
@@ -33,7 +24,7 @@ const execWorkerThread = (filepath, input) => __awaiter(void 0, void 0, void 0,
|
|
|
33
24
|
messageReceived = true;
|
|
34
25
|
})
|
|
35
26
|
.on('messageerror', (err) => reject(err)));
|
|
36
|
-
}
|
|
27
|
+
};
|
|
37
28
|
exports.execWorkerThread = execWorkerThread;
|
|
38
29
|
/**
|
|
39
30
|
* Runs a function in a Node.js worker thread context, forwarding the result
|
package/lib/utils/worker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../src/utils/worker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../src/utils/worker.ts"],"names":[],"mappings":";;;AAAA,mDAAgE;AAEhE,uCAAgC;AAEhC;;GAEG;AACI,MAAM,gBAAgB,GAAG,KAAK,EACnC,QAAgB,EAChB,KAAY,EACZ,EAAE;IACF,IAAI,MAAc,CAAC;IACnB,IAAI,eAAe,GAAG,KAAK,CAAC;IAE5B,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAC7C,IAAI,uBAAM,CAAC,QAAQ,EAAE;QACnB,UAAU,EAAE,KAAK;KAClB,CAAC;SACC,EAAE,CAAC,OAAO,EAAE,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isArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -20,7 +11,7 @@ const http_1 = require("./http");
|
|
|
20
11
|
/**
|
|
21
12
|
* Create an HTTP server that calls into an exported function.
|
|
22
13
|
*/
|
|
23
|
-
const runFunctionHandler = ({ availablePort, entryPoint, functionName, }) =>
|
|
14
|
+
const runFunctionHandler = async ({ availablePort, entryPoint, functionName, }) => {
|
|
24
15
|
if (!(0, validation_1.isObject)(entryPoint)) {
|
|
25
16
|
logging_1.log.subtle(logging_1.log.bold(functionName), 'is not exported');
|
|
26
17
|
return;
|
|
@@ -36,6 +27,6 @@ const runFunctionHandler = ({ availablePort, entryPoint, functionName, }) => __a
|
|
|
36
27
|
.join(', ')})`);
|
|
37
28
|
const requestListener = (0, http_1.createRequestListenerFromFunction)(fn);
|
|
38
29
|
return (0, http_1.serveRequestListener)(requestListener, availablePort);
|
|
39
|
-
}
|
|
30
|
+
};
|
|
40
31
|
exports.runFunctionHandler = runFunctionHandler;
|
|
41
32
|
//# sourceMappingURL=functionHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functionHandler.js","sourceRoot":"","sources":["../../src/wrapper/functionHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"functionHandler.js","sourceRoot":"","sources":["../../src/wrapper/functionHandler.ts"],"names":[],"mappings":";;;;;;AAAA,4EAAwC;AAExC,8CAAuC;AACvC,oDAA2D;AAE3D,iCAGgB;AAQhB;;GAEG;AACI,MAAM,kBAAkB,GAAG,KAAK,EAAE,EACvC,aAAa,EACb,UAAU,EACV,YAAY,GACP,EAAiB,EAAE;IACxB,IAAI,CAAC,IAAA,qBAAQ,EAAC,UAAU,CAAC,EAAE;QACzB,aAAG,CAAC,MAAM,CAAC,aAAG,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC,CAAC;QACtD,OAAO;KACR;IAED,MAAM,EAAE,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IAEpC,IAAI,CAAC,IAAA,uBAAU,EAAC,EAAE,CAAC,EAAE;QACnB,aAAG,CAAC,MAAM,CAAC,aAAG,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAC,CAAC;QACxD,OAAO;KACR;IAED,aAAG,CAAC,IAAI,CACN,aAAG,CAAC,IAAI,CAAC,YAAY,CAAC,EACtB,IAAI,IAAA,4BAAM,EAAC,EAAE,CAAC;QACZ,+CAA+C;SAC9C,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC;SACxB,IAAI,CAAC,IAAI,CAAC,GAAG,CACjB,CAAC;IAEF,MAAM,eAAe,GAAG,IAAA,wCAAiC,EAAC,EAAE,CAAC,CAAC;IAE9D,OAAO,IAAA,2BAAoB,EAAC,eAAe,EAAE,aAAa,CAAC,CAAC;AAC9D,CAAC,CAAC;AA5BW,QAAA,kBAAkB,sBA4B7B"}
|
package/lib/wrapper/http.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -22,7 +13,7 @@ const logging_1 = require("../utils/logging");
|
|
|
22
13
|
* - The request body is JSON parsed and passed into the function as parameters.
|
|
23
14
|
* - The function's return value is JSON stringified into the response body.
|
|
24
15
|
*/
|
|
25
|
-
const createRequestListenerFromFunction = (fn) => (req, res) =>
|
|
16
|
+
const createRequestListenerFromFunction = (fn) => async (req, res) => {
|
|
26
17
|
const writeJsonResponse = (statusCode, jsonResponse) => {
|
|
27
18
|
res.writeHead(statusCode, { 'Content-Type': 'application/json' });
|
|
28
19
|
return new Promise((resolve, reject) => jsonResponse === undefined
|
|
@@ -30,7 +21,7 @@ const createRequestListenerFromFunction = (fn) => (req, res) => __awaiter(void 0
|
|
|
30
21
|
: res.write(JSON.stringify(jsonResponse, null, 2), 'utf8', (err) => err ? reject(err) : res.end(resolve)));
|
|
31
22
|
};
|
|
32
23
|
try {
|
|
33
|
-
const requestBody =
|
|
24
|
+
const requestBody = await new Promise((resolve, reject) => {
|
|
34
25
|
const data = [];
|
|
35
26
|
req
|
|
36
27
|
.on('data', (chunk) => data.push(chunk))
|
|
@@ -43,13 +34,13 @@ const createRequestListenerFromFunction = (fn) => (req, res) => __awaiter(void 0
|
|
|
43
34
|
const args = Array.isArray(jsonRequest)
|
|
44
35
|
? jsonRequest
|
|
45
36
|
: [jsonRequest];
|
|
46
|
-
const response =
|
|
47
|
-
|
|
37
|
+
const response = await fn(...args);
|
|
38
|
+
await writeJsonResponse(200, response);
|
|
48
39
|
}
|
|
49
40
|
catch (err) {
|
|
50
|
-
|
|
41
|
+
await writeJsonResponse(500, (0, serialize_error_1.serializeError)(err));
|
|
51
42
|
}
|
|
52
|
-
}
|
|
43
|
+
};
|
|
53
44
|
exports.createRequestListenerFromFunction = createRequestListenerFromFunction;
|
|
54
45
|
/**
|
|
55
46
|
* Create a HTTP server based on the supplied `http.RequestListener`.
|
package/lib/wrapper/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/wrapper/http.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/wrapper/http.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAGxB,qDAAiD;AAEjD,8CAAuC;AAEvC;;;;;GAKG;AACI,MAAM,iCAAiC,GAC5C,CACE,EAAsD,EAChC,EAAE,CAC1B,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;IACjB,MAAM,iBAAiB,GAAG,CAAC,UAAkB,EAAE,YAAqB,EAAE,EAAE;QACtE,GAAG,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC,CAAC;QAElE,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAC3C,YAAY,KAAK,SAAS;YACxB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC;YAClB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAC/D,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CACrC,CACN,CAAC;IACJ,CAAC,CA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AO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAC3C,MAAM;SACH,MAAM,CAAC,IAAI,CAAC;SACZ,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;SACpB,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;SACnB,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;QACpB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,EAAiB,CAAC;QAEhD,aAAG,CAAC,EAAE,CAAC,mBAAmB,EAAE,aAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACtD,CAAC,CAAC,CACL,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,oBAAoB,wBAiB/B"}
|
package/lib/wrapper/main.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -16,7 +7,7 @@ exports.main = void 0;
|
|
|
16
7
|
const path_1 = __importDefault(require("path"));
|
|
17
8
|
const functionHandler_1 = require("./functionHandler");
|
|
18
9
|
const requestListener_1 = require("./requestListener");
|
|
19
|
-
const main = (rawEntryPoint, rawPort) =>
|
|
10
|
+
const main = async (rawEntryPoint, rawPort) => {
|
|
20
11
|
const availablePort = Number(rawPort) || undefined;
|
|
21
12
|
// Support exported function targeting, e.g. `src/module.ts#callMeMaybe`
|
|
22
13
|
const [modulePath, functionName] = path_1.default
|
|
@@ -28,6 +19,6 @@ const main = (rawEntryPoint, rawPort) => __awaiter(void 0, void 0, void 0, funct
|
|
|
28
19
|
return functionName
|
|
29
20
|
? (0, functionHandler_1.runFunctionHandler)({ availablePort, entryPoint, functionName })
|
|
30
21
|
: (0, requestListener_1.runRequestListener)({ availablePort, entryPoint });
|
|
31
|
-
}
|
|
22
|
+
};
|
|
32
23
|
exports.main = main;
|
|
33
24
|
//# sourceMappingURL=main.js.map
|
package/lib/wrapper/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/wrapper/main.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/wrapper/main.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAAuD;AACvD,uDAAuD;AAEhD,MAAM,IAAI,GAAG,KAAK,EAAE,aAAqB,EAAE,OAAe,EAAE,EAAE;IACnE,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC;IAEnD,wEAAwE;IACxE,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,GAAG,cAAI;SACpC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,CAAC;SAClC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAEjB,6BAA6B;IAC7B,8DAA8D;IAC9D,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAY,CAAC;IAElD,OAAO,YAAY;QACjB,CAAC,CAAC,IAAA,oCAAkB,EAAC,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;QACjE,CAAC,CAAC,IAAA,oCAAkB,EAAC,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAAC;AACxD,CAAC,CAAC;AAfW,QAAA,IAAI,QAef"}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.runRequestListener = void 0;
|
|
13
4
|
const validation_1 = require("../utils/validation");
|
|
@@ -18,8 +9,7 @@ const isConfig = (data) => (0, validation_1.isFunction)(data) || (0, validation_
|
|
|
18
9
|
*
|
|
19
10
|
* This supports Express and Koa applications out of the box.
|
|
20
11
|
*/
|
|
21
|
-
const runRequestListener = ({ availablePort, entryPoint, }) =>
|
|
22
|
-
var _a, _b;
|
|
12
|
+
const runRequestListener = async ({ availablePort, entryPoint, }) => {
|
|
23
13
|
if (!isConfig(entryPoint)) {
|
|
24
14
|
// Assume an executable script with weird exports
|
|
25
15
|
return;
|
|
@@ -35,13 +25,13 @@ const runRequestListener = ({ availablePort, entryPoint, }) => __awaiter(void 0,
|
|
|
35
25
|
}
|
|
36
26
|
const requestListener = typeof config === 'function'
|
|
37
27
|
? config
|
|
38
|
-
:
|
|
28
|
+
: config.requestListener ?? config.callback?.();
|
|
39
29
|
if (typeof requestListener !== 'function') {
|
|
40
30
|
// Assume an executable script with non-request listener exports
|
|
41
31
|
return;
|
|
42
32
|
}
|
|
43
33
|
const port = (0, validation_1.isIpPort)(config.port) ? config.port : availablePort;
|
|
44
34
|
return (0, http_1.serveRequestListener)(requestListener, port);
|
|
45
|
-
}
|
|
35
|
+
};
|
|
46
36
|
exports.runRequestListener = runRequestListener;
|
|
47
37
|
//# sourceMappingURL=requestListener.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestListener.js","sourceRoot":"","sources":["../../src/wrapper/requestListener.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"requestListener.js","sourceRoot":"","sources":["../../src/wrapper/requestListener.ts"],"names":[],"mappings":";;;AAEA,oDAAqE;AAErE,iCAA8C;AAiB9C,MAAM,QAAQ,GAAG,CAAC,IAAa,EAAyC,EAAE,CACxE,IAAA,uBAAU,EAAC,IAAI,CAAC,IAAI,IAAA,qBAAQ,EAAC,IAAI,CAAC,CAAC;AAOrC;;;;GAIG;AACI,MAAM,kBAAkB,GAAG,KAAK,EAAE,EACvC,aAAa,EACb,UAAU,GACL,EAAiB,EAAE;IACxB,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QACzB,iDAAiD;QACjD,OAAO;KACR;IAED,IAAI,MAAM,GAAG,UAAU,CAAC;IAExB,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;QAC1D,0CAA0C;QAC1C,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;KACzB;IAED,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QACpC,8CAA8C;QAC9C,OAAO;KACR;IAED,MAAM,eAAe,GACnB,OAAO,MAAM,KAAK,UAAU;QAC1B,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;IAEpD,IAAI,OAAO,eAAe,KAAK,UAAU,EAAE;QACzC,gEAAgE;QAChE,OAAO;KACR;IAED,MAAM,IAAI,GAAG,IAAA,qBAAQ,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC;IAEjE,OAAO,IAAA,2BAAoB,EAAC,eAAe,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC,CAAC;AAlCW,QAAA,kBAAkB,sBAkC7B"}
|
package/package.json
CHANGED
|
@@ -6,10 +6,6 @@
|
|
|
6
6
|
"url": "https://github.com/seek-oss/skuba/issues"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@changesets/cli": "^2.22.0",
|
|
10
|
-
"@changesets/pre": "^1.0.10",
|
|
11
|
-
"@changesets/read": "^0.5.4",
|
|
12
|
-
"@manypkg/get-packages": "^1.1.3",
|
|
13
9
|
"@octokit/rest": "^18.12.0",
|
|
14
10
|
"@octokit/types": "^6.34.0",
|
|
15
11
|
"@types/jest": "^27.4.0",
|
|
@@ -32,16 +28,12 @@
|
|
|
32
28
|
"jest": "^27.4.5",
|
|
33
29
|
"latest-version": "^5.1.0",
|
|
34
30
|
"lodash.mergewith": "^4.6.2",
|
|
35
|
-
"mdast-util-to-string": "^2.0.0",
|
|
36
|
-
"module-alias": "^2.2.2",
|
|
37
31
|
"normalize-package-data": "^4.0.0",
|
|
38
32
|
"npm-run-path": "^4.0.1",
|
|
39
33
|
"npm-which": "^3.0.1",
|
|
40
34
|
"picomatch": "^2.2.2",
|
|
41
35
|
"prettier": "~2.6.0",
|
|
42
36
|
"read-pkg-up": "^7.0.1",
|
|
43
|
-
"remark-parse": "^9.0.0",
|
|
44
|
-
"remark-stringify": "^9.0.1",
|
|
45
37
|
"runtypes": "^6.0.0",
|
|
46
38
|
"semantic-release": "^19.0.0",
|
|
47
39
|
"serialize-error": "^8.0.1",
|
|
@@ -52,13 +44,12 @@
|
|
|
52
44
|
"ts-node-dev": "^2.0.0-0",
|
|
53
45
|
"tsconfig-paths": "^3.11.0",
|
|
54
46
|
"tsconfig-seek": "1.0.2",
|
|
55
|
-
"typescript": "~4.6.2"
|
|
56
|
-
"unified": "^9.2.2"
|
|
47
|
+
"typescript": "~4.6.2"
|
|
57
48
|
},
|
|
58
49
|
"description": "SEEK development toolkit for backend applications and packages",
|
|
59
50
|
"devDependencies": {
|
|
51
|
+
"@changesets/cli": "2.22.0",
|
|
60
52
|
"@changesets/get-github-info": "0.5.0",
|
|
61
|
-
"@changesets/types": "4.1.0",
|
|
62
53
|
"@jest/reporters": "27.5.1",
|
|
63
54
|
"@types/ejs": "3.1.0",
|
|
64
55
|
"@types/express": "4.17.13",
|
|
@@ -133,5 +124,5 @@
|
|
|
133
124
|
"version": "4.0.0"
|
|
134
125
|
},
|
|
135
126
|
"types": "./lib/index.d.ts",
|
|
136
|
-
"version": "4.2.0
|
|
127
|
+
"version": "4.2.0"
|
|
137
128
|
}
|
|
@@ -60,7 +60,7 @@ steps:
|
|
|
60
60
|
- *aws-sm
|
|
61
61
|
- *private-npm
|
|
62
62
|
- *docker-ecr-cache
|
|
63
|
-
- seek-jobs/gantry#v1.
|
|
63
|
+
- seek-jobs/gantry#v1.7.0:
|
|
64
64
|
command: build
|
|
65
65
|
file: gantry.build.yml
|
|
66
66
|
region: <%- region %>
|
|
@@ -77,7 +77,7 @@ steps:
|
|
|
77
77
|
concurrency_group: <%- teamName %>/deploy/gantry/<%- devGantryEnvironmentName %>
|
|
78
78
|
key: deploy-dev
|
|
79
79
|
plugins:
|
|
80
|
-
- seek-jobs/gantry#v1.
|
|
80
|
+
- seek-jobs/gantry#v1.7.0:
|
|
81
81
|
command: apply
|
|
82
82
|
environment: <%- devGantryEnvironmentName %>
|
|
83
83
|
file: gantry.apply.yml
|
|
@@ -92,7 +92,7 @@ steps:
|
|
|
92
92
|
concurrency_group: <%- teamName %>/deploy/gantry/<%- prodGantryEnvironmentName %>
|
|
93
93
|
depends_on: deploy-dev
|
|
94
94
|
plugins:
|
|
95
|
-
- seek-jobs/gantry#v1.
|
|
95
|
+
- seek-jobs/gantry#v1.7.0:
|
|
96
96
|
command: apply
|
|
97
97
|
environment: <%- prodGantryEnvironmentName %>
|
|
98
98
|
file: gantry.apply.yml
|
|
@@ -25,13 +25,13 @@ COPY --from=build /workdir/lib lib
|
|
|
25
25
|
|
|
26
26
|
COPY --from=deps /workdir/node_modules node_modules
|
|
27
27
|
|
|
28
|
-
ENV NODE_ENV
|
|
28
|
+
ENV NODE_ENV=production
|
|
29
29
|
|
|
30
30
|
# https://nodejs.org/api/cli.html#cli_node_options_options
|
|
31
|
-
ENV NODE_OPTIONS
|
|
31
|
+
ENV NODE_OPTIONS=--enable-source-maps
|
|
32
32
|
|
|
33
33
|
ARG PORT=8001
|
|
34
|
-
ENV PORT
|
|
34
|
+
ENV PORT=${PORT}
|
|
35
35
|
EXPOSE ${PORT}
|
|
36
36
|
|
|
37
37
|
CMD ["lib/listen.js"]
|
|
@@ -60,7 +60,7 @@ steps:
|
|
|
60
60
|
- *aws-sm
|
|
61
61
|
- *private-npm
|
|
62
62
|
- *docker-ecr-cache
|
|
63
|
-
- seek-jobs/gantry#v1.
|
|
63
|
+
- seek-jobs/gantry#v1.7.0:
|
|
64
64
|
command: build
|
|
65
65
|
file: gantry.build.yml
|
|
66
66
|
region: <%- region %>
|
|
@@ -77,7 +77,7 @@ steps:
|
|
|
77
77
|
concurrency_group: <%- teamName %>/deploy/gantry/<%- devGantryEnvironmentName %>
|
|
78
78
|
key: deploy-dev
|
|
79
79
|
plugins:
|
|
80
|
-
- seek-jobs/gantry#v1.
|
|
80
|
+
- seek-jobs/gantry#v1.7.0:
|
|
81
81
|
command: apply
|
|
82
82
|
environment: <%- devGantryEnvironmentName %>
|
|
83
83
|
file: gantry.apply.yml
|
|
@@ -92,7 +92,7 @@ steps:
|
|
|
92
92
|
concurrency_group: <%- teamName %>/deploy/gantry/<%- prodGantryEnvironmentName %>
|
|
93
93
|
depends_on: deploy-dev
|
|
94
94
|
plugins:
|
|
95
|
-
- seek-jobs/gantry#v1.
|
|
95
|
+
- seek-jobs/gantry#v1.7.0:
|
|
96
96
|
command: apply
|
|
97
97
|
environment: <%- prodGantryEnvironmentName %>
|
|
98
98
|
file: gantry.apply.yml
|
|
@@ -25,13 +25,13 @@ COPY --from=build /workdir/lib lib
|
|
|
25
25
|
|
|
26
26
|
COPY --from=deps /workdir/node_modules node_modules
|
|
27
27
|
|
|
28
|
-
ENV NODE_ENV
|
|
28
|
+
ENV NODE_ENV=production
|
|
29
29
|
|
|
30
30
|
# https://nodejs.org/api/cli.html#cli_node_options_options
|
|
31
|
-
ENV NODE_OPTIONS
|
|
31
|
+
ENV NODE_OPTIONS=--enable-source-maps
|
|
32
32
|
|
|
33
33
|
ARG PORT=8001
|
|
34
|
-
ENV PORT
|
|
34
|
+
ENV PORT=${PORT}
|
|
35
35
|
EXPOSE ${PORT}
|
|
36
36
|
|
|
37
37
|
CMD ["--require", "./lib/tracing.js", "./lib/listen.js"]
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
declare const inputs: {
|
|
2
|
-
readonly publish: "yarn changeset publish";
|
|
3
|
-
readonly commit: "Version Packages";
|
|
4
|
-
readonly title: "Version Packages";
|
|
5
|
-
readonly branch: "changeset-release/";
|
|
6
|
-
};
|
|
7
|
-
export declare const getInput: (name: keyof typeof inputs) => string;
|
|
8
|
-
export declare const setFailed: (message: string) => never;
|
|
9
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setFailed = exports.getInput = void 0;
|
|
4
|
-
const inputs = {
|
|
5
|
-
publish: 'yarn changeset publish',
|
|
6
|
-
commit: 'Version Packages',
|
|
7
|
-
title: 'Version Packages',
|
|
8
|
-
branch: 'changeset-release/',
|
|
9
|
-
};
|
|
10
|
-
const getInput = (name) => inputs[name];
|
|
11
|
-
exports.getInput = getInput;
|
|
12
|
-
// Maybe we could store these in a checkrun..?
|
|
13
|
-
const setFailed = (message) => {
|
|
14
|
-
// eslint-disable-next-line no-console
|
|
15
|
-
console.error(message);
|
|
16
|
-
throw new Error();
|
|
17
|
-
};
|
|
18
|
-
exports.setFailed = setFailed;
|
|
19
|
-
//# sourceMappingURL=coreAdapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coreAdapter.js","sourceRoot":"","sources":["../../../src/cli/changesets/coreAdapter.ts"],"names":[],"mappings":";;;AAAA,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,wBAAwB;IACjC,MAAM,EAAE,kBAAkB;IAC1B,KAAK,EAAE,kBAAkB;IACzB,MAAM,EAAE,oBAAoB;CACpB,CAAC;AAEJ,MAAM,QAAQ,GAAG,CAAC,IAAyB,EAAU,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAA/D,QAAA,QAAQ,YAAuD;AAE5E,8CAA8C;AACvC,MAAM,SAAS,GAAG,CAAC,OAAe,EAAE,EAAE;IAC3C,sCAAsC;IACtC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACvB,MAAM,IAAI,KAAK,EAAE,CAAC;AACpB,CAAC,CAAC;AAJW,QAAA,SAAS,aAIpB"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const push: (dir: string, branch: string, { force }?: {
|
|
2
|
-
force?: boolean | undefined;
|
|
3
|
-
}) => Promise<void>;
|
|
4
|
-
export declare const listTags: (dir: string) => Promise<string[]>;
|
|
5
|
-
export declare const pushTags: (dir: string, tags: string[]) => Promise<void>;
|
|
6
|
-
export declare const switchToMaybeExistingBranch: (dir: string, branch: string) => Promise<void>;
|
|
7
|
-
export declare const reset: (dir: string, commitId: string, branch: string) => Promise<void>;
|
|
8
|
-
export declare const commitAll: (dir: string, message: string) => Promise<void>;
|
|
9
|
-
export declare const checkIfClean: (dir: string) => Promise<boolean>;
|
|
10
|
-
export declare const context: (dir: string) => Promise<{
|
|
11
|
-
sha: string;
|
|
12
|
-
ref: string;
|
|
13
|
-
repo: {
|
|
14
|
-
repo: string;
|
|
15
|
-
owner: string;
|
|
16
|
-
};
|
|
17
|
-
}>;
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Adapted from https://github.com/changesets/action/blob/21240c3cd1d2efa2672d64e0235a03cf139b83e6/src/utils.ts
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
-
if (mod && mod.__esModule) return mod;
|
|
21
|
-
var result = {};
|
|
22
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
-
__setModuleDefault(result, mod);
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
26
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
27
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
28
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
29
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
30
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
31
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
32
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.context = exports.checkIfClean = exports.commitAll = exports.reset = exports.switchToMaybeExistingBranch = exports.pushTags = exports.listTags = exports.push = void 0;
|
|
40
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
41
|
-
const isomorphic_git_1 = __importDefault(require("isomorphic-git"));
|
|
42
|
-
const Git = __importStar(require("../../api/git"));
|
|
43
|
-
const push = (dir, branch, { force } = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
-
yield Git.push({
|
|
45
|
-
dir,
|
|
46
|
-
auth: { type: 'gitHubApp' },
|
|
47
|
-
ref: branch,
|
|
48
|
-
force,
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
exports.push = push;
|
|
52
|
-
const listTags = (dir) => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
-
return isomorphic_git_1.default.listTags({
|
|
54
|
-
fs: fs_extra_1.default,
|
|
55
|
-
dir,
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
exports.listTags = listTags;
|
|
59
|
-
const pushTags = (dir, tags) => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
|
-
yield Promise.all(tags.map((tag) => Git.push({
|
|
61
|
-
auth: { type: 'gitHubApp' },
|
|
62
|
-
ref: tag,
|
|
63
|
-
dir,
|
|
64
|
-
})));
|
|
65
|
-
});
|
|
66
|
-
exports.pushTags = pushTags;
|
|
67
|
-
const switchToMaybeExistingBranch = (dir, branch) => __awaiter(void 0, void 0, void 0, function* () {
|
|
68
|
-
try {
|
|
69
|
-
yield isomorphic_git_1.default.branch({
|
|
70
|
-
fs: fs_extra_1.default,
|
|
71
|
-
dir,
|
|
72
|
-
ref: branch,
|
|
73
|
-
checkout: true,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
catch (error) {
|
|
77
|
-
if (error instanceof isomorphic_git_1.default.Errors.AlreadyExistsError) {
|
|
78
|
-
yield isomorphic_git_1.default.deleteBranch({
|
|
79
|
-
fs: fs_extra_1.default,
|
|
80
|
-
dir,
|
|
81
|
-
ref: branch,
|
|
82
|
-
});
|
|
83
|
-
yield isomorphic_git_1.default.branch({
|
|
84
|
-
fs: fs_extra_1.default,
|
|
85
|
-
dir,
|
|
86
|
-
ref: branch,
|
|
87
|
-
checkout: true,
|
|
88
|
-
});
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
throw error;
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
exports.switchToMaybeExistingBranch = switchToMaybeExistingBranch;
|
|
95
|
-
const reset = (dir, commitId, branch) => __awaiter(void 0, void 0, void 0, function* () { return Git.reset({ dir, branch, commitId, hard: true }); });
|
|
96
|
-
exports.reset = reset;
|
|
97
|
-
const commitAll = (dir, message) => __awaiter(void 0, void 0, void 0, function* () {
|
|
98
|
-
yield Git.commitAllChanges({
|
|
99
|
-
dir,
|
|
100
|
-
message,
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
exports.commitAll = commitAll;
|
|
104
|
-
const checkIfClean = (dir) => __awaiter(void 0, void 0, void 0, function* () {
|
|
105
|
-
const changedFiles = yield Git.getChangedFiles({ dir });
|
|
106
|
-
return !changedFiles.length;
|
|
107
|
-
});
|
|
108
|
-
exports.checkIfClean = checkIfClean;
|
|
109
|
-
const context = (dir) => __awaiter(void 0, void 0, void 0, function* () {
|
|
110
|
-
const [{ owner, repo }, currentBranch, headSha] = yield Promise.all([
|
|
111
|
-
Git.getOwnerAndRepo({ dir }),
|
|
112
|
-
Git.currentBranch({ dir }),
|
|
113
|
-
Git.getHeadCommitId({ dir }),
|
|
114
|
-
]);
|
|
115
|
-
if (!currentBranch) {
|
|
116
|
-
throw new Error('Could not determine the current Git branch from environment variables or local directory');
|
|
117
|
-
}
|
|
118
|
-
return {
|
|
119
|
-
sha: headSha,
|
|
120
|
-
ref: currentBranch,
|
|
121
|
-
repo: {
|
|
122
|
-
repo,
|
|
123
|
-
owner,
|
|
124
|
-
},
|
|
125
|
-
};
|
|
126
|
-
});
|
|
127
|
-
exports.context = context;
|
|
128
|
-
//# sourceMappingURL=gitUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gitUtils.js","sourceRoot":"","sources":["../../../src/cli/changesets/gitUtils.ts"],"names":[],"mappings":";AAAA,+GAA+G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE/G,wDAA0B;AAC1B,oEAAiC;AAEjC,mDAAqC;AAE9B,MAAM,IAAI,GAAG,CAClB,GAAW,EACX,MAAc,EACd,EAAE,KAAK,KAA0B,EAAE,EACpB,EAAE;IACjB,MAAM,GAAG,CAAC,IAAI,CAAC;QACb,GAAG;QACH,IAAI,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;QAC3B,GAAG,EAAE,MAAM;QACX,KAAK;KACN,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAXW,QAAA,IAAI,QAWf;AAEK,MAAM,QAAQ,GAAG,CAAO,GAAW,EAAqB,EAAE;IAC/D,OAAA,wBAAG,CAAC,QAAQ,CAAC;QACX,EAAE,EAAF,kBAAE;QACF,GAAG;KACJ,CAAC,CAAA;EAAA,CAAC;AAJQ,QAAA,QAAQ,YAIhB;AAEE,MAAM,QAAQ,GAAG,CAAO,GAAW,EAAE,IAAc,EAAiB,EAAE;IAC3E,MAAM,OAAO,CAAC,GAAG,CACf,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CACf,GAAG,CAAC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AQpB;AAEK,MAAM,YAAY,GAAG,CAAO,GAAW,EAAoB,EAAE;IAClE,MAAM,YAAY,GAAG,MAAM,GAAG,CAAC,eAAe,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IACxD,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC;AAC9B,CAAC,CAAA,CAAC;AAHW,QAAA,YAAY,gBAGvB;AAEK,MAAM,OAAO,GAAG,CAAO,GAAW,EAAE,EAAE;IAC3C,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,aAAa,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAClE,GAAG,CAAC,eAAe,CAAC,EAAE,GAAG,EAAE,CAAC;QAC5B,GAAG,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC;QAC1B,GAAG,CAAC,eAAe,CAAC,EAAE,GAAG,EAAE,CAAC;KAC7B,CAAC,CAAC;IAEH,IAAI,CAAC,aAAa,EAAE;QAClB,MAAM,IAAI,KAAK,CACb,0FAA0F,CAC3F,CAAC;KACH;IAED,OAAO;QACL,GAAG,EAAE,OAAO;QACZ,GAAG,EAAE,aAAa;QAClB,IAAI,EAAE;YACJ,IAAI;YACJ,KAAK;SACN;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AArBW,QAAA,OAAO,WAqBlB"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const getOctokit: () => import("@octokit/core").Octokit & {
|
|
2
|
-
paginate: import("@octokit/plugin-paginate-rest").PaginateInterface;
|
|
3
|
-
} & import("@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types").RestEndpointMethods & import("@octokit/plugin-rest-endpoint-methods/dist-types/types").Api;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOctokit = void 0;
|
|
4
|
-
const rest_1 = require("@octokit/rest");
|
|
5
|
-
const environment_1 = require("../../api/github/environment");
|
|
6
|
-
const getOctokit = () => new rest_1.Octokit({ auth: (0, environment_1.apiTokenFromEnvironment)() });
|
|
7
|
-
exports.getOctokit = getOctokit;
|
|
8
|
-
//# sourceMappingURL=githubAdapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"githubAdapter.js","sourceRoot":"","sources":["../../../src/cli/changesets/githubAdapter.ts"],"names":[],"mappings":";;;AAAA,wCAAwC;AAExC,8DAAuE;AAEhE,MAAM,UAAU,GAAG,GAAG,EAAE,CAC7B,IAAI,cAAO,CAAC,EAAE,IAAI,EAAE,IAAA,qCAAuB,GAAE,EAAE,CAAC,CAAC;AADtC,QAAA,UAAU,cAC4B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const changesets: () => Promise<void>;
|