ndom91/snowpack-v1-init

Feature: convert current package to 'pika mode'

Closed this issue · 2 comments

Instead of generating a new directory and starter template, it would walk you through converting your package.json to pika mode.

@FredKSchott - First we would need to check all dependencies and make sure they're available as esmodules, right?

First thing that comes to mind, the flow could look like this:

  • checking packages for compatibility
  • either detect or ask user if pika/web or pika/pack type project
    • based on this answer the flow forks into two distinct set of questions / actions, but in general they both need to:
    • add / adjust npm scripts
    • add @pika/pack or @pika/web: webDependencies to package.json
    • add some more necessary dev dependencies, such as builders
    • add the 'pkg' or build dir to .gitignore

Now i'm sure I missed some steps there, but in general thats how I picture it.

Does that make sense? Is that about what you were picturing?

Yup, that's pretty much it. Thanks for filing the original issue and getting the discussion going.

I think the result of this "existing project mode" would only be to add config to your package.json file. So basically a logic flow roughly following:

> Welcome! How would you like to add to this existing project?
  - @pika/web -  Install npm dependencies to run directly in the browser, great for web apps.
  - @pika/pack - A package creator that takes care of configuration and compilation for you.

and then each of those would ask you some questions, like Select the dependencies you'd like installed to run in the browser (reads from your package.json "dependencies" object) or Select the environments you'd like your package to run in (select Node, web, etc. to create your @pika/pack pipeline for you).

This can be closed too, I think.

Would it still even make sense to use this bootstrapping tool to convert an existing project to use snowpack? I think thats more of a job for the pika editor or some other tool.