Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a default functions directory path #30277

Conversation

sidharthachatterjee
Copy link
Contributor

No description provided.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 16, 2021
@sidharthachatterjee sidharthachatterjee merged commit 1587dc2 into feat/functions Mar 17, 2021
@sidharthachatterjee sidharthachatterjee deleted the sid/ch26485/user-adds-an-api-directory-in-their-src-folder branch March 17, 2021 20:35
@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 22, 2021
KyleAMathews added a commit that referenced this pull request Apr 16, 2021
…ly and on Gatsby Cloud (#30192)

* Add new plugin

* Add functions plugin by default

* Add stub

* Bump up package.json

* wip

* Compile all functions found in build

* Add plugin by default only if GATSBY_EXPERIMENT_FUNCTIONS is set

* Move to public for now

* Move to functions dir

* Run a dev server for functions

* wip

* Move to onPreBootstrap

* Add target node

* Bump up package.json

* Bump up package.json

* Add support for env vars

* Publish 0.1.0-4

* Bump up peerDependencies

* Update yarn lock

* Use a parameter in express middleware and ignore extension (#30222)

* Publish 0.1.0-6

* Set a default functions directory path (#30277)

* feat(functions): Add body parser

* Require files from the .cache directory so user can run es/commonjs (#30338)

* Require files from the .cache directory so user can run es/commonjs

* Panic on build if we get an error

* Add some logging via reporter

* logging to func

* Update packages/gatsby-plugin-functions/src/gatsby-node.ts

Co-authored-by: Ward Peeters <ward@coding-tech.com>

* Function name does not include extension

* Print a relative path to the functions directory

Co-authored-by: Sidhartha Chatterjee <me@sidharthachatterjee.com>
Co-authored-by: Ward Peeters <ward@coding-tech.com>

* Publish 0.1.0-7

* Prefer directory from program in state

* Log invocations as verbose

* Add timeout constant

* Add internal plugin

* Load functions internal plugin

* Load functions during initialize and stick em in redux

* Clean up comments

* Move initialization code back to plugin

* Add experiment for Gatsby Functions

* Revert yarn changes

* Remove plugin package

* Do not extract comments

* Update yarn.lock

* Update packages/gatsby/src/internal-plugins/functions/gatsby-node.ts

Co-authored-by: Lennart <lekoarts@gmail.com>

* chore(functions): Remove console.logs

* chore(functions): Remove unused urlResolve import

* get internal plugin functions working + some cleanups

* Fix regex per @jamo's suggestion + update yarn.lock

* remove accidentally committed file

* globby isn't a dependency of gatsby

* fix(functions): End request with status 500 on function error

* Hot reload functions

* Load env variables from .env.* files

* Resolve result of function so we can catch errors from async functions

* Log webpack warnings/errors when compiling to the terminal

* Log how long function took to execute

* reload watch when .env files change & use all process.env vars

* Allow for arbitrarily deep functions

* Detect new functions and incorporate

* Log when functions rebuild or we restart the watcher

* List functions on dev-404-page

* Only show new API instructions when trying to reach an API route + add example

* Fix linting

* put new code behind conditional

* Properly close webpack watcher + handle deleting functions

* Ignore non-js extensions (so make typescript work)

* Write out manifest file so can serve functions from 'gatsby serve'

* Address @lekoart's comments

* Add default type for SiteFunction & fix small bugs when site doesn't yet have functions

* Add initial suite of tests

* Update snapshots

* Fix more tests

* Add functions tests to circleci setup

* Only parse once

* Small tweaks

* add comment

* Fix typescript support

* Add tests for apis with special characters h/t @LekoArts

Co-authored-by: abhiaiyer91 <abhiaiyer91@gmail.com>
Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
Co-authored-by: Julien Poissonnier <julien@caffeine.lu>
Co-authored-by: Ward Peeters <ward@coding-tech.com>
Co-authored-by: Lennart <lekoarts@gmail.com>
Co-authored-by: Kyle Mathews <mathews.kyle@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants