Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into bundle-preview-lo…
Browse files Browse the repository at this point in the history
…ader
  • Loading branch information
gatsbybot committed May 20, 2021
2 parents 71c4212 + 7f80988 commit 3320a9d
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 9 deletions.
3 changes: 3 additions & 0 deletions integration-tests/functions/src/api/extensions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import handler from "../lib/handler"

export default handler
3 changes: 3 additions & 0 deletions integration-tests/functions/src/lib/handler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function handler(req, res) {
return res.send(`hi`)
}
9 changes: 9 additions & 0 deletions integration-tests/functions/test-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,15 @@ export function runTests(env, host) {
})
})

describe(`typescript files are resolved without needing to specify their extension`, () => {
test(`typescript`, async () => {
const result = await fetch(`${host}/api/extensions`).then(res =>
res.text()
)
expect(result).toEqual(`hi`)
})
})

// TODO figure out why this gets into endless loops
// describe.only(`hot reloading`, () => {
// const fixturesDir = path.join(__dirname, `fixtures`)
Expand Down
4 changes: 4 additions & 0 deletions packages/gatsby-admin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [0.16.0-next.6](https://github.com/gatsbyjs/gatsby/compare/gatsby-admin@0.16.0-next.5...gatsby-admin@0.16.0-next.6) (2021-05-20)

**Note:** Version bump only for package gatsby-admin

# [0.16.0-next.5](https://github.com/gatsbyjs/gatsby/compare/gatsby-admin@0.16.0-next.4...gatsby-admin@0.16.0-next.5) (2021-05-19)

**Note:** Version bump only for package gatsby-admin
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby-admin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gatsby-admin",
"version": "0.16.0-next.5",
"version": "0.16.0-next.6",
"main": "index.js",
"author": "Max Stoiber",
"license": "MIT",
Expand All @@ -20,7 +20,7 @@
"@typescript-eslint/parser": "^4.14.2",
"csstype": "^2.6.14",
"formik": "^2.2.6",
"gatsby": "^3.6.0-next.5",
"gatsby": "^3.6.0-next.6",
"gatsby-interface": "^0.0.244",
"gatsby-plugin-typescript": "^3.6.0-next.0",
"gatsby-plugin-webfonts": "^1.1.4",
Expand Down
6 changes: 6 additions & 0 deletions packages/gatsby-plugin-gatsby-cloud/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.6.0-next.1](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-gatsby-cloud@2.6.0-next.0...gatsby-plugin-gatsby-cloud@2.6.0-next.1) (2021-05-20)

### Features

- **gatsby-plugin-gatsby-cloud:** enable preview status indicator and tooltip ([#31347](https://github.com/gatsbyjs/gatsby/issues/31347)) ([60a9898](https://github.com/gatsbyjs/gatsby/commit/60a98981056e47abf596bd713c466f64ad3281b8))

# [2.6.0-next.0](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-gatsby-cloud@2.5.0-next.1...gatsby-plugin-gatsby-cloud@2.6.0-next.0) (2021-05-06)

**Note:** Version bump only for package gatsby-plugin-gatsby-cloud
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-gatsby-cloud/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gatsby-plugin-gatsby-cloud",
"description": "A Gatsby plugin which optimizes working with Gatsby Cloud",
"version": "2.6.0-next.0",
"version": "2.6.0-next.1",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
Expand Down
6 changes: 6 additions & 0 deletions packages/gatsby-plugin-image/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.6.0-next.1](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-image@1.6.0-next.0...gatsby-plugin-image@1.6.0-next.1) (2021-05-20)

### Bug Fixes

- **gatsby-plugin-image:** Extra "margin" on CONSTRAINED ([#31497](https://github.com/gatsbyjs/gatsby/issues/31497)) ([5392cff](https://github.com/gatsbyjs/gatsby/commit/5392cffa6b433c5d26676693fb3961978893a2a0))

# [1.6.0-next.0](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-image@1.5.0-next.1...gatsby-plugin-image@1.6.0-next.0) (2021-05-06)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-image/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gatsby-plugin-image",
"version": "1.6.0-next.0",
"version": "1.6.0-next.1",
"scripts": {
"build": "npm-run-all -s clean -p build:*",
"build:gatsby-node": "tsc --jsx react --downlevelIteration true --skipLibCheck true --esModuleInterop true --outDir dist/ src/gatsby-node.ts src/babel-plugin-parse-static-images.ts src/resolver-utils.ts src/types.d.ts -d --declarationDir dist/src",
Expand Down
4 changes: 4 additions & 0 deletions packages/gatsby-plugin-sharp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.6.0-next.1](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-sharp@3.6.0-next.0...gatsby-plugin-sharp@3.6.0-next.1) (2021-05-20)

**Note:** Version bump only for package gatsby-plugin-sharp

# [3.6.0-next.0](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-sharp@3.5.0-next.2...gatsby-plugin-sharp@3.6.0-next.0) (2021-05-06)

**Note:** Version bump only for package gatsby-plugin-sharp
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby-plugin-sharp/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gatsby-plugin-sharp",
"description": "Wrapper of the Sharp image manipulation library for Gatsby plugins",
"version": "3.6.0-next.0",
"version": "3.6.0-next.1",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
Expand Down Expand Up @@ -34,7 +34,7 @@
"@types/sharp": "^0.27.1",
"babel-preset-gatsby-package": "^1.6.0-next.0",
"cross-env": "^7.0.3",
"gatsby-plugin-image": "^1.6.0-next.0",
"gatsby-plugin-image": "^1.6.0-next.1",
"gatsby-plugin-utils": "^1.6.0-next.0"
},
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-sharp#readme",
Expand Down
4 changes: 4 additions & 0 deletions packages/gatsby-transformer-sqip/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.6.0-next.1](https://github.com/gatsbyjs/gatsby/compare/gatsby-transformer-sqip@3.6.0-next.0...gatsby-transformer-sqip@3.6.0-next.1) (2021-05-20)

**Note:** Version bump only for package gatsby-transformer-sqip

# [3.6.0-next.0](https://github.com/gatsbyjs/gatsby/compare/gatsby-transformer-sqip@3.5.0-next.2...gatsby-transformer-sqip@3.6.0-next.0) (2021-05-06)

**Note:** Version bump only for package gatsby-transformer-sqip
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby-transformer-sqip/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "gatsby-transformer-sqip",
"description": "Generates geometric primitive version of images",
"version": "3.6.0-next.0",
"version": "3.6.0-next.1",
"author": "Benedikt Rötsch <roetsch.beni@gmail.com>",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
},
"dependencies": {
"@babel/runtime": "^7.12.5",
"fs-extra": "^8.1.0",
"gatsby-plugin-sharp": "^3.6.0-next.0",
"gatsby-plugin-sharp": "^3.6.0-next.1",
"md5-file": "^5.0.0",
"mini-svg-data-uri": "^1.2.3",
"p-queue": "^6.6.2",
Expand Down
7 changes: 7 additions & 0 deletions packages/gatsby/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.6.0-next.6](https://github.com/gatsbyjs/gatsby/compare/gatsby@3.6.0-next.5...gatsby@3.6.0-next.6) (2021-05-20)

### Features

- **gatsby:** enable webpack fs caching for functions ([#31505](https://github.com/gatsbyjs/gatsby/issues/31505)) ([4ff7dd3](https://github.com/gatsbyjs/gatsby/commit/4ff7dd36376ffa7581fe8b02a54a2a06e00bcaba))
- **gatsby:** Resolve typescript files in functions without needing to add the extension ([#31487](https://github.com/gatsbyjs/gatsby/issues/31487)) ([04f7a45](https://github.com/gatsbyjs/gatsby/commit/04f7a4562dc0b5922730d71acd3b157b7ad732b5))

# [3.6.0-next.5](https://github.com/gatsbyjs/gatsby/compare/gatsby@3.6.0-next.4...gatsby@3.6.0-next.5) (2021-05-19)

### Features
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gatsby",
"description": "Blazing fast modern site generator for React",
"version": "3.6.0-next.5",
"version": "3.6.0-next.6",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"bin": {
"gatsby": "./cli.js"
Expand Down
21 changes: 21 additions & 0 deletions packages/gatsby/src/internal-plugins/functions/gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ const createWebpackConfig = async ({
entries[compiledNameWithoutExtension] = functionObj.originalAbsoluteFilePath
})

const stage = isProductionEnv
? `functions-production`
: `functions-development`

const config = {
entry: entries,
output: {
Expand All @@ -237,6 +241,23 @@ const createWebpackConfig = async ({
minimize: false,
},

// Resolve files ending with .ts and the default extensions of .js, .json, .wasm
resolve: {
extensions: [`.ts`, `...`],
},

// Have webpack save its cache to the .cache/webpack directory
cache: {
type: `filesystem`,
name: stage,
cacheLocation: path.join(
siteDirectoryPath,
`.cache`,
`webpack`,
`stage-` + stage
),
},

mode: isProductionEnv ? `production` : `development`,
// watch: !isProductionEnv,
module: {
Expand Down

0 comments on commit 3320a9d

Please sign in to comment.