Skip to content

Commit

Permalink
Merge branch 'main' into refactor/replace-got/server.test.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hereje authored Dec 9, 2023
2 parents 7b79162 + 3f37b8e commit 3296917
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/functions/netlify-function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default class NetlifyFunction {
}

if (extension === '.js') {
return '.js'
return '.mjs'
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/functions/runtimes/js/builders/zisi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/commands/deploy/deploy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' } : {}

Expand All @@ -623,7 +623,7 @@ exports.handler = async () => ({
},
})
.withContentFile({
path: 'functions/hello.js',
path: 'functions/hello.mjs',
content: `
const handler = async () => {
return {
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/frameworks/hugo.test.ts
Original file line number Diff line number Diff line change
@@ -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<FixtureTestContext>('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!')
})
Expand Down

0 comments on commit 3296917

Please sign in to comment.