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

feat: export function to bundle edge functions #4271

Merged
merged 12 commits into from
May 4, 2022

Conversation

jackiewmacharia
Copy link
Contributor

@jackiewmacharia jackiewmacharia commented Apr 25, 2022

Summary

  • Exports a runCoreStep function to be used by CLI to bundle edge functions when ntl deploy is called without the --build flag so file changes still reflect.

Usage:

const runCoreStepPromise = import('@netlify/build')

const bundleEdgeFunctions = async (options) => {
  const { runCoreSteps } = await runCoreStepPromise
  await runCoreSteps(['edge_functions_bundling'], Object.assign(options, { buffer: true }))
}

For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)
cute animal

@jackiewmacharia jackiewmacharia added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Apr 25, 2022
@jackiewmacharia jackiewmacharia changed the title Export function to bundle edge functions feat: export function to bundle edge functions Apr 25, 2022
Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few suggestions, but this looks great in general.

We need some tests before we can merge this, though. I'm happy to help with those if you want!

packages/build/package.json Outdated Show resolved Hide resolved
packages/build/src/steps/run_core_step.js Outdated Show resolved Hide resolved
packages/build/src/steps/run_core_step.js Outdated Show resolved Hide resolved
packages/build/src/steps/run_core_step.js Outdated Show resolved Hide resolved
packages/build/src/steps/run_core_step.js Outdated Show resolved Hide resolved
packages/build/src/steps/run_core_step.js Outdated Show resolved Hide resolved
packages/build/src/steps/run_core_step.js Outdated Show resolved Hide resolved
packages/build/src/plugins_core/edge_functions/index.js Outdated Show resolved Hide resolved
packages/build/src/steps/run_core_step.js Outdated Show resolved Hide resolved
packages/build/src/steps/run_core_step.js Outdated Show resolved Hide resolved
@jackiewmacharia
Copy link
Contributor Author

I've resolved the comments and updated tests.

Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! I left a minor comment, but otherwise I think this is good to go.

packages/build/src/steps/run_core_steps.js Outdated Show resolved Hide resolved
Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 🔥 🔥

@jackiewmacharia jackiewmacharia merged commit 704438f into main May 4, 2022
@jackiewmacharia jackiewmacharia deleted the feat/export-function-to-bundle-edge-functions branch May 4, 2022 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants