@vercel/fun 1.3.0 → 1.3.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/dist/src/deferred.js +1 -2
- package/dist/src/deferred.js.map +1 -1
- package/dist/src/errors.js.map +1 -1
- package/dist/src/index.js +88 -96
- package/dist/src/index.js.map +1 -1
- package/dist/src/install-node.d.ts +0 -1
- package/dist/src/install-node.js +32 -44
- package/dist/src/install-node.js.map +1 -1
- package/dist/src/install-python.d.ts +0 -1
- package/dist/src/install-python.js +16 -33
- package/dist/src/install-python.js.map +1 -1
- package/dist/src/providers/docker/index.js +1 -1
- package/dist/src/providers/docker/index.js.map +1 -1
- package/dist/src/providers/native/index.d.ts +0 -1
- package/dist/src/providers/native/index.js +133 -128
- package/dist/src/providers/native/index.js.map +1 -1
- package/dist/src/runtime-server.d.ts +0 -1
- package/dist/src/runtime-server.js +115 -129
- package/dist/src/runtime-server.js.map +1 -1
- package/dist/src/runtimes/go1.x/filename.js +1 -2
- package/dist/src/runtimes/go1.x/filename.js.map +1 -1
- package/dist/src/runtimes/go1.x/index.js +27 -39
- package/dist/src/runtimes/go1.x/index.js.map +1 -1
- package/dist/src/runtimes/nodejs/bootstrap.js +99 -124
- package/dist/src/runtimes/nodejs/bootstrap.js.map +1 -1
- package/dist/src/runtimes/nodejs10.x/index.js +6 -18
- package/dist/src/runtimes/nodejs10.x/index.js.map +1 -1
- package/dist/src/runtimes/nodejs12.x/index.js +6 -18
- package/dist/src/runtimes/nodejs12.x/index.js.map +1 -1
- package/dist/src/runtimes/nodejs14.x/index.js +6 -18
- package/dist/src/runtimes/nodejs14.x/index.js.map +1 -1
- package/dist/src/runtimes/nodejs6.10/index.js +6 -18
- package/dist/src/runtimes/nodejs6.10/index.js.map +1 -1
- package/dist/src/runtimes/nodejs8.10/index.js +6 -18
- package/dist/src/runtimes/nodejs8.10/index.js.map +1 -1
- package/dist/src/runtimes/python/bootstrap.js.map +1 -1
- package/dist/src/runtimes/python2.7/index.js +6 -18
- package/dist/src/runtimes/python2.7/index.js.map +1 -1
- package/dist/src/runtimes/python3/bootstrap.js.map +1 -1
- package/dist/src/runtimes/python3/index.js +3 -15
- package/dist/src/runtimes/python3/index.js.map +1 -1
- package/dist/src/runtimes/python3.6/index.js +6 -18
- package/dist/src/runtimes/python3.6/index.js.map +1 -1
- package/dist/src/runtimes/python3.7/index.js +6 -18
- package/dist/src/runtimes/python3.7/index.js.map +1 -1
- package/dist/src/runtimes.js +129 -136
- package/dist/src/runtimes.js.map +1 -1
- package/dist/src/types.d.ts +0 -2
- package/dist/src/unzip.d.ts +0 -2
- package/dist/src/unzip.js +65 -78
- package/dist/src/unzip.js.map +1 -1
- package/package.json +4 -6
|
@@ -1,24 +1,12 @@
|
|
|
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
|
-
exports.init =
|
|
3
|
+
exports.init = init;
|
|
13
4
|
const install_node_1 = require("../../install-node");
|
|
14
5
|
const runtimes_1 = require("../../runtimes");
|
|
15
|
-
function init({ cacheDir }) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
]);
|
|
21
|
-
});
|
|
6
|
+
async function init({ cacheDir }) {
|
|
7
|
+
await Promise.all([
|
|
8
|
+
(0, runtimes_1.initializeRuntime)(runtimes_1.runtimes.nodejs),
|
|
9
|
+
(0, install_node_1.installNode)(cacheDir, '8.10.0')
|
|
10
|
+
]);
|
|
22
11
|
}
|
|
23
|
-
exports.init = init;
|
|
24
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/runtimes/nodejs8.10/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/runtimes/nodejs8.10/index.ts"],"names":[],"mappings":";;AAIA,oBAKC;AARD,qDAAiD;AACjD,6CAA6D;AAEtD,KAAK,UAAU,IAAI,CAAC,EAAE,QAAQ,EAAW;IAC/C,MAAM,OAAO,CAAC,GAAG,CAAC;QACjB,IAAA,4BAAiB,EAAC,mBAAQ,CAAC,MAAM,CAAC;QAClC,IAAA,0BAAW,EAAC,QAAQ,EAAE,QAAQ,CAAC;KAC/B,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../../src/runtimes/python/bootstrap.ts"],"names":[],"mappings":";;AAAA,yCAAiC;AACjC,2DAA2C;AAE3C,8DAA8D;AAC9D,2DAA2D;AAC3D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../../src/runtimes/python/bootstrap.ts"],"names":[],"mappings":";;AAAA,yCAAiC;AACjC,2DAA2C;AAE3C,8DAA8D;AAC9D,2DAA2D;AAC3D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;IAC7B,OAAO,CAAC,GAAG,CAAC,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;AACzD,CAAC;AAED,MAAM,SAAS,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,cAAc,CAAC,CAAC;AAClD,IAAA,0BAAK,EAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC"}
|
|
@@ -1,24 +1,12 @@
|
|
|
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
|
-
exports.init =
|
|
3
|
+
exports.init = init;
|
|
13
4
|
const install_python_1 = require("../../install-python");
|
|
14
5
|
const runtimes_1 = require("../../runtimes");
|
|
15
|
-
function init({ cacheDir }) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
]);
|
|
21
|
-
});
|
|
6
|
+
async function init({ cacheDir }) {
|
|
7
|
+
await Promise.all([
|
|
8
|
+
(0, runtimes_1.initializeRuntime)(runtimes_1.runtimes.python),
|
|
9
|
+
(0, install_python_1.installPython)(cacheDir, '2.7.12')
|
|
10
|
+
]);
|
|
22
11
|
}
|
|
23
|
-
exports.init = init;
|
|
24
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/runtimes/python2.7/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/runtimes/python2.7/index.ts"],"names":[],"mappings":";;AAIA,oBAKC;AARD,yDAAqD;AACrD,6CAA6D;AAEtD,KAAK,UAAU,IAAI,CAAC,EAAE,QAAQ,EAAW;IAC/C,MAAM,OAAO,CAAC,GAAG,CAAC;QACjB,IAAA,4BAAiB,EAAC,mBAAQ,CAAC,MAAM,CAAC;QAClC,IAAA,8BAAa,EAAC,QAAQ,EAAE,QAAQ,CAAC;KACjC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../../src/runtimes/python3/bootstrap.ts"],"names":[],"mappings":";;AAAA,yCAAiC;AACjC,2DAA2C;AAE3C,8DAA8D;AAC9D,2DAA2D;AAC3D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../../src/runtimes/python3/bootstrap.ts"],"names":[],"mappings":";;AAAA,yCAAiC;AACjC,2DAA2C;AAE3C,8DAA8D;AAC9D,2DAA2D;AAC3D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;IAC7B,OAAO,CAAC,GAAG,CAAC,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;AACzD,CAAC;AAED,IAAI,SAAS,GAAG,SAAS,CAAC;AAC1B,SAAS,QAAQ;IAChB,SAAS,GAAG,QAAQ,CAAC;AACtB,CAAC;AACD,SAAS,OAAO,CAAC,IAAa;IAC7B,MAAM,SAAS,GAAG,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAEtD,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,QAAQ,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,SAAS,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;IAClE,IAAA,0BAAK,EAAC,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AACrD,CAAC;AACD,MAAM,KAAK,GAAG,IAAA,0BAAK,EAAC,SAAS,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;AAC9C,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AAE5B,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CACjE,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE;IACpB,yEAAyE;IACzE,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;IACX,CAAC;SAAM,CAAC;QACP,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC5B,CAAC;AACF,CAAC,CACD,CAAC;AAEF,SAAS,cAAc,CAAC,MAA6B;IACpD,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;QAC5B,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9C,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,20 +1,8 @@
|
|
|
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
|
-
exports.init =
|
|
3
|
+
exports.init = init;
|
|
13
4
|
const runtimes_1 = require("../../runtimes");
|
|
14
|
-
function init(_runtime) {
|
|
15
|
-
|
|
16
|
-
yield (0, runtimes_1.initializeRuntime)(runtimes_1.runtimes.python);
|
|
17
|
-
});
|
|
5
|
+
async function init(_runtime) {
|
|
6
|
+
await (0, runtimes_1.initializeRuntime)(runtimes_1.runtimes.python);
|
|
18
7
|
}
|
|
19
|
-
exports.init = init;
|
|
20
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/runtimes/python3/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/runtimes/python3/index.ts"],"names":[],"mappings":";;AAGA,oBAEC;AAJD,6CAA6D;AAEtD,KAAK,UAAU,IAAI,CAAC,QAAiB;IAC3C,MAAM,IAAA,4BAAiB,EAAC,mBAAQ,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -1,24 +1,12 @@
|
|
|
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
|
-
exports.init =
|
|
3
|
+
exports.init = init;
|
|
13
4
|
const install_python_1 = require("../../install-python");
|
|
14
5
|
const runtimes_1 = require("../../runtimes");
|
|
15
|
-
function init({ cacheDir }) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
]);
|
|
21
|
-
});
|
|
6
|
+
async function init({ cacheDir }) {
|
|
7
|
+
await Promise.all([
|
|
8
|
+
(0, runtimes_1.initializeRuntime)(runtimes_1.runtimes.python),
|
|
9
|
+
(0, install_python_1.installPython)(cacheDir, '3.6.8')
|
|
10
|
+
]);
|
|
22
11
|
}
|
|
23
|
-
exports.init = init;
|
|
24
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/runtimes/python3.6/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/runtimes/python3.6/index.ts"],"names":[],"mappings":";;AAIA,oBAKC;AARD,yDAAqD;AACrD,6CAA6D;AAEtD,KAAK,UAAU,IAAI,CAAC,EAAE,QAAQ,EAAW;IAC/C,MAAM,OAAO,CAAC,GAAG,CAAC;QACjB,IAAA,4BAAiB,EAAC,mBAAQ,CAAC,MAAM,CAAC;QAClC,IAAA,8BAAa,EAAC,QAAQ,EAAE,OAAO,CAAC;KAChC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,24 +1,12 @@
|
|
|
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
|
-
exports.init =
|
|
3
|
+
exports.init = init;
|
|
13
4
|
const install_python_1 = require("../../install-python");
|
|
14
5
|
const runtimes_1 = require("../../runtimes");
|
|
15
|
-
function init({ cacheDir }) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
]);
|
|
21
|
-
});
|
|
6
|
+
async function init({ cacheDir }) {
|
|
7
|
+
await Promise.all([
|
|
8
|
+
(0, runtimes_1.initializeRuntime)(runtimes_1.runtimes.python),
|
|
9
|
+
(0, install_python_1.installPython)(cacheDir, '3.7.2')
|
|
10
|
+
]);
|
|
22
11
|
}
|
|
23
|
-
exports.init = init;
|
|
24
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/runtimes/python3.7/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/runtimes/python3.7/index.ts"],"names":[],"mappings":";;AAIA,oBAKC;AARD,yDAAqD;AACrD,6CAA6D;AAEtD,KAAK,UAAU,IAAI,CAAC,EAAE,QAAQ,EAAW;IAC/C,MAAM,OAAO,CAAC,GAAG,CAAC;QACjB,IAAA,4BAAiB,EAAC,mBAAQ,CAAC,MAAM,CAAC;QAClC,IAAA,8BAAa,EAAC,QAAQ,EAAE,OAAO,CAAC;KAChC,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/src/runtimes.js
CHANGED
|
@@ -15,27 +15,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
34
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
37
|
};
|
|
37
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.
|
|
39
|
+
exports.funCacheDir = exports.runtimes = void 0;
|
|
40
|
+
exports.initializeRuntime = initializeRuntime;
|
|
39
41
|
const node_path_1 = require("node:path");
|
|
40
42
|
const debug_1 = __importDefault(require("debug"));
|
|
41
43
|
const xdg_app_paths_1 = __importDefault(require("xdg-app-paths"));
|
|
@@ -56,7 +58,11 @@ const runtimesDir = (0, node_path_1.join)(__dirname, 'runtimes');
|
|
|
56
58
|
exports.runtimes = {};
|
|
57
59
|
exports.funCacheDir = (0, xdg_app_paths_1.default)('com.vercel.fun').cache();
|
|
58
60
|
function createRuntime(runtimes, name, mod) {
|
|
59
|
-
const runtime =
|
|
61
|
+
const runtime = {
|
|
62
|
+
name,
|
|
63
|
+
runtimeDir: (0, node_path_1.join)(runtimesDir, name),
|
|
64
|
+
...mod
|
|
65
|
+
};
|
|
60
66
|
runtimes[name] = runtime;
|
|
61
67
|
}
|
|
62
68
|
createRuntime(exports.runtimes, 'executable');
|
|
@@ -77,18 +83,16 @@ createRuntime(exports.runtimes, 'python3.7', python37);
|
|
|
77
83
|
* Reads the file path `f` as an ascii string.
|
|
78
84
|
* Returns `null` if the file does not exist.
|
|
79
85
|
*/
|
|
80
|
-
function getCachedRuntimeSha(f) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
throw err;
|
|
86
|
+
async function getCachedRuntimeSha(f) {
|
|
87
|
+
try {
|
|
88
|
+
return await (0, promises_1.readFile)(f, 'ascii');
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
if (err.code === 'ENOENT') {
|
|
92
|
+
return null;
|
|
90
93
|
}
|
|
91
|
-
|
|
94
|
+
throw err;
|
|
95
|
+
}
|
|
92
96
|
}
|
|
93
97
|
const runtimeShaPromises = new Map();
|
|
94
98
|
/**
|
|
@@ -96,31 +100,27 @@ const runtimeShaPromises = new Map();
|
|
|
96
100
|
* `bootstrap` or other dependent files change then the shasum will be
|
|
97
101
|
* different and the user's existing runtime cache will be invalidated.
|
|
98
102
|
*/
|
|
99
|
-
function _calculateRuntimeSha(src) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return sha;
|
|
107
|
-
});
|
|
103
|
+
async function _calculateRuntimeSha(src) {
|
|
104
|
+
debug('calculateRuntimeSha(%o)', src);
|
|
105
|
+
const hash = (0, node_crypto_1.createHash)('sha256');
|
|
106
|
+
await calculateRuntimeShaDir(src, hash);
|
|
107
|
+
const sha = hash.digest('hex');
|
|
108
|
+
debug('Calculated runtime sha for %o: %o', src, sha);
|
|
109
|
+
return sha;
|
|
108
110
|
}
|
|
109
|
-
function calculateRuntimeShaDir(src, hash) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
yield calculateRuntimeShaDir(srcPath, hash);
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
const contents = yield (0, promises_1.readFile)(srcPath);
|
|
120
|
-
hash.update(contents);
|
|
121
|
-
}
|
|
111
|
+
async function calculateRuntimeShaDir(src, hash) {
|
|
112
|
+
const entries = await (0, promises_1.readdir)(src);
|
|
113
|
+
for (const entry of entries) {
|
|
114
|
+
const srcPath = (0, node_path_1.join)(src, entry);
|
|
115
|
+
const s = await (0, promises_1.lstat)(srcPath);
|
|
116
|
+
if (s.isDirectory()) {
|
|
117
|
+
await calculateRuntimeShaDir(srcPath, hash);
|
|
122
118
|
}
|
|
123
|
-
|
|
119
|
+
else {
|
|
120
|
+
const contents = await (0, promises_1.readFile)(srcPath);
|
|
121
|
+
hash.update(contents);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
124
|
}
|
|
125
125
|
function calculateRuntimeSha(src) {
|
|
126
126
|
// The sha calculation promise gets memoized because the runtime code
|
|
@@ -136,102 +136,95 @@ function calculateRuntimeSha(src) {
|
|
|
136
136
|
* Until https://github.com/zeit/pkg/issues/639 is resolved, we have to
|
|
137
137
|
* implement the `copy()` operation without relying on `fs.copyFile()`.
|
|
138
138
|
*/
|
|
139
|
-
function copy(src, dest) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
yield copy(srcPath, destPath);
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
const contents = yield (0, promises_1.readFile)(srcPath);
|
|
156
|
-
yield (0, promises_1.writeFile)(destPath, contents, { mode: s.mode });
|
|
157
|
-
}
|
|
139
|
+
async function copy(src, dest) {
|
|
140
|
+
debug('copy(%o, %o)', src, dest);
|
|
141
|
+
const [entries] = await Promise.all([
|
|
142
|
+
(0, promises_1.readdir)(src),
|
|
143
|
+
(0, promises_1.mkdir)(dest, { recursive: true })
|
|
144
|
+
]);
|
|
145
|
+
debug('Entries: %o', entries);
|
|
146
|
+
for (const entry of entries) {
|
|
147
|
+
const srcPath = (0, node_path_1.join)(src, entry);
|
|
148
|
+
const destPath = (0, node_path_1.join)(dest, entry);
|
|
149
|
+
const s = await (0, promises_1.lstat)(srcPath);
|
|
150
|
+
if (s.isDirectory()) {
|
|
151
|
+
await copy(srcPath, destPath);
|
|
158
152
|
}
|
|
159
|
-
|
|
153
|
+
else {
|
|
154
|
+
const contents = await (0, promises_1.readFile)(srcPath);
|
|
155
|
+
await (0, promises_1.writeFile)(destPath, contents, { mode: s.mode });
|
|
156
|
+
}
|
|
157
|
+
}
|
|
160
158
|
}
|
|
161
159
|
// The Promises map is to ensure that a runtime is only initialized once
|
|
162
160
|
const initPromises = new Map();
|
|
163
|
-
function _initializeRuntime(runtime) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
161
|
+
async function _initializeRuntime(runtime) {
|
|
162
|
+
const cacheDir = (0, node_path_1.join)(exports.funCacheDir, 'runtimes', runtime.name);
|
|
163
|
+
const cacheShaFile = (0, node_path_1.join)(cacheDir, '.cache-sha');
|
|
164
|
+
const [cachedRuntimeSha, runtimeSha] = await Promise.all([
|
|
165
|
+
getCachedRuntimeSha(cacheShaFile),
|
|
166
|
+
calculateRuntimeSha(runtime.runtimeDir)
|
|
167
|
+
]);
|
|
168
|
+
runtime.cacheDir = cacheDir;
|
|
169
|
+
if (cachedRuntimeSha === runtimeSha) {
|
|
170
|
+
debug('Runtime %o is already initialized at %o', runtime.name, cacheDir);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
debug('Initializing %o runtime at %o', runtime.name, cacheDir);
|
|
174
|
+
try {
|
|
175
|
+
await (0, promises_1.mkdir)(cacheDir, { recursive: true });
|
|
176
|
+
// The runtime directory is copied from the module dir to the cache
|
|
177
|
+
// dir. This is so that when compiled through `pkg`, then the
|
|
178
|
+
// bootstrap files exist on a real file system so that `execve()`
|
|
179
|
+
// works as expected.
|
|
180
|
+
await copy(runtime.runtimeDir, cacheDir);
|
|
181
|
+
// Perform any runtime-specific initialization logic
|
|
182
|
+
if (typeof runtime.init === 'function') {
|
|
183
|
+
await runtime.init(runtime);
|
|
184
|
+
}
|
|
185
|
+
await (0, promises_1.writeFile)((0, node_path_1.join)(cacheDir, '.cache-sha'), runtimeSha);
|
|
174
186
|
}
|
|
175
|
-
|
|
176
|
-
debug('
|
|
187
|
+
catch (err) {
|
|
188
|
+
debug('Runtime %o `init()` failed %o. Cleaning up cache dir %o', runtime.name, err, cacheDir);
|
|
177
189
|
try {
|
|
178
|
-
|
|
179
|
-
// The runtime directory is copied from the module dir to the cache
|
|
180
|
-
// dir. This is so that when compiled through `pkg`, then the
|
|
181
|
-
// bootstrap files exist on a real file system so that `execve()`
|
|
182
|
-
// works as expected.
|
|
183
|
-
yield copy(runtime.runtimeDir, cacheDir);
|
|
184
|
-
// Perform any runtime-specific initialization logic
|
|
185
|
-
if (typeof runtime.init === 'function') {
|
|
186
|
-
yield runtime.init(runtime);
|
|
187
|
-
}
|
|
188
|
-
yield (0, promises_1.writeFile)((0, node_path_1.join)(cacheDir, '.cache-sha'), runtimeSha);
|
|
190
|
+
await (0, promises_1.rm)(cacheDir, { recursive: true });
|
|
189
191
|
}
|
|
190
|
-
catch (
|
|
191
|
-
debug('
|
|
192
|
-
try {
|
|
193
|
-
yield (0, promises_1.rm)(cacheDir, { recursive: true });
|
|
194
|
-
}
|
|
195
|
-
catch (err2) {
|
|
196
|
-
debug('Cleaning up cache dir failed: %o', err2);
|
|
197
|
-
}
|
|
198
|
-
throw err;
|
|
192
|
+
catch (err2) {
|
|
193
|
+
debug('Cleaning up cache dir failed: %o', err2);
|
|
199
194
|
}
|
|
195
|
+
throw err;
|
|
200
196
|
}
|
|
201
|
-
}
|
|
197
|
+
}
|
|
202
198
|
}
|
|
203
|
-
function initializeRuntime(target) {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
throw new Error(`Could not find runtime with name "${target}"`);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
runtime = target;
|
|
199
|
+
async function initializeRuntime(target) {
|
|
200
|
+
let runtime;
|
|
201
|
+
if (typeof target === 'string') {
|
|
202
|
+
runtime = exports.runtimes[target];
|
|
203
|
+
if (!runtime) {
|
|
204
|
+
throw new Error(`Could not find runtime with name "${target}"`);
|
|
214
205
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
runtime = target;
|
|
209
|
+
}
|
|
210
|
+
let p = initPromises.get(runtime);
|
|
211
|
+
if (p) {
|
|
212
|
+
await p;
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
p = _initializeRuntime(runtime);
|
|
216
|
+
initPromises.set(runtime, p);
|
|
217
|
+
try {
|
|
218
|
+
await p;
|
|
218
219
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
finally {
|
|
226
|
-
// Once the initialization is complete, remove the Promise. This is so that
|
|
227
|
-
// in case the cache is deleted during runtime, and then another Lambda
|
|
228
|
-
// function is created, the in-memory cache doesn't think the runtime is
|
|
229
|
-
// already initialized and will check the filesystem cache again.
|
|
230
|
-
initPromises.delete(runtime);
|
|
231
|
-
}
|
|
220
|
+
finally {
|
|
221
|
+
// Once the initialization is complete, remove the Promise. This is so that
|
|
222
|
+
// in case the cache is deleted during runtime, and then another Lambda
|
|
223
|
+
// function is created, the in-memory cache doesn't think the runtime is
|
|
224
|
+
// already initialized and will check the filesystem cache again.
|
|
225
|
+
initPromises.delete(runtime);
|
|
232
226
|
}
|
|
233
|
-
|
|
234
|
-
|
|
227
|
+
}
|
|
228
|
+
return runtime;
|
|
235
229
|
}
|
|
236
|
-
exports.initializeRuntime = initializeRuntime;
|
|
237
230
|
//# sourceMappingURL=runtimes.js.map
|
package/dist/src/runtimes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimes.js","sourceRoot":"","sources":["../../src/runtimes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtimes.js","sourceRoot":"","sources":["../../src/runtimes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsMA,8CAgCC;AAtOD,yCAAiC;AACjC,kDAAgC;AAChC,kEAAwC;AACxC,6CAA+C;AAC/C,+CAO0B;AAG1B,uDAAyC;AACzC,+DAAiD;AACjD,+DAAiD;AACjD,gEAAkD;AAClD,gEAAkD;AAClD,gEAAkD;AAClD,+DAAiD;AACjD,4DAA8C;AAC9C,+DAAiD;AACjD,+DAAiD;AAEjD,MAAM,KAAK,GAAG,IAAA,eAAW,EAAC,sBAAsB,CAAC,CAAC;AAClD,MAAM,WAAW,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAUnC,QAAA,QAAQ,GAAa,EAAE,CAAC;AAExB,QA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9B,CAAC;IACF,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
package/dist/src/types.d.ts
CHANGED
package/dist/src/unzip.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import { ZipFile, open as zipFromFile, fromBuffer as zipFromBuffer } from 'yauzl-promise';
|
|
4
2
|
export { zipFromFile, zipFromBuffer, ZipFile };
|
|
5
3
|
export declare function unzipToTemp(data: Buffer | string, tmpDir?: string): Promise<string>;
|