Skip to content

Commit

Permalink
feat: Add functionality to generate config schema, and add the curren…
Browse files Browse the repository at this point in the history
…t schema to docs
  • Loading branch information
nickderobertis committed May 29, 2022
1 parent 97cd81f commit 419e7aa
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 15 deletions.
5 changes: 1 addition & 4 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,5 @@ flake8 = "*"
watchdog = "*"
typer = "*"
rich = "*"
py-app-conf = "==0.6.0a1"
py-app-conf = "*"
jinja2 = "*"

[pipenv]
allow_prereleases = true
8 changes: 4 additions & 4 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docsrc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ github:
@./binder_requirements.sh
@./nb-examples.sh
@./download-logo.sh
@./generate-config-schema.sh
@make doctest
@make autodoc
@make html
Expand Down
4 changes: 4 additions & 0 deletions docsrc/generate-config-schema.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
cd ..
python -m flexlate_dev.config_schema > docsrc/source/_static/config-schema.json
cd docsrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"title": "FlexlateDevConfig",
"description": "Base class for settings, allowing values to be overridden by environment variables.\n\nThis is useful in production for secrets you do not wish to save in code, it plays nicely with docker(-compose),\nHeroku and any 12 factor app design.",
"description": "Flexlate Dev configuration.",
"type": "object",
"properties": {
"data": {
"title": "Data",
"description": "Data configurations by name",
"env_names": [
"data"
],
Expand All @@ -15,6 +16,7 @@
},
"commands": {
"title": "Commands",
"description": "Commands that can be used across multiple configurations",
"env_names": [
"commands"
],
Expand All @@ -25,6 +27,7 @@
},
"run_configs": {
"title": "Run Configs",
"description": "Root run configurations by name",
"env_names": [
"run_configs"
],
Expand All @@ -42,21 +45,25 @@
"properties": {
"data": {
"title": "Data",
"description": "Key-value pairs of data to be used in the template",
"type": "object"
},
"folder_name": {
"title": "Folder Name",
"description": "Name of the folder to be created for the project, if it is a template type that does not specify a name",
"type": "string"
},
"ignore": {
"title": "Ignore",
"description": "List of files or folders to ignore when creating the project. Full git wildmatch syntax (like .gitignore) is supported including negations",
"type": "array",
"items": {
"type": "string"
}
},
"extends": {
"title": "Extends",
"description": "Name of the data configuration to extend",
"type": "string"
}
}
Expand Down Expand Up @@ -89,6 +96,7 @@
"properties": {
"pre_check": {
"title": "Pre Check",
"help": "Commands to run before checking whether it is an initialization or update.",
"type": "array",
"items": {
"anyOf": [
Expand All @@ -103,6 +111,7 @@
},
"post_init": {
"title": "Post Init",
"help": "Commands to run after initializing.",
"type": "array",
"items": {
"anyOf": [
Expand All @@ -117,6 +126,7 @@
},
"pre_update": {
"title": "Pre Update",
"help": "Commands to run before updating.",
"type": "array",
"items": {
"anyOf": [
Expand All @@ -131,6 +141,7 @@
},
"post_update": {
"title": "Post Update",
"help": "Commands to run after updating.",
"type": "array",
"items": {
"anyOf": [
Expand All @@ -145,19 +156,23 @@
},
"data_name": {
"title": "Data Name",
"help": "Name of the data configuration to use.",
"type": "string"
},
"out_root": {
"title": "Out Root",
"help": "Root directory to use for output.",
"type": "string",
"format": "path"
},
"auto_commit_message": {
"title": "Auto Commit Message",
"help": "Message to use when auto-committing changes during serve.",
"type": "string"
},
"extends": {
"title": "Extends",
"help": "Name of the run configuration to extend.",
"type": "string"
}
}
Expand All @@ -168,6 +183,7 @@
"properties": {
"pre_check": {
"title": "Pre Check",
"help": "Commands to run before checking whether it is an initialization or update.",
"type": "array",
"items": {
"anyOf": [
Expand All @@ -182,6 +198,7 @@
},
"post_init": {
"title": "Post Init",
"help": "Commands to run after initializing.",
"type": "array",
"items": {
"anyOf": [
Expand All @@ -196,6 +213,7 @@
},
"pre_update": {
"title": "Pre Update",
"help": "Commands to run before updating.",
"type": "array",
"items": {
"anyOf": [
Expand All @@ -210,6 +228,7 @@
},
"post_update": {
"title": "Post Update",
"help": "Commands to run after updating.",
"type": "array",
"items": {
"anyOf": [
Expand All @@ -224,28 +243,44 @@
},
"data_name": {
"title": "Data Name",
"help": "Name of the data configuration to use.",
"type": "string"
},
"out_root": {
"title": "Out Root",
"help": "Root directory to use for output.",
"type": "string",
"format": "path"
},
"auto_commit_message": {
"title": "Auto Commit Message",
"help": "Message to use when auto-committing changes during serve.",
"type": "string"
},
"extends": {
"title": "Extends",
"help": "Name of the run configuration to extend.",
"type": "string"
},
"publish": {
"$ref": "#/definitions/UserRunConfiguration"
"title": "Publish",
"help": "Parts of run configuration to use only when publishing.",
"allOf": [
{
"$ref": "#/definitions/UserRunConfiguration"
}
]
},
"serve": {
"$ref": "#/definitions/UserRunConfiguration"
"title": "Serve",
"help": "Parts of run configuration to use only when serving.",
"allOf": [
{
"$ref": "#/definitions/UserRunConfiguration"
}
]
}
}
}
}
}
}

0 comments on commit 419e7aa

Please sign in to comment.