August 18, 2022

On Monday, 15 August 2022 at 21:32:23 UTC, WebFreak001 wrote:

>

Hi all, I'm currently working on new revamped DUB documentation, check it out if you want, it currently contains most old documentation plus a big bunch of new documentation:

https://docs.webfreak.org/

Looks great!
What about the following idea about comments for dub.json: Allow the key "comment" inside the json file and alter DUB to remove all "comment" key value pairs at the beginning of parsing.
So the file is still valid json but comments are possible like in dub.sdl.

{
    "comment" : "dub.json can contain comments,too!",
    "name": "myproject",
    "description": "A little web service of mine.",
    "authors": ["Peter Parker", "John Doe"],
    "homepage": "http://myproject.example.com",
    "license": "GPL-2.0",
    "dependencies": {
        "vibe-d": "~>0.9.5"
    }
}
August 18, 2022
Am 18.08.2022 um 12:23 schrieb Bastiaan Veelo:
> ## Hacking on a local copy of a package
> 
> If your project depends on a package in which you have found a problem, or you would like to experiment with changes to it, you can force Dub to use a local copy of the package by following these steps:
> 
> 1. Fork the git repository
> 2. Check out a local clone at `/path/to/the_package`
> 3. Let Dub know about it:
>     `dub add-local /path/to/the_package`
> 4. Make Dub ignore any configured release tag, so you'll see the effect of current changes:
>     `dub add-override the_package * /path/to/the_package`
> 
> Now you can go ahead and play. Once your PR has been merged and released, or you want to revert to upstream, undo your changes by
> 
> 5. `dub remove-local /path/to/the_package`
> 6. `dub remove-override the_package *`

If have a branch checked out whose latest version tag matches the version selected by your main project, you can skip the `add-override` step, as dub will prefer a repository added with `add-local` over cached ones from the registry.

Also, using `add-path` on the parent directory allows you to clone and delete repositories at will, without having to use `add-local` and `remove-local` each time individually.

August 18, 2022

On Thursday, 18 August 2022 at 14:00:38 UTC, Martin Tschierschke wrote:

>

What about the following idea about comments for dub.json: Allow the key "comment" inside the json file and alter DUB to remove all "comment" key value pairs at the beginning of parsing.
So the file is still valid json but comments are possible like in dub.sdl.

{
    "comment" : "dub.json can contain comments,too!",
    "name": "myproject",
    "description": "A little web service of mine.",
    "authors": ["Peter Parker", "John Doe"],
    "homepage": "http://myproject.example.com",
    "license": "GPL-2.0",
    "dependencies": {
        "vibe-d": "~>0.9.5"
    }
}

That's already possible, as unrecognised items are ignored. This is however not flexible enough, as comments are not so much wanted for adding explanations but much more for commenting out specific parts. It does work sometimes: you can for example disable preBuildCommands by editing it to preBuildCommandsDISABLED. I don't think you can comment out a dependency this way, and you cannot comment out an item from an array like

{
    "preBuildCommands": [
        "step one",
        #"step two",
        "step three"
    ]
}

-- Bastiaan.

August 24, 2022

On Thursday, 18 August 2022 at 20:00:10 UTC, Bastiaan Veelo wrote:

>

That's already possible, as unrecognised items are ignored. This is however not flexible enough, as comments are not so much wanted for adding explanations but much more for commenting out specific parts. It does work sometimes: you can for example disable preBuildCommands by editing it to preBuildCommandsDISABLED. I don't think you can comment out a dependency this way, and you cannot comment out an item from an array like

{
    "preBuildCommands": [
        "step one",
        #"step two",
        "step three"
    ]
}

-- Bastiaan.
Ok, thank you, got it.

August 24, 2022

On Thursday, 18 August 2022 at 20:00:10 UTC, Bastiaan Veelo wrote:

>

That's already possible, as unrecognised items are ignored.

Actually, from next version, dub will start to warn you (in dub.json) about unknown keys. It does catch quite a lot of mistakes, see https://github.com/dlang/dub/pull/2280#issuecomment-1223326664

August 24, 2022

Just throwing an idea: may be dub can support yaml which has comments?

August 24, 2022

On Wednesday, 24 August 2022 at 10:31:55 UTC, Andrey Zherikov wrote:

>

Just throwing an idea: may be dub can support yaml which has comments?

The sdl format already supports that, which dub uses.

Json is supposed to be deprecated in dub, but obviously works for backwards compatibility.

https://sdlang.org/

1 2
Next ›   Last »