pietroppeter / nimib

nimib 🐳 - nim 👑 driven ⛵ publishing ✍
https://pietroppeter.github.io/nimib/
MIT License
175 stars 10 forks source link

JsonParsingError when run #229

Closed lost22git closed 5 months ago

lost22git commented 5 months ago
import nimib

nbInit

nbCode:
  echo "hello nim"

nbSave
HugoGranstrom commented 5 months ago

I can't reproduce this error locally :thinking: Which version of nimble do you have?

lost22git commented 5 months ago

I can't reproduce this error locally 🤔 Which version of nimble do you have?

nimble v0.14.2 compiled at 2023-12-15 01:05:41

HugoGranstrom commented 5 months ago

Strange, me too :o

HugoGranstrom commented 5 months ago

From your error message, it seems like we both have nimib 0.3.9 and Nim 2.0.2

HugoGranstrom commented 5 months ago

Could you edit the file /root/.local/share/mise/installs/nim/2.0.2/nimble/pkgs2/nimib-0.3.9-aef1ca56d3e8ab84e7c34f5122d3e9f9bc39a8bf/nimib/config.nim and modify it to print the variable dumpedJson?

let dumpedJson = execProcess("nimble dump --json", dir) # line 9
echo "DUMPED JSON: ", dumpedJson # add this line
lost22git commented 5 months ago

/root/.local/share/mise/installs/nim/2.0.2/nimble/pkgs2/nimib-0.3.9-aef1ca56d3e8ab84e7c34f5122d3e9f9bc39a8bf/nimib/config.nim

{
  "name": "nimib",
  "version": "0.3.9",
  "author": "Pietro Peterlongo & Hugo Granström",
  "desc": "nimib 🐳 - nim 👑 driven ⛵ publishing ✍",
  "license": "MIT",
  "skipDirs": [],
  "skipFiles": [],
  "skipExt": [],
  "installDirs": [],
  "installFiles": [],
  "installExt": [],
  "requires": [
    {
      "name": "nim",
      "str": ">= 1.4.0",
      "ver": {
        "kind": "verEqLater",
        "ver": "1.4.0"
      }
    },
    {
      "name": "tempfile",
      "str": ">= 0.1.6",
      "ver": {
        "kind": "verEqLater",
        "ver": "0.1.6"
      }
    },
    {
      "name": "markdown",
      "str": ">= 0.8.1",
      "ver": {
        "kind": "verEqLater",
        "ver": "0.8.1"
      }
    },
    {
      "name": "mustache",
      "str": ">= 0.2.1",
      "ver": {
        "kind": "verEqLater",
        "ver": "0.2.1"
      }
    },
    {
      "name": "parsetoml",
      "str": ">= 0.7.0",
      "ver": {
        "kind": "verEqLater",
        "ver": "0.7.0"
      }
    },
    {
      "name": "jsony",
      "str": ">= 1.1.5",
      "ver": {
        "kind": "verEqLater",
        "ver": "1.1.5"
      }
    }
  ],
  "bin": [],
  "binDir": "",
  "srcDir": "src",
  "backend": "c"
}
HugoGranstrom commented 5 months ago

Thanks :D That looks exactly as it should...

HugoGranstrom commented 5 months ago

I'm at a loss what the problem could be sadly :/

lost22git commented 5 months ago

I'm at a loss what the problem could be sadly :/

My problem I'm loss something

completed version:

DUMPED JSON:       Info: Using the environment variable: NIMBLE_DIR='/root/.local/share/mise/installs/nim/2.0.
2/nimble'
{
  "name": "nimib",
  "version": "0.3.9",
  "author": "Pietro Peterlongo & Hugo Granström",
  "desc": "nimib 🐳 - nim 👑 driven ⛵ publishing ✍",
  "license": "MIT",
  "skipDirs": [],
  "skipFiles": [],
  "skipExt": [],
  "installDirs": [],
  "installFiles": [],
  "installExt": [],
  "requires": [
    {
      "name": "nim",
      "str": ">= 1.4.0",
      "ver": {
        "kind": "verEqLater",
        "ver": "1.4.0"
      }
    },
    {
      "name": "tempfile",
      "str": ">= 0.1.6",
      "ver": {
        "kind": "verEqLater",
        "ver": "0.1.6"
      }
    },
    {
      "name": "markdown",
      "str": ">= 0.8.1",
      "ver": {
        "kind": "verEqLater",
        "ver": "0.8.1"
      }
    },
    {
      "name": "mustache",
      "str": ">= 0.2.1",
      "ver": {
        "kind": "verEqLater",
        "ver": "0.2.1"
      }
    },
    {
      "name": "parsetoml",
      "str": ">= 0.7.0",
      "ver": {
        "kind": "verEqLater",
        "ver": "0.7.0"
      }
    },
    {
      "name": "jsony",
      "str": ">= 1.1.5",
      "ver": {
        "kind": "verEqLater",
        "ver": "1.1.5"
      }
    }
  ],
  "bin": [],
  "binDir": "",
  "srcDir": "src",
  "backend": "c"
}
HugoGranstrom commented 5 months ago

oh

HugoGranstrom commented 5 months ago

That's problematic. I don't have NIMBLE_DIR defined, so that's why I don't get the error. The question then is how we can suppress that message / filter it out

lost22git commented 5 months ago

That's problematic. I don't have NIMBLE_DIR defined, so that's why I don't get the error. The question then is how we can suppress that message / filter it out

i add --silent, and work now

      --silent                    Hide all Nimble and Nim output
HugoGranstrom commented 5 months ago

I can't seem to find any way to suppress it. Nimble automatically supresses warning but not Info when running dump :/. So I guess we have to filter it out then. Will have to think through this a bit to decide on which approach is the best.

lost22git commented 5 months ago

nimble dump --silent --json

HugoGranstrom commented 5 months ago

Oh that's fantastic :partying_face:

HugoGranstrom commented 5 months ago

WOuld you like to make a PR with this fix? :D

lost22git commented 5 months ago

WOuld you like to make a PR with this fix? :D

I'm not very familiar with this project,thanks ;-)

HugoGranstrom commented 5 months ago

It's not very complicated, you have already done the hard part, solving the bug. All you have to do is:

  1. Fork the repo
  2. Clone your fork
  3. Make the edit you just made locally
  4. Push the code to your fork
  5. Open a PR

That's all you need to know :D

lost22git commented 5 months ago

😉make PR here: https://github.com/pietroppeter/nimib/pull/230

HugoGranstrom commented 5 months ago

Awesome, thank you! 🤩 Once the tests have passed I will merge it and release a new version later today

HugoGranstrom commented 5 months ago

You should now be able to install nimib 0.3.10 and get your fix included :D Thanks again

pietroppeter commented 5 months ago

Thanks for working on this! indeed it was a known issue https://github.com/pietroppeter/nimib/issues/216