Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

fix: only process function if runtime is NodeJS #1

Merged
merged 7 commits into from
Feb 23, 2020

Conversation

KingDarBoja
Copy link
Owner

This bugfix comes from two contributors which made two PRs at source repo: 196 and 197.

The former merged the changes from the later, making it easier to merge those PRs on this fork.

Sean Dawson and others added 7 commits January 28, 2020 17:58
- This change fixes an issue where serverless-plugin-typescript would
try to process functions that used different runtimes.
- Typescript functions will only run on node runtimes so it makes sense
to exclude functions on other runtimes from processing
This fixes issues with the mixed types of exports so other code (tests) can import TypeScriptPlugin.
- Merge in the changes that vectorjohn made in a parallel PR (filtering
functions at the plugin level)
- Use lodash's pickBy to simplify some logic
- Fix an issue with mixed export syntax (export vs module.exports)
- Removed redundant tests

Fixes #198
- Turns out `export default` is not the same as `modules.export = xyz`
- The actual equivilant is `export = xyz` with `esModuleInterop` enabled
- This is a better form than `modules.export = xyz` because we are able
to use the type system
- See: https://stackoverflow.com/questions/40294870/module-exports-vs-export-default-in-node-js-and-es6 and https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html#weeding-out-errors
@KingDarBoja KingDarBoja merged commit f4314bb into master Feb 23, 2020
@KingDarBoja KingDarBoja deleted the agiledigital/merge-master branch February 23, 2020 05:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant