From 7e3349c87a2d32d0e7c6237a56b901c2d3e0a870 Mon Sep 17 00:00:00 2001 From: Angel Mendez Date: Thu, 7 Dec 2023 22:28:53 -0600 Subject: [PATCH 1/3] refactor: replace got with node-fetch on hugo.test.ts (#6247) * refactor: replace got with node-fetch on hugo.test.ts related to #5695 * refactor: replace got with node-fetch on hugo.test.ts related to #5695 --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- tests/integration/frameworks/hugo.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/frameworks/hugo.test.ts b/tests/integration/frameworks/hugo.test.ts index 9990ea3060b..61ec0d9dec7 100644 --- a/tests/integration/frameworks/hugo.test.ts +++ b/tests/integration/frameworks/hugo.test.ts @@ -1,11 +1,11 @@ import { expect, test } from 'vitest' import { FixtureTestContext, setupFixtureTests } from '../utils/fixture.js' -import got from '../utils/got.js' +import fetch from 'node-fetch' setupFixtureTests('hugo-site', { devServer: true }, () => { test('should not infinite redirect when -d flag is passed', async ({ devServer: { url } }) => { - const response = await got(`${url}/`).text() + const response = await fetch(`${url}/`).then((res) => res.text()) expect(response).toContain('Home page!') }) From 8308097334fc76117cee4798772abf18ff5a7e4d Mon Sep 17 00:00:00 2001 From: Edd Date: Fri, 8 Dec 2023 12:29:23 +0000 Subject: [PATCH 2/3] fix: use correct file extensions for transpilation (#6256) * fix: use correct file extensions for transpilation * chore: remove test function file rename * chore: fix function args test --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- src/lib/functions/netlify-function.ts | 2 +- src/lib/functions/runtimes/js/builders/zisi.ts | 2 +- tests/integration/commands/deploy/deploy.test.js | 2 +- .../commands/functions-with-args/functions-with-args.test.js | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/functions/netlify-function.ts b/src/lib/functions/netlify-function.ts index 8acd316709c..f4f55501771 100644 --- a/src/lib/functions/netlify-function.ts +++ b/src/lib/functions/netlify-function.ts @@ -121,7 +121,7 @@ export default class NetlifyFunction { } if (extension === '.js') { - return '.js' + return '.mjs' } } diff --git a/src/lib/functions/runtimes/js/builders/zisi.ts b/src/lib/functions/runtimes/js/builders/zisi.ts index e85de6f0429..1d08ab35112 100644 --- a/src/lib/functions/runtimes/js/builders/zisi.ts +++ b/src/lib/functions/runtimes/js/builders/zisi.ts @@ -175,7 +175,7 @@ export default async function handler({ config, directory, errorExit, func, meta featureFlags.zisi_pure_esm_mjs = true } else { // We must use esbuild for certain file extensions. - const mustTranspile = ['.js', '.ts', '.mts', '.cts'].includes(path.extname(func.mainFile)) + const mustTranspile = ['.mjs', '.ts', '.mts', '.cts'].includes(path.extname(func.mainFile)) const mustUseEsbuild = hasTypeModule || mustTranspile if (mustUseEsbuild && !functionsConfig['*'].nodeBundler) { diff --git a/tests/integration/commands/deploy/deploy.test.js b/tests/integration/commands/deploy/deploy.test.js index 4460d6eef80..0bdfbd110c4 100644 --- a/tests/integration/commands/deploy/deploy.test.js +++ b/tests/integration/commands/deploy/deploy.test.js @@ -495,7 +495,7 @@ describe.skipIf(process.env.NETLIFY_TEST_DISABLE_LIVE === 'true').concurrent('co export default async () => new Response("Internal V2 API") export const config = { path: "/internal-v2-func" } `, - path: '.netlify/functions-internal/func-4.js', + path: '.netlify/functions-internal/func-4.mjs', }) .buildAsync() diff --git a/tests/integration/commands/functions-with-args/functions-with-args.test.js b/tests/integration/commands/functions-with-args/functions-with-args.test.js index 84fed497917..ed430628f8f 100644 --- a/tests/integration/commands/functions-with-args/functions-with-args.test.js +++ b/tests/integration/commands/functions-with-args/functions-with-args.test.js @@ -610,7 +610,7 @@ exports.handler = async () => ({ }) }) - test('Serves functions with a `.js` extension', async (t) => { + test('Serves functions with a `.mjs` extension', async (t) => { await withSiteBuilder('function-mjs', async (builder) => { const bundlerConfig = args.includes('esbuild') ? { node_bundler: 'esbuild' } : {} @@ -623,7 +623,7 @@ exports.handler = async () => ({ }, }) .withContentFile({ - path: 'functions/hello.js', + path: 'functions/hello.mjs', content: ` const handler = async () => { return { From 3f37b8e6b99b4fe93b82d41c6aaa6629f92b6d27 Mon Sep 17 00:00:00 2001 From: "token-generator-app[bot]" <82042599+token-generator-app[bot]@users.noreply.github.com> Date: Fri, 8 Dec 2023 12:47:00 +0000 Subject: [PATCH 3/3] chore(main): release 17.10.1 (#6258) Co-authored-by: token-generator-app[bot] <82042599+token-generator-app[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7efc47be4df..277f62a51b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +## [17.10.1](https://github.com/netlify/cli/compare/v17.10.0...v17.10.1) (2023-12-08) + + +### Bug Fixes + +* use correct file extensions for transpilation ([#6256](https://github.com/netlify/cli/issues/6256)) ([8308097](https://github.com/netlify/cli/commit/8308097334fc76117cee4798772abf18ff5a7e4d)) + ## [17.10.0](https://github.com/netlify/cli/compare/v17.9.0...v17.10.0) (2023-12-06) diff --git a/package-lock.json b/package-lock.json index 899c453f3d4..ee3ede96d94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "netlify-cli", - "version": "17.10.0", + "version": "17.10.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "netlify-cli", - "version": "17.10.0", + "version": "17.10.1", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index e1e18e7ac58..3fbe9eaffe0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "netlify-cli", "description": "Netlify command line tool", - "version": "17.10.0", + "version": "17.10.1", "author": "Netlify Inc.", "type": "module", "engines": {