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

Make next major release: ps-0.12.x-v0.12.0 #291

Merged
merged 187 commits into from
Mar 28, 2019
Merged

Conversation

JordanMartinez
Copy link
Owner

@JordanMartinez JordanMartinez commented Mar 7, 2019

This is a bigger release with a number of breaking changes.

As of this release, we're now using Spago for our build tool and package manager, mainly because it eases the maintenance I would otherwise have to do.

Migrating

For things to work properly, there are 4 things you will need to do:

  • install spago, dhall-to-json, and parcel via these installation instructions
  • update the ide-purescript Atom package to the latest one to expose the additional spago option
  • configure ide-purescript to build projects via spago by following the instructions listed in the second 'numbered list' here
  • run the for-each-folder--install-deps-and-compile.sh, which will delete the old psc-package and pulp contents and build using spago

#303 needed to be added after this PR to account for the newer spago update.

Breaking Changes

New Content

Bugs Fixed

  • The following bugs were fixed. It seems my TOC program's parser had a bug in it and I seemed to have missed it beforehand or had a specific structure that did not trigger the bug. I'm not too surprised by that because I didn't have any tests written for it since I was trying to push something out before refining it further. In the process, I also discovered a bug in purescript-tree (see bottom part of this PR for more context).

Other changes related to this project on a "meta" level:

  • This repo sometimes used the folder names "images" and "resources" to refer to a folder that stored images or .graphml files to produce diagrams. I decided to rename all of those folders to assets instead and adhere to that naming convention.

@JordanMartinez
Copy link
Owner Author

Wow.... So, after many hours of trying to track down what's the bug that stops the ToC program from properly indenting the headers correctly, it seems there is a bug in purescript-tree:

module TreeBug where

import Prelude

import Control.Comonad.Cofree ((:<))
import Data.List (List(..), (:))
import Data.Maybe (maybe)
import Data.Tree (Tree, drawTree)
import Data.Tree.Zipper (down, fromTree, insertAfter, lastChild, next, toTree)
import Effect (Effect)
import Effect.Console (log)

-- Given a tree like so...
tree1 :: Tree String
tree1 =
  "a" :< ( ("b" :< Nil)
         : ("c" :< ( ("f" :< Nil)
                   : ("g" :< Nil)
                   : ("h" :< Nil)
                   : Nil ))
         : Nil
         )

main :: Effect Unit
main = do
  let loc = fromTree tree1

  -- 'f' and 'b' gets deleted when I use 'insertAfter'
  -- using 'lastChild' to get to that node
  log $ maybe "" (drawTree <<< toTree) do
    c <- lastChild loc
    f <- lastChild c

    let result = insertAfter ("z" :< Nil) f
    pure $ result

  log "========="

  -- 'f' and 'b' are not deleted when I use 'insertAfter'
  -- using a correct combination of 'down' and 'next' to get to the same node
  log $ maybe "" (drawTree <<< toTree) do
    b <- down loc
    c <- next b
    f <- down c

    let result = insertAfter ("z" :< Nil) f
    pure $ result

which outputs this:

a
|----> c
       |----> g
       |----> h
       |----> z

=========
a
|----> b
|----> c
       |----> f
       |----> z
       |----> g
       |----> h

Long story short, my parser was not correctly nesting markdown headers because I wasn't calling root at one part. I'm not sure whether this was something I missed earlier or something else. When I fixed it, I thought that solved the issue. Then, I learned that insertAfter doesn't work correctly. After more investigation, I saw that something was unexpectedly getting deleted and reproduced the following reproducible example when I investigated the tests of the library.

- I'm still figuring out the best way to handle the ToC generation since 
it should work on tags, not branches
@JordanMartinez
Copy link
Owner Author

Ok. This release is ready. I just need to see whether CI passes or will also have issues.

@JordanMartinez
Copy link
Owner Author

The build passed but there's been some screwy things going on since it triggered 3 builds and cancelled 2 of them. So I guess GH didn't get the message or something.

@JordanMartinez JordanMartinez merged commit 932d438 into latestRelease Mar 28, 2019
@JordanMartinez
Copy link
Owner Author

The next tag has been pushed, but I'm not officially making a release yet. I need to update the PR's opening text to summarize all the changes I've done here as there are quite a lot.

I'll get to that on another day.

@JordanMartinez
Copy link
Owner Author

Ok. This PR's summary has been updated.

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