Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

feat: add in-source-config detection to listFunctions #899

Merged
merged 17 commits into from
Dec 21, 2021

Conversation

netlify-team-account-1
Copy link
Contributor

@netlify-team-account-1 netlify-team-account-1 commented Dec 20, 2021

- Summary

As discussed on Friday, this PR adds ISC to listFunctions (8537a80...11e7c92). It also adds a listFunction (singular) version (11e7c92...402c013).

- Test plan

Tests added.

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

@netlify-team-account-1 netlify-team-account-1 added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Dec 20, 2021
@netlify-team-account-1
Copy link
Contributor Author

pre-released to https://www.npmjs.com/package/@netlify/zip-it-and-ship-it/v/5.4.0-isc-listfunctions to continue work on the CLI

src/runtimes/go/index.ts Outdated Show resolved Hide resolved
src/main.ts Outdated Show resolved Hide resolved
src/runtimes/index.ts Show resolved Hide resolved
src/runtimes/node/finder.ts Outdated Show resolved Hide resolved
src/runtimes/node/finder.ts Outdated Show resolved Hide resolved
src/runtimes/runtime.ts Outdated Show resolved Hide resolved
src/function.ts Outdated Show resolved Hide resolved
src/main.ts Show resolved Hide resolved
parseISC?: boolean
}

interface AugmentedFunctionSource extends FunctionSource {
Copy link
Member

Choose a reason for hiding this comment

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

[dust] Currently, this type only differs from FunctionSource in that it also includes ISC. Are you thinking it may be used in the future for other things? If we introduce new options to listFunctions, would that not be under a different conditional check than parseISC? And if so, do you think this should be called something like FunctionSourceWithISC?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the AugmentedFunctionSource type is really the input type to getListedFunction. it's FunctionSource + whatever may need to be added to assemble the return value of listFunctions and listFunction. If there was a new flag, let's say enablePartyMode, then we can extend AugmentedFunctionSource to have an partyModeResult?: Parteyyy property, and getListedFunction could use that to assemble the return value.

src/main.ts Outdated Show resolved Hide resolved
Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com>
Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com>
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.

🚀

@kodiakhq kodiakhq bot merged commit 0703934 into main Dec 21, 2021
@kodiakhq kodiakhq bot deleted the isc-on-listfunctions branch December 21, 2021 10:09
Skn0tt pushed a commit to netlify/build that referenced this pull request May 21, 2024
…-and-ship-it#899)

* feat: schedule property to listFunctions result

(currently only based on config that's passed in)

* feat: include schedule in listFunctionsFiles and fix remaining tests

* feat: run ISC on listFunctions

* chore: add test for isc + listFunctionsFiles

* feat: add rough implementation of listFunction

* refactor: only parse one file for listFunction

* refactor: use same runtime order across implementations

* refactor: extract fscache comment

* feat: add getFunctionAtPath implementation to other runtimes

* refactor: conform node runtime to types

* refactor: only parse ISC conditionally

* refactor: rename parameter

* refactor: rename to findFunctionInPath

* fix: please prettier

* chore: make comment more precise

Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com>

* chore: add comment about ISC condition

Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com>

Co-authored-by: Netlify Team Account 1 <netlify-team-account-1@users.noreply.github.com>
Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge 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.

Return schedule from listFunctions
2 participants