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

spago init template based on Spec #1264

Closed
wants to merge 13 commits into from

Conversation

fsoikin
Copy link
Collaborator

@fsoikin fsoikin commented Aug 10, 2024

Description of the change

It occurred to me that, since we're recommending spec-node in the docs now, it would make sense to include it in the spago init template. So the user doesn't have to jump through extra hoops.

I understand this may not be 100% desirable because it introduced extra moving parts. Feel free to throw away. Just an idea.

Checklist:

  • Added the change to the "Unreleased" section of the changelog
  • [ ] Added some example of the new feature to the README
  • Added a test for the contribution (if applicable)

Copy link
Member

@f-f f-f left a comment

Choose a reason for hiding this comment

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

Ah yeah, this makes sense!

@@ -26,7 +26,7 @@ import Spago.Command.Init as Init
import Spago.Core.Config (Dependencies(..), Config)
import Spago.Core.Config as Config
import Spago.FS as FS
import Spago.Prelude as X
import Spago.Prelude (class Applicative, class Apply, class Bind, class BooleanAlgebra, class Bounded, class Category, class CommutativeRing, class Discard, class DivisionRing, class Eq, class EuclideanRing, class Field, class Functor, class Generic, class HeytingAlgebra, class Monad, class MonadAff, class MonadEffect, class MonadError, class MonadThrow, class Monoid, class Newtype, class Ord, class Ring, class Semigroup, class Semigroupoid, class Semiring, class Show, type (~>), Aff, Buffer, Docc, Effect, Either(..), Encoding(..), Error, Except, FilePath, HexString(..), Identity(..), Instant, License, List, Location, LogEnv, LogOptions, Manifest(..), ManifestIndex, Map, Maybe(..), Metadata(..), NonEmptyArray, OnlineStatus(..), Ordering(..), OutputFormat(..), PackageName, Range, Ref, Set, Sha256, Spago(..), StateT, Tuple(..), Unit, Version, Void, YamlDoc, absurd, add, and, ap, append, apply, ask, asks, between, bimap, bind, bottom, catchError, clamp, compare, comparing, compose, conj, const, degree, die, die', discard, disj, div, either, eq, except, flap, flip, foldMap, foldl, for, forWithIndex, for_, fromMaybe, fst, gcd, genericShow, hush, identity, ifM, indent, indent2, isJust, isLeft, isNothing, isPrefix, isRight, join, justOrDieWith, justOrDieWith', lcm, liftA1, liftAff, liftEffect, liftM1, lmap, local, logDebug, logError, logInfo, logSuccess, logWarn, map, max, maybe, mempty, min, mkTemp, mkTemp', mod, mul, negate, not, notEq, on, one, or, otherwise, output, parTraverseSpago, parallelise, parseJson, parseLenientVersion, parseUrl, parseYaml, partition, partitionEithers, partitionMap, printJson, printYaml, pure, recip, rightOrDieWith, rightOrDieWith', rmap, runSpago, shaToHex, show, snd, sub, toDoc, top, traverse, try, typoSuggestions, unit, unless, unlessM, unsafeFromJust, unsafeFromRight, unsafeLog, unsafeStringify, unsafeThrow, unwrap, void, when, whenM, withBackoff', withForwardSlashes, zero, (#), ($), ($>), (&&), (*), (*>), (+), (-), (..), (/), (/=), (/\), (:), (<), (<#>), (<$), (<$>), (<*), (<*>), (<<<), (<=), (<=<), (<>), (<@>), (<|>), (=<<), (==), (>), (>=), (>=>), (>>=), (>>>), (||)) as X
Copy link
Member

Choose a reason for hiding this comment

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

Can we rollback this line? It's just confusing to have this huge import like this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh yeah, sorry, that's accidental, from IDE support.

@f-f
Copy link
Member

f-f commented Aug 16, 2024

I think this is a good change, but after all the updates to the tests the CI times have ballooned - they are now 2x slower than the current trunk.

That's a bit of a deal breaker, so let's think about an alternative approach; the no-hassle one is to add some --no-tests flag to spago init, to skip the spec-node addition and use the current setup - we could then use this flag for most of the tests, and only add the new testing setup to a few of them, while still keeping it as the default for spago.
However, that would not be extensible. A more general approach could be to introduce templates for spago init - then we could have a basic template that would contain the bare minimum (basically as it is now), and a default template that would add spec-node. This would open the door to more complex things, e.g. a halogen template, and so on.
Does this make any sense?

@fsoikin
Copy link
Collaborator Author

fsoikin commented Aug 16, 2024

Yes, I agree, this became quite unmanageable. I was hoping it would literally just be changing the template, but it turns out all the tests depend on it, and it's quite a ball of yarn.

I do like the idea of multiple templates. Other tools have similar things (e.g. dotnet) and they're very popular. But I don't think it is critical for the current milestone. So I guess we should just table this change. Or throw it away altogether.

@f-f
Copy link
Member

f-f commented Aug 17, 2024

Yeah let's not move forward with this as is, and I agree with you that it's not critical for the current milestone. I have reopened #573 to track this effort.

@f-f f-f closed this Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants