george43g / better-firebase-functions

This repo provides functionality for a better way of organising files, imports and function triggers in Firebase Cloud Functions
Mozilla Public License 2.0
179 stars 15 forks source link

fix(exportfunctions): deep directory case was broken #11

Closed sdemjanenko closed 2 years ago

sdemjanenko commented 4 years ago

When one has a folder structure such as:

When using the glob: **/*.func.[tj]s

The method that gets the function names would return

user-onCreate
db-posts
db-posts

This happened because the call to replace only replaces the first slash. Ideally we would use replaceAll but that isn't part of the JS spec yet.

viveknimkarde commented 3 years ago

Any update on this

ivan416 commented 3 years ago

@george43g any chance of merging this pull request? There is currently a big issue when using nested folder structure. better-firebase-functions is an amazing library and it will be even better if nested folder structure works as described in your article.

"Directories create dashed — submodules that are able to be deployed in groups, whereas filenames are converted into camelCase, following best practices for both function names and filenames at once."

https://medium.com/@george43g/organise-firebase-functions-part-1-optimize-cold-start-time-cd36f76d2133

ivan416 commented 3 years ago

I installed @sdemjanenko's fix branch in my project and can confirm that nested folders work properly.

npm install git://github.com/sdemjanenko/better-firebase-functions.git#fix_deep_directory_function_name --save
blasco commented 3 years ago

Could this be merged into the main branch?

hamishjohnson commented 2 years ago

@sdemjanenko would you be willing to maintain this in a separate git repo? I don't think this maintainer is willing to put time into this project and there are a couple other things - like the package depending on eslint-plugin-react that could be fixed

george43g commented 2 years ago

Hey, I’ve been meaning to update this but just flat out with work - is there a setting I can enable PRs to get merged by someone else?

On Fri, 29 Oct 2021 at 1:49 am, Hamish @.***> wrote:

@sdemjanenko https://github.com/sdemjanenko would you be willing to maintain this in a separate git repo? I don't think this maintainer is willing to put time into this project and there are a couple other things - like the package depending on eslint-plugin-react that could be fixed

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gramstr/better-firebase-functions/pull/11#issuecomment-953921706, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUEHPSZD7T52AO72VOC3PDUJFWJRANCNFSM4NY4JQWA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

george43g commented 2 years ago

I wasn’t able to find where to approve it. If you can post me a link that would be great

On Fri, 29 Oct 2021 at 1:51 am, George G @.***> wrote:

Hey, I’ve been meaning to update this but just flat out with work - is there a setting I can enable PRs to get merged by someone else?

On Fri, 29 Oct 2021 at 1:49 am, Hamish @.***> wrote:

@sdemjanenko https://github.com/sdemjanenko would you be willing to maintain this in a separate git repo? I don't think this maintainer is willing to put time into this project and there are a couple other things - like the package depending on eslint-plugin-react that could be fixed

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gramstr/better-firebase-functions/pull/11#issuecomment-953921706, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUEHPSZD7T52AO72VOC3PDUJFWJRANCNFSM4NY4JQWA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

blasco commented 2 years ago

thnx for the update

ntokozodev commented 2 years ago

@sdemjanenko would you be willing to maintain this in a separate git repo? I don't think this maintainer is willing to put time into this project and there are a couple other things - like the package depending on eslint-plugin-react that could be fixed

I discovered this tool few days ago and I am loving it but this issue which was raised more than a year ago kinder makes me hesitance, but if it can have more maintainers it would be good.

hamishjohnson commented 2 years ago

I installed @sdemjanenko's fix branch in my project and can confirm that nested folders work properly.

npm install git://github.com/sdemjanenko/better-firebase-functions.git#fix_deep_directory_function_name --save

for anyone interested btw we started having problems uploading this to firebase so we repackaged it as a .tgz file and linked to that instead https://classic.yarnpkg.com/en/docs/cli/pack

george43g commented 2 years ago

Hey team, better late than never - I've merged this one in.

george43g commented 2 years ago

:tada: This PR is included in version 4.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: