@vercel/ruby 2.0.4 → 2.0.5
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/index.js +18 -16
- package/package.json +2 -2
- package/vc_init.rb +6 -0
package/dist/index.js
CHANGED
|
@@ -7791,7 +7791,7 @@ async function matchPaths(configPatterns, workPath) {
|
|
|
7791
7791
|
);
|
|
7792
7792
|
return patternPaths.reduce((a, b) => a.concat(b), []);
|
|
7793
7793
|
}
|
|
7794
|
-
async function bundleInstall(bundlePath, bundleDir, gemfilePath, runtime) {
|
|
7794
|
+
async function bundleInstall(bundlePath, bundleDir, gemfilePath, rubyPath, runtime) {
|
|
7795
7795
|
(0, import_build_utils2.debug)(`running "bundle install --deployment"...`);
|
|
7796
7796
|
const bundleAppConfig = await (0, import_build_utils2.getWriteableDirectory)();
|
|
7797
7797
|
const gemfileContent = await (0, import_fs_extra.readFile)(gemfilePath, "utf8");
|
|
@@ -7808,7 +7808,7 @@ async function bundleInstall(bundlePath, bundleDir, gemfilePath, runtime) {
|
|
|
7808
7808
|
}
|
|
7809
7809
|
const bundlerEnv = (0, import_build_utils2.cloneEnv)(process.env, {
|
|
7810
7810
|
// Ensure the correct version of `ruby` is in front of the $PATH
|
|
7811
|
-
PATH: `${(0, import_path2.dirname)(bundlePath)}:${process.env.PATH}`,
|
|
7811
|
+
PATH: `${(0, import_path2.dirname)(rubyPath)}:${(0, import_path2.dirname)(bundlePath)}:${process.env.PATH}`,
|
|
7812
7812
|
BUNDLE_SILENCE_ROOT_WARNING: "1",
|
|
7813
7813
|
BUNDLE_APP_CONFIG: bundleAppConfig,
|
|
7814
7814
|
BUNDLE_JOBS: "4"
|
|
@@ -7842,13 +7842,13 @@ async function bundleInstall(bundlePath, bundleDir, gemfilePath, runtime) {
|
|
|
7842
7842
|
}
|
|
7843
7843
|
}
|
|
7844
7844
|
var version = 3;
|
|
7845
|
-
async
|
|
7845
|
+
var build = async ({
|
|
7846
7846
|
workPath,
|
|
7847
7847
|
files,
|
|
7848
7848
|
entrypoint,
|
|
7849
7849
|
config,
|
|
7850
7850
|
meta = {}
|
|
7851
|
-
}) {
|
|
7851
|
+
}) => {
|
|
7852
7852
|
await (0, import_build_utils2.download)(files, workPath, meta);
|
|
7853
7853
|
const entrypointFsDirname = (0, import_path2.join)(workPath, (0, import_path2.dirname)(entrypoint));
|
|
7854
7854
|
const gemfileName = "Gemfile";
|
|
@@ -7862,10 +7862,7 @@ async function build({
|
|
|
7862
7862
|
await (0, import_fs_extra.writeFile)(gemfilePath, `source "https://rubygems.org"${import_os.EOL}`);
|
|
7863
7863
|
}
|
|
7864
7864
|
const gemfileContents = gemfilePath ? await (0, import_fs_extra.readFile)(gemfilePath, "utf8") : "";
|
|
7865
|
-
const { gemHome, bundlerPath, vendorPath, runtime } = await installBundler(
|
|
7866
|
-
meta,
|
|
7867
|
-
gemfileContents
|
|
7868
|
-
);
|
|
7865
|
+
const { gemHome, bundlerPath, vendorPath, runtime, rubyPath } = await installBundler(meta, gemfileContents);
|
|
7869
7866
|
process.env.GEM_HOME = gemHome;
|
|
7870
7867
|
(0, import_build_utils2.debug)(`Checking existing vendor directory at "${vendorPath}"`);
|
|
7871
7868
|
const vendorDir = (0, import_path2.join)(workPath, vendorPath);
|
|
@@ -7896,7 +7893,13 @@ async function build({
|
|
|
7896
7893
|
if (meta.avoidTopLevelInstall && fileAtRoot) {
|
|
7897
7894
|
(0, import_build_utils2.debug)("Skipping `bundle install` \u2014 already handled by Install Command");
|
|
7898
7895
|
} else {
|
|
7899
|
-
await bundleInstall(
|
|
7896
|
+
await bundleInstall(
|
|
7897
|
+
bundlerPath,
|
|
7898
|
+
bundleDir,
|
|
7899
|
+
gemfilePath,
|
|
7900
|
+
rubyPath,
|
|
7901
|
+
runtime
|
|
7902
|
+
);
|
|
7900
7903
|
}
|
|
7901
7904
|
}
|
|
7902
7905
|
} else {
|
|
@@ -7915,11 +7918,10 @@ async function build({
|
|
|
7915
7918
|
userHandlerFilePath
|
|
7916
7919
|
);
|
|
7917
7920
|
const handlerRbFilename = "vc__handler__ruby";
|
|
7918
|
-
await (0, import_fs_extra.writeFile)(
|
|
7919
|
-
(0, import_path2.join)(workPath, `${handlerRbFilename}.rb`),
|
|
7920
|
-
nowHandlerRbContents
|
|
7921
|
-
);
|
|
7922
7921
|
const outputFiles = await (0, import_build_utils2.glob)("**", workPath);
|
|
7922
|
+
outputFiles[`${handlerRbFilename}.rb`] = new import_build_utils2.FileBlob({
|
|
7923
|
+
data: nowHandlerRbContents
|
|
7924
|
+
});
|
|
7923
7925
|
if (config && (config.includeFiles || config.excludeFiles)) {
|
|
7924
7926
|
const includedPaths = await matchPaths(config.includeFiles, workPath);
|
|
7925
7927
|
const excludedPaths = await matchPaths(
|
|
@@ -7939,14 +7941,14 @@ async function build({
|
|
|
7939
7941
|
delete outputFiles[excludedPaths[i]];
|
|
7940
7942
|
}
|
|
7941
7943
|
}
|
|
7942
|
-
const
|
|
7944
|
+
const output = new import_build_utils2.Lambda({
|
|
7943
7945
|
files: outputFiles,
|
|
7944
7946
|
handler: `${handlerRbFilename}.vc__handler`,
|
|
7945
7947
|
runtime,
|
|
7946
7948
|
environment: {}
|
|
7947
7949
|
});
|
|
7948
|
-
return { output
|
|
7949
|
-
}
|
|
7950
|
+
return { output };
|
|
7951
|
+
};
|
|
7950
7952
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7951
7953
|
0 && (module.exports = {
|
|
7952
7954
|
build,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/ruby",
|
|
3
3
|
"author": "Nathan Cahill <nathan@nathancahill.com>",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.5",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index",
|
|
7
7
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/ruby",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/fs-extra": "8.0.0",
|
|
19
19
|
"@types/semver": "6.0.0",
|
|
20
|
-
"@vercel/build-utils": "7.
|
|
20
|
+
"@vercel/build-utils": "7.5.1",
|
|
21
21
|
"execa": "2.0.4",
|
|
22
22
|
"fs-extra": "^7.0.1",
|
|
23
23
|
"jest-junit": "16.0.0",
|
package/vc_init.rb
CHANGED
|
@@ -81,6 +81,12 @@ def vc__handler(event:, context:)
|
|
|
81
81
|
payload = JSON.parse(event['body'])
|
|
82
82
|
path = payload['path']
|
|
83
83
|
headers = payload['headers']
|
|
84
|
+
|
|
85
|
+
if ENV['VERCEL_DEBUG']
|
|
86
|
+
puts 'Request Headers: '
|
|
87
|
+
puts headers
|
|
88
|
+
end
|
|
89
|
+
|
|
84
90
|
httpMethod = payload['method']
|
|
85
91
|
encoding = payload['encoding']
|
|
86
92
|
body = payload['body']
|