From 37aca5ca97223e8b5132d7ccc8f0c062acf2c603 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Mon, 30 Dec 2024 18:54:37 -0800 Subject: [PATCH] Add vscode settings json for types. --- .gitignore | 3 --- {{cookiecutter.project_slug}}/.gitignore | 1 - {{cookiecutter.project_slug}}/.vscode/settings.json | 8 ++++++++ {{cookiecutter.project_slug}}/README.md | 9 ++++++++- 4 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 {{cookiecutter.project_slug}}/.vscode/settings.json diff --git a/.gitignore b/.gitignore index d64e940..9f856f5 100644 --- a/.gitignore +++ b/.gitignore @@ -96,6 +96,3 @@ python_boilerplate/ cookiecutter-pypackage-env/ # vscode settings -.vscode/ -.history/ -*.code-workspace diff --git a/{{cookiecutter.project_slug}}/.gitignore b/{{cookiecutter.project_slug}}/.gitignore index d64e940..d2d9a89 100644 --- a/{{cookiecutter.project_slug}}/.gitignore +++ b/{{cookiecutter.project_slug}}/.gitignore @@ -96,6 +96,5 @@ python_boilerplate/ cookiecutter-pypackage-env/ # vscode settings -.vscode/ .history/ *.code-workspace diff --git a/{{cookiecutter.project_slug}}/.vscode/settings.json b/{{cookiecutter.project_slug}}/.vscode/settings.json new file mode 100644 index 0000000..50056f0 --- /dev/null +++ b/{{cookiecutter.project_slug}}/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + // Required - change /PATH/TO to the absolute path to ComfyUI. Windows e.g.: D:/My Folder/ComfyUI/ + // This pulls in ComfyUI Python types for the extension. + "python.analysis.extraPaths": [ + "/PATH/TO/ComfyUI/", + "/PATH/TO/ComfyUI/custom_nodes/" + ], +} diff --git a/{{cookiecutter.project_slug}}/README.md b/{{cookiecutter.project_slug}}/README.md index 6ff6577..23f18a0 100644 --- a/{{cookiecutter.project_slug}}/README.md +++ b/{{cookiecutter.project_slug}}/README.md @@ -23,7 +23,7 @@ The `-e` flag above will result in a "live" install, in the sense that any chang ## Using Github -Install Github Desktop or follow these [instructions] (https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) for ssh. +Install Github Desktop or follow these [instructions](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) for ssh. 1. Create a Github repository that matches the directory name. 2. Push the files to Git @@ -36,6 +36,13 @@ git push ## comfy_types ComfyUI exposes types that are very helpful when developing custom nodes. +> 💡 **Hint:** To get the types in your modern IDE, you need to add your ComfyUI directory to the include paths. This repo has a [settings.json](.vscode/settings.json) with a template that you can use. Replace the ComfyUI path with your own. + +## Tests + +- [build-pipeline.yml](.github/workflows/build-pipeline.yml) will run pytest and linter +- [validate.yml](.github/workflows/validate.yml) will run [node-diff](https://github.com/Comfy-Org/node-diff) to check for breaking changes + ## Publishing to Registry If you wish to share this custom node with others in the community, you can publish it to the registry. We've already auto-populated some fields in `pyproject.toml` under `tool.comfy`, but please double-check if they are correct.