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

Add serverless create template #137

Closed
franciscocpg opened this issue Jun 30, 2017 · 23 comments
Closed

Add serverless create template #137

franciscocpg opened this issue Jun 30, 2017 · 23 comments
Assignees

Comments

@franciscocpg
Copy link
Member

In the future we could add a template here so that new serverless projects can be created with webpack already configured.

@HyperBrain
Copy link
Member

Wow. Nice idea 🙌 . That would make the project creation really easy.
Can you create an issue in the serverless core repo and link it here, so that we can track it properly?

Then we can work and comment on a PR there - that one of us (maybe you 😄 ) initially created to get a nice template in there.

@franciscocpg
Copy link
Member Author

Yes @HyperBrain
I just want to focus on #130 before because IMO it will have some influence here.

@HyperBrain
Copy link
Member

@franciscocpg 2.1.0 is out now! Maybe you can proceed here as soon as you have some time.

@franciscocpg
Copy link
Member Author

Sure @HyperBrain
I'm thinking about using examples/babel-multiple-statically-entries as our "model" (with some changes, of course) to create a new template called aws-nodejs-ecma-script (need suggestions for name) based on templates/aws-nodejs.
That's because IMO the main reason to use serverless-webpack is enabling ecma-script code style.

@franciscocpg
Copy link
Member Author

Oh and maybe we need to add a aws-nodejs-typescript using examples/typescript as our model?

@HyperBrain
Copy link
Member

HyperBrain commented Jul 27, 2017

... and #167 will remove the extension from the entry key names in lib.entries, so that [name].js has to be used as output. We should take that into account. There was a problem with typescript support ( #165 ) that will be solved there by determining the correct handler filenames. I try to release these fixes as 2.2.0 as soon as the implementations are stable.

@HyperBrain
Copy link
Member

see also the discussion in #158

@franciscocpg
Copy link
Member Author

So I think it's better wait for 2.2.0.

@HyperBrain
Copy link
Member

2.2.0 is out. Had to be that fast, because of the TypeScript issue with the entries export 😃 .

You can proceed here now.

@HyperBrain
Copy link
Member

I agree that there should be more than one template - the multi-static and the typescript.

We can add one that is missing later: the multi-dynamic, as soon as it is proven that the entries detection works properly now. Imo the dynamic template(s) should be the preferred ones in the future.

@franciscocpg
Copy link
Member Author

franciscocpg commented Aug 2, 2017

@HyperBrain
So how I about creating these two first templates (name / example model)
aws-nodejs-ecma-script / examples/babel-dynamically-entries
aws-nodejs-typescript / examples/typescript.
IMO these two are the ones that add more value to the serverless community that wants to use ES or typescript with serverless framework.

@HyperBrain
Copy link
Member

HyperBrain commented Aug 2, 2017

I would use the dynamic sample. Imo this is the preferred way now to configure the plugin/webpack in an easy and safe way. Much easier than finding out and adding new entries or removing stale ones when you add or remove functions. The manual configuration is very error-prone, especially when it comes to individual packaging and optimization in V3, which works like a charm with lib.entries.

But yes, ES and TS should be the choice for them.

@franciscocpg
Copy link
Member Author

Ops, I've put the wrong example.
I've edited the #137 (comment)
So those two ones?

@HyperBrain
Copy link
Member

HyperBrain commented Aug 2, 2017

I would prefer babel-dynamically-entries. Both samples TS and ES should use lib.entries for the entry definition.

@HyperBrain
Copy link
Member

Oh. did not refresh 😄 ... yes, right

@franciscocpg
Copy link
Member Author

👍
WIP

@HyperBrain
Copy link
Member

BTW: The lib extensions are really a great thing - did you see that I extended it with lib.serverless and lib.options in the 2.2.0 release? Now you can have stage dependent configurations with only one webpack.conf.js.

@franciscocpg
Copy link
Member Author

franciscocpg commented Aug 3, 2017

@HyperBrain
Just opened #179 to upgrade examples.
Next steps are:

@HyperBrain
Copy link
Member

I already merged #179 . It would be great if you open proper issues at SLS and link them here.

@franciscocpg
Copy link
Member Author

franciscocpg commented Aug 3, 2017

👍
Leave it to me

@franciscocpg
Copy link
Member Author

Adding aws-nodejs-ecma-script template: serverless/serverless#4056
Adding aws-nodejs-typescript template: serverless/serverless#4058

@franciscocpg
Copy link
Member Author

franciscocpg commented Aug 21, 2017

@HyperBrain
Both PRs are merged.
Should we close this issue right now?

@HyperBrain
Copy link
Member

HyperBrain commented Aug 21, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants