Skip to content

Commit

Permalink
Support AL2023 build image
Browse files Browse the repository at this point in the history
Closes #152.
  • Loading branch information
TooTallNate committed Apr 9, 2024
1 parent 7ca9a2a commit ea7ea28
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 27 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"@types/yauzl-promise": "^2.1.0",
"@typescript-eslint/eslint-plugin": "4.15.0",
"@typescript-eslint/parser": "4.15.0",
"@vercel/build-utils": "^5.2.0",
"@vercel/frameworks": "^0.2.0",
"@vercel/routing-utils": "^1.9.2",
"@vercel/build-utils": "^7.11.0",
"@vercel/frameworks": "^3.0.1",
"@vercel/routing-utils": "^3.1.0",
"eslint": "7.19.0",
"eslint-config-airbnb": "18.2.1",
"eslint-config-next": "11.1.2",
Expand Down
52 changes: 36 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/build.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { join } from 'path';
import { DenoLambda } from './deno-lambda';
import { BuildV3, download } from '@vercel/build-utils';
import { BuildV3, download, getProvidedRuntime } from '@vercel/build-utils';

export const build: BuildV3 = async ({
workPath,
Expand All @@ -19,5 +19,6 @@ export const build: BuildV3 = async ({
typeof includeFiles === 'string' ? [includeFiles] : includeFiles,
cacheDir: devCacheDir,
});
output.runtime = await getProvidedRuntime();
return { output };
};
14 changes: 7 additions & 7 deletions src/deno-lambda.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* The default version of Deno that will be downloaded at build-time.
*/
const DEFAULT_DENO_VERSION = 'v1.40.2';
const DEFAULT_DENO_VERSION = 'v1.42.1';

import { spawn } from 'child_process';
import { fileURLToPath, pathToFileURL } from 'url';
import { join, relative } from 'path';
import { spawn } from 'node:child_process';
import { fileURLToPath, pathToFileURL } from 'node:url';
import { join, relative } from 'node:path';
import {
chmodSync,
readFile,
Expand All @@ -15,8 +15,8 @@ import {
} from 'fs-extra';
import once from '@tootallnate/once';
import {
Env,
Files,
type Env,
type Files,
FileBlob,
FileFsRef,
Lambda,
Expand Down Expand Up @@ -117,7 +117,7 @@ export class DenoLambda extends Lambda {
delete args['--include-files'];

const argv = ['--allow-all', ...args];
console.log(`Caching imports…`);
console.log('Caching imports…');
console.log(`deno run ${argv.join(' ')} ${entrypoint}`);
const cp = spawn(
'deno',
Expand Down

0 comments on commit ea7ea28

Please sign in to comment.