viur-framework / viur-base

ViUR base project template - Start here with your new ViUR project!
https://www.viur.dev
MIT License
12 stars 12 forks source link

Upload an project.json template to base #120

Closed Grashalmbeisser closed 5 months ago

Grashalmbeisser commented 1 year ago

While developing the ViUR CLI i noticed, that we are creating a project.json to via the Cli to the project root directory. I think the project.json is better suited in the viur base project. Where the developer is not dependent on the viur cli.

phorward commented 1 year ago

Hello @Grashalmbeisser, project.json is already part of viur-base since a while.

For better understanding, here's an annotated version of the current project.json in viur-base, and also an annotation what would be nice to viur-cli.

{
    // On this level are profiles.
    // "default" is a profile, which is inherited by "develop" and "live" and can be customized for particular versions and/or GAE projects. Therefore, every profile can contain all keys from the "default" profile.
    "default": {
        "admin": "4.0.8",  // this is the admin-version *1
        "builds": {  // Here are steps for building for the `viur build` command
            "admin": {
                "command": "viur install admin 4.0.8",
                "kind": "exec"
            },
            "npm": {
                "command": "build",
                "kind": "npm",
                "source": ""
            }
        },
        "core": "3.5.1",  // this is the core-version *1
        "distribution_folder": "./deploy",  // The deploy folder, which is uploaded to GAE
        "format": "1.1.1",  // The file format of the project.json *2
        "pyodide": "0.19.1",  // THe pyodide version *1
        "sources_folder": "./sources",  // deprecated! The source folder for apps; This should be mainted by "builds" individually for every app, and removed from here
        "vi": "not-in-use",  // deprecated! *2
    },
    "develop": {  // "develop" is currently sometimes hard-coded in viur-cli *3
        "application_name": "my-dev-app-viur3",  // The name of the GAE project *4
        "version": "dev-$(user)"  // The version string; Variables can be used here.
    },
    "live": {
        "application_name": "my-live-app-viur3",
        "version": "live-$(year)-$(month)-$(day)-$(hour)-$(minute)-$(second)"
    }
}

Please see my annotations:

This is what an optimal project.json should look like, which only installs core and admin. Because no pyodide and no vi is providet, it is ignored. core setting should be mandatory!

{
    "format": "2.0.0",
    "default": {
        "admin": "4.0.8",
        "core": "3.5.1",
        "distribution_folder": "./deploy",
        "application_name": "my-live-app-viur3",
        "version": "live-$(year)-$(month)-$(day)-$(hour)-$(minute)-$(second)"
    },
    "develop": {
        "application_name": "my-dev-app-viur3",
    },
}

I hope this clarifies things a bit. Feed free to move it into an issue in viur-cli as well.

sveneberth commented 5 months ago

I no longer see any need for action regarding this ticket.

If I am wrong, please just open the ticket again.