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

Migrate Bower projects when doing `init` #159

Closed
antislava opened this issue Mar 26, 2019 · 1 comment

Comments

@antislava
Copy link

commented Mar 26, 2019

It would probably be nice to be able to have the dependency list as an optional input parameter to spago init, especially when working with existing packages based on bower. I suspect this is somehow related to #24 but I wasn't sure about the main focus there (most links there refer to no longer existing pages, e.g. from-bower scripts). Alternatively, one could optionally, define dependencies list in separate file spago-dependencies.json (which, being a simple list of strings, would also be a valid dhall file imported by spago.dhall). This file could be generated or overwritten by a simple script (probably, as a temporary solution before deciding whether to integrate the dependency import functionality deeper into the spago tool or not - most likely, it should remain a separate command/script keeping in mind the principle of separation of concerns), e.g.

jq '(.dependencies? | keys? // []) + (.devDependencies? | keys? // []) | map(ltrimstr("purescript-"))' ./bower.json > spago-dependencies.json
cat spago.dhall

{ name =
    "package-name"
, dependencies =
    ./spago-dependencies.json
, packages =
    ./packages.dhall
}
@f-f

This comment has been minimized.

Copy link
Member

commented Mar 26, 2019

Hi @antislava! This is a good analysis, and I think it'd be worth adding your script to a FAQ section "Migrating from bower"

The next step after documenting this would be to automatically migrate a bower project when finding one. We do already migrate psc-package projects automatically in spago init, and I think it would be good to also support bower.json migration in the same way (that is, I don't think we should be able to provide options to init, as it should just detect the bowerfile)

I probably won't manage to do this myself as I'm concentrating on other things on the road to 1.0 (because your script does the job pretty well already), so I'll mark this as "help wanted" and I'm available to provide support, answer questions and give pointers if someone wants to implement this 🙂 (this is valid also for #24, which is about importing bower dependencies as additions in your local package set)

@f-f f-f changed the title Additional init options Migrate Bower projects when doing `init` Mar 26, 2019

@f-f f-f added this to the 1.0 milestone May 6, 2019

@jonathanlking jonathanlking referenced this issue Jun 16, 2019
0 of 3 tasks complete

@f-f f-f added the in progress label Jun 21, 2019

@f-f f-f referenced this issue Jul 29, 2019
2 of 2 tasks complete

@f-f f-f closed this in #342 Jul 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.