There are use cases for 1) "Daggerizing" a project with a Dagger CI implementation and 2) creating a module as a reusable component.
The result of the change decided here (#daggernauts message) for use case 1 may have an impact on use case 2. It seems probable that many would end up on a path where the module they create for Daggerverse going forward will have a dagger.json at the root with a dagger/ subdir with the module implementation unless they explicitly specify --source pointing to same dir as dagger.json.
path A
dagger init mymod # creates mymod dir
cd mymod
dagger develop --sdk python # creates dagger subdir
path B
mkdir mymod
cd mymod
dagger init --name mymod --sdk python # creates dagger subdir
.
โโโ dagger
โย ย โโโ pyproject.toml
โย ย โโโ sdk
โย ย โโโ src
โโโ dagger.json
dagger.json:
{
"name": "mymod",
"sdk": "python",
"source": "dagger",
"engineVersion": "v0.9.9"
}
So the flatter style (used up til now), (more appropriate for publishing component/utility modules?) with the module implementation at same level of dagger.json would require someone to always specify --source dir as same dir where dagger.json lives. Though it seems that when the value of source is indeed the same dir as where dagger.json lives, "source": is left absent in the dagger.json, indicating that the "true default" for source relative to dagger.json is ".".
mkdir mymod
cd mymod
dagger init --name mymod --sdk python --source .
which creates
.
โโโ dagger.json
โโโ pyproject.toml
โโโ sdk
โโโ src
dagger.json:
{
"name": "mymod",
"sdk": "python",
"engineVersion": "v0.9.9"
}
In summary, it's as if source has two "defaults". It defaults to a dagger/ subdir below the dagger.json in dagger init and dagger develop while it defaults to the same directory as the one containing the dagger.json in the dagger.json.