womm-cli 4.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- womm/__init__.py +53 -0
- womm/__main__.py +48 -0
- womm/_version.py +10 -0
- womm/assets/copier/meta/copier.yml +15 -0
- womm/assets/copier/meta/template/README.md.jinja +32 -0
- womm/assets/copier/meta/template/copier.yml.jinja +13 -0
- womm/assets/copier/meta/template/template/.gitkeep +0 -0
- womm/assets/copier/official/javascript/copier.yml +104 -0
- womm/assets/copier/official/javascript/template/.gitignore.jinja +35 -0
- womm/assets/copier/official/javascript/template/.nvmrc.jinja +1 -0
- womm/assets/copier/official/javascript/template/.prettierignore.jinja +10 -0
- womm/assets/copier/official/javascript/template/README.md.jinja +81 -0
- womm/assets/copier/official/javascript/template/biome.json.jinja +54 -0
- womm/assets/copier/official/javascript/template/eslint.config.mjs.jinja +51 -0
- womm/assets/copier/official/javascript/template/index.html.jinja +12 -0
- womm/assets/copier/official/javascript/template/package.json.jinja +88 -0
- womm/assets/copier/official/javascript/template/prettier.config.mjs.jinja +8 -0
- womm/assets/copier/official/javascript/template/src/App.jsx.jinja +10 -0
- womm/assets/copier/official/javascript/template/src/App.tsx.jinja +10 -0
- womm/assets/copier/official/javascript/template/src/App.vue.jinja +18 -0
- womm/assets/copier/official/javascript/template/src/index.jsx.jinja +10 -0
- womm/assets/copier/official/javascript/template/src/index.tsx.jinja +11 -0
- womm/assets/copier/official/javascript/template/src/main.js.jinja +21 -0
- womm/assets/copier/official/javascript/template/src/main.ts.jinja +21 -0
- womm/assets/copier/official/javascript/template/tsconfig.json.jinja +35 -0
- womm/assets/copier/official/javascript/template/vite.config.mjs.jinja +10 -0
- womm/assets/copier/official/javascript/template/{% if with_ci %}.github{% endif %}/workflows/ci.yml.jinja +63 -0
- womm/assets/copier/official/javascript/template/{% if with_tests %}tests{% endif %}/smoke.test.js.jinja +12 -0
- womm/assets/copier/official/javascript/template/{% if with_tests %}tests{% endif %}/smoke.test.ts.jinja +12 -0
- womm/assets/copier/official/javascript/template/{% if with_vscode %}.vscode{% endif %}/extensions.json.jinja +4 -0
- womm/assets/copier/official/javascript/template/{% if with_vscode %}.vscode{% endif %}/settings.json.jinja +27 -0
- womm/assets/copier/official/python/copier.yml +107 -0
- womm/assets/copier/official/python/template/.gitignore.jinja +40 -0
- womm/assets/copier/official/python/template/.pre-commit-config.yaml.jinja +19 -0
- womm/assets/copier/official/python/template/.python-version.jinja +1 -0
- womm/assets/copier/official/python/template/README.md.jinja +83 -0
- womm/assets/copier/official/python/template/pyproject.toml.jinja +114 -0
- womm/assets/copier/official/python/template/{% if framework == 'django' %}manage.py{% endif %}.jinja +23 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/__init__.py.jinja +3 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/asgi.py.jinja +9 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/core/__init__.py.jinja +0 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/core/apps.py.jinja +10 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/core/models.py.jinja +1 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/core/views.py.jinja +8 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/py.typed +0 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/settings.py.jinja +81 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/urls.py.jinja +11 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/wsgi.py.jinja +9 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/__init__.py.jinja +3 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/asgi.py.jinja +9 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/core/__init__.py.jinja +0 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/core/apps.py.jinja +10 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/core/models.py.jinja +1 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/core/views.py.jinja +8 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/py.typed +0 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/settings.py.jinja +81 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/urls.py.jinja +11 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/wsgi.py.jinja +9 -0
- womm/assets/copier/official/python/template/{% if with_ci %}.github{% endif %}/workflows/ci.yml.jinja +78 -0
- womm/assets/copier/official/python/template/{% if with_tests %}tests{% endif %}/test_smoke.py.jinja +16 -0
- womm/assets/copier/official/python/template/{% if with_vscode %}.vscode{% endif %}/extensions.json.jinja +8 -0
- womm/assets/copier/official/python/template/{% if with_vscode %}.vscode{% endif %}/settings.json.jinja +28 -0
- womm/bin/refresh_env.cmd +130 -0
- womm/cli.py +111 -0
- womm/commands/__init__.py +30 -0
- womm/commands/core/__init__.py +29 -0
- womm/commands/core/doctor.py +52 -0
- womm/commands/core/path.py +337 -0
- womm/commands/project/__init__.py +31 -0
- womm/commands/project/create.py +128 -0
- womm/commands/project/setup.py +438 -0
- womm/commands/project/template.py +160 -0
- womm/commands/system/__init__.py +31 -0
- womm/commands/system/context/__init__.py +82 -0
- womm/commands/system/context/backup.py +344 -0
- womm/commands/system/context/inventory.py +111 -0
- womm/commands/system/context/registration.py +290 -0
- womm/commands/system/deps.py +165 -0
- womm/commands/system/system.py +130 -0
- womm/exceptions/__init__.py +69 -0
- womm/exceptions/common/__init__.py +55 -0
- womm/exceptions/common/command_service.py +91 -0
- womm/exceptions/common/file_service.py +60 -0
- womm/exceptions/common/security_service.py +44 -0
- womm/exceptions/common/validation_service.py +70 -0
- womm/exceptions/context/__init__.py +27 -0
- womm/exceptions/context/context_service.py +55 -0
- womm/exceptions/project/__init__.py +29 -0
- womm/exceptions/project/project_service.py +59 -0
- womm/exceptions/system/__init__.py +25 -0
- womm/exceptions/system/system_service.py +53 -0
- womm/interfaces/__init__.py +71 -0
- womm/interfaces/context/__init__.py +34 -0
- womm/interfaces/context/menu_interface.py +686 -0
- womm/interfaces/context/registry_interface.py +562 -0
- womm/interfaces/context/script_detector_interface.py +208 -0
- womm/interfaces/context/script_registrar.py +264 -0
- womm/interfaces/core/__init__.py +26 -0
- womm/interfaces/core/doctor_interface.py +102 -0
- womm/interfaces/dependencies/__init__.py +28 -0
- womm/interfaces/dependencies/deps_interface.py +160 -0
- womm/interfaces/project/__init__.py +36 -0
- womm/interfaces/project/create_interface.py +162 -0
- womm/interfaces/project/detection_interface.py +181 -0
- womm/interfaces/project/manager_interface.py +99 -0
- womm/interfaces/project/setup_interface.py +477 -0
- womm/interfaces/project/template_store_interface.py +196 -0
- womm/interfaces/system/__init__.py +32 -0
- womm/interfaces/system/detector_interface.py +84 -0
- womm/interfaces/system/environment_interface.py +110 -0
- womm/interfaces/system/path_interface.py +570 -0
- womm/services/__init__.py +70 -0
- womm/services/common/__init__.py +33 -0
- womm/services/common/base_validation_service.py +450 -0
- womm/services/common/command_runner_service.py +647 -0
- womm/services/common/file_scanner_service.py +483 -0
- womm/services/common/security_validator_service.py +348 -0
- womm/services/context/__init__.py +37 -0
- womm/services/context/backup_entries.py +148 -0
- womm/services/context/parameters.py +515 -0
- womm/services/context/registry_paths.py +56 -0
- womm/services/context/registry_service.py +573 -0
- womm/services/context/validation_service.py +691 -0
- womm/services/dependencies/__init__.py +29 -0
- womm/services/dependencies/probe.py +102 -0
- womm/services/project/__init__.py +48 -0
- womm/services/project/copier_project_creation_service.py +111 -0
- womm/services/project/destination_guard.py +96 -0
- womm/services/project/detection_service.py +354 -0
- womm/services/project/env_utils.py +333 -0
- womm/services/project/javascript_environment_service.py +348 -0
- womm/services/project/python_environment_service.py +245 -0
- womm/services/project/setup_profile_resolver.py +146 -0
- womm/services/project/template_store_service.py +344 -0
- womm/services/project/validation_service.py +418 -0
- womm/services/system/__init__.py +32 -0
- womm/services/system/detector_service.py +704 -0
- womm/services/system/environment_service.py +494 -0
- womm/services/system/path_service.py +642 -0
- womm/shared/__init__.py +30 -0
- womm/shared/configs/__init__.py +51 -0
- womm/shared/configs/context/__init__.py +43 -0
- womm/shared/configs/context/context_config.py +125 -0
- womm/shared/configs/context/context_file_types_config.py +159 -0
- womm/shared/configs/context/context_limits_config.py +187 -0
- womm/shared/configs/context/context_paths_config.py +115 -0
- womm/shared/configs/context/context_types_config.py +65 -0
- womm/shared/configs/context/script_config.py +219 -0
- womm/shared/configs/dependencies/__init__.py +32 -0
- womm/shared/configs/dependencies/runtime_config.py +46 -0
- womm/shared/configs/dependencies/runtime_package_manager_config.py +48 -0
- womm/shared/configs/logging_config.py +89 -0
- womm/shared/configs/project/__init__.py +33 -0
- womm/shared/configs/project/project_config.py +109 -0
- womm/shared/configs/project/project_structure_config.py +88 -0
- womm/shared/configs/project/python_project_config.py +165 -0
- womm/shared/configs/security/__init__.py +26 -0
- womm/shared/configs/security/security_patterns_config.py +242 -0
- womm/shared/configs/system/__init__.py +28 -0
- womm/shared/configs/system/system_detector_config.py +210 -0
- womm/shared/configs/system/system_environment_config.py +101 -0
- womm/shared/models/__init__.py +13 -0
- womm/shared/models/template_source.py +65 -0
- womm/shared/paths.py +192 -0
- womm/shared/results/__init__.py +138 -0
- womm/shared/results/base.py +85 -0
- womm/shared/results/command_results.py +61 -0
- womm/shared/results/context_results.py +345 -0
- womm/shared/results/dependency_results.py +110 -0
- womm/shared/results/doctor_results.py +41 -0
- womm/shared/results/file_results.py +97 -0
- womm/shared/results/project_results.py +163 -0
- womm/shared/results/security_results.py +128 -0
- womm/shared/results/system_results.py +268 -0
- womm/shared/results/template_results.py +43 -0
- womm/shared/runtime.py +36 -0
- womm/ui/__init__.py +31 -0
- womm/ui/common/__init__.py +39 -0
- womm/ui/common/interactive_menu.py +246 -0
- womm/ui/common/logging.py +184 -0
- womm/ui/common/prompts.py +93 -0
- womm/ui/context/__init__.py +31 -0
- womm/ui/context/display.py +485 -0
- womm/ui/context/menu_display.py +189 -0
- womm/ui/context/wizard.py +557 -0
- womm/ui/project/__init__.py +42 -0
- womm/ui/project/create/create_completion_summaries.py +55 -0
- womm/ui/project/project_wizard.py +174 -0
- womm/ui/project/setup/setup_completion_summaries.py +111 -0
- womm/ui/project/templates/template_store_display.py +128 -0
- womm/ui/system/__init__.py +60 -0
- womm/ui/system/display.py +531 -0
- womm/ui/system/path_display.py +387 -0
- womm/utils/__init__.py +23 -0
- womm/utils/common/__init__.py +49 -0
- womm/utils/common/file_scanner_utils.py +110 -0
- womm/utils/common/path_resolver_utils.py +127 -0
- womm/utils/common/safe_fs_utils.py +135 -0
- womm/utils/context/__init__.py +54 -0
- womm/utils/context/core_utils.py +345 -0
- womm/utils/context/icon_utils.py +259 -0
- womm/utils/project/__init__.py +106 -0
- womm/utils/project/asset_utils.py +154 -0
- womm/utils/project/core_utils.py +391 -0
- womm/utils/project/file_utils.py +494 -0
- womm/utils/project/platform_utils.py +170 -0
- womm/utils/project/validation_utils.py +273 -0
- womm/utils/security/__init__.py +46 -0
- womm/utils/security/security_validation_utils.py +258 -0
- womm/utils/system/__init__.py +69 -0
- womm/utils/system/detector_utils.py +299 -0
- womm/utils/system/environment_utils.py +172 -0
- womm/utils/system/path_utils.py +101 -0
- womm_cli-4.0.0.dist-info/METADATA +203 -0
- womm_cli-4.0.0.dist-info/RECORD +218 -0
- womm_cli-4.0.0.dist-info/WHEEL +4 -0
- womm_cli-4.0.0.dist-info/entry_points.txt +2 -0
- womm_cli-4.0.0.dist-info/licenses/LICENSE +21 -0
womm/__init__.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# ///////////////////////////////////////////////////////////////
|
|
3
|
+
# WOMM - Works On My Machine
|
|
4
|
+
# Project: works-on-my-machine
|
|
5
|
+
# ///////////////////////////////////////////////////////////////
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
Works On My Machine (WOMM) - Development Environment Manager.
|
|
9
|
+
|
|
10
|
+
A comprehensive tool for managing development environments, dependencies,
|
|
11
|
+
and project setup across multiple programming languages.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from ._version import __version__
|
|
15
|
+
|
|
16
|
+
# ///////////////////////////////////////////////////////////////
|
|
17
|
+
# PACKAGE METADATA
|
|
18
|
+
# ///////////////////////////////////////////////////////////////
|
|
19
|
+
|
|
20
|
+
__author__ = "Neuraaak"
|
|
21
|
+
__maintainer__ = "Neuraaak"
|
|
22
|
+
__description__ = (
|
|
23
|
+
"Universal development tools for multiple languages - "
|
|
24
|
+
"Automatic installation, cross-platform configuration, global commands"
|
|
25
|
+
)
|
|
26
|
+
__python_requires__ = ">=3.13"
|
|
27
|
+
__keywords__ = ["logging", "rich", "loguru", "console", "file"]
|
|
28
|
+
__url__ = "https://github.com/neuraaak/works-on-my-machine"
|
|
29
|
+
__repository__ = "https://github.com/neuraaak/works-on-my-machine"
|
|
30
|
+
|
|
31
|
+
# ///////////////////////////////////////////////////////////////
|
|
32
|
+
# PUBLIC API
|
|
33
|
+
# ///////////////////////////////////////////////////////////////
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def main() -> None:
|
|
37
|
+
"""CLI entry point wrapper to avoid early heavy imports."""
|
|
38
|
+
from .cli import main as _main
|
|
39
|
+
|
|
40
|
+
_main()
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
__all__ = [
|
|
44
|
+
"__version__",
|
|
45
|
+
"__author__",
|
|
46
|
+
"__maintainer__",
|
|
47
|
+
"__description__",
|
|
48
|
+
"__python_requires__",
|
|
49
|
+
"__keywords__",
|
|
50
|
+
"__url__",
|
|
51
|
+
"__repository__",
|
|
52
|
+
"main",
|
|
53
|
+
]
|
womm/__main__.py
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# ///////////////////////////////////////////////////////////////
|
|
3
|
+
# WOMM __MAIN__ - Package Entry Point
|
|
4
|
+
# Project: works-on-my-machine
|
|
5
|
+
# ///////////////////////////////////////////////////////////////
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
Works On My Machine (WOMM) - Main CLI Entry Point.
|
|
9
|
+
|
|
10
|
+
This is the main entry point for the womm package.
|
|
11
|
+
Supports both direct execution and module execution.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
# ///////////////////////////////////////////////////////////////
|
|
17
|
+
# IMPORTS
|
|
18
|
+
# ///////////////////////////////////////////////////////////////
|
|
19
|
+
# Standard library imports
|
|
20
|
+
import sys
|
|
21
|
+
|
|
22
|
+
# ///////////////////////////////////////////////////////////////
|
|
23
|
+
# MAIN FUNCTIONS
|
|
24
|
+
# ///////////////////////////////////////////////////////////////
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def main() -> None:
|
|
28
|
+
"""Main entry point for the womm package."""
|
|
29
|
+
try:
|
|
30
|
+
from .cli import main as cli_main
|
|
31
|
+
|
|
32
|
+
cli_main()
|
|
33
|
+
except ImportError as e:
|
|
34
|
+
print("Error: Could not import womm package", file=sys.stderr)
|
|
35
|
+
print("Make sure the womm package is properly installed", file=sys.stderr)
|
|
36
|
+
print(f"Error details: {e}", file=sys.stderr)
|
|
37
|
+
sys.exit(1)
|
|
38
|
+
except Exception as e:
|
|
39
|
+
print(f"Error running WOMM: {e}", file=sys.stderr)
|
|
40
|
+
sys.exit(1)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# ///////////////////////////////////////////////////////////////
|
|
44
|
+
# EXECUTION ENTRY POINT
|
|
45
|
+
# ///////////////////////////////////////////////////////////////
|
|
46
|
+
|
|
47
|
+
if __name__ == "__main__":
|
|
48
|
+
main()
|
womm/_version.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# ///////////////////////////////////////////////////////////////
|
|
2
|
+
# VERSION - Package version metadata
|
|
3
|
+
# Project: works-on-my-machine
|
|
4
|
+
# ///////////////////////////////////////////////////////////////
|
|
5
|
+
|
|
6
|
+
"""Centralized package version metadata."""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
__version__ = "4.0.0"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
_womm:
|
|
2
|
+
description: "Skeleton for a new Copier template"
|
|
3
|
+
version: "1.0.0"
|
|
4
|
+
|
|
5
|
+
_subdirectory: template
|
|
6
|
+
|
|
7
|
+
template_name:
|
|
8
|
+
type: str
|
|
9
|
+
help: "Template name"
|
|
10
|
+
default: "my-template"
|
|
11
|
+
|
|
12
|
+
template_description:
|
|
13
|
+
type: str
|
|
14
|
+
help: "One-line template description"
|
|
15
|
+
default: "A Copier template"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# {{ template_name }}
|
|
2
|
+
|
|
3
|
+
{{ template_description }}
|
|
4
|
+
|
|
5
|
+
## Using this template
|
|
6
|
+
|
|
7
|
+
To create a project from this template:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
womm create user/{{ template_name | replace(' ', '-') | lower }} <destination>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Registering this template
|
|
14
|
+
|
|
15
|
+
To register this template with WOMM:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
womm template add {{ template_name | replace(' ', '-') | lower }} /path/to/this/template
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
After that, you can use the short name:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
womm create {{ template_name | replace(' ', '-') | lower }} <destination>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Modifying the template
|
|
28
|
+
|
|
29
|
+
This is your Copier template. Edit `copier.yml` to add questions, conditions, and content.
|
|
30
|
+
Edit the `template/` directory to add files and structure that will be generated.
|
|
31
|
+
|
|
32
|
+
Refer to the [Copier documentation](https://copier.readthedocs.io/) for more information.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
_subdirectory: template
|
|
2
|
+
|
|
3
|
+
project_name:
|
|
4
|
+
type: str
|
|
5
|
+
help: "Project name"
|
|
6
|
+
default: "my-project"
|
|
7
|
+
|
|
8
|
+
{% raw %}
|
|
9
|
+
project_description:
|
|
10
|
+
type: str
|
|
11
|
+
help: "One-line project description"
|
|
12
|
+
default: "A project created with {{ project_name }}"
|
|
13
|
+
{% endraw %}
|
|
File without changes
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
_womm:
|
|
2
|
+
description: "JavaScript or TypeScript project (optional React or Vue)"
|
|
3
|
+
version: "2.0.0"
|
|
4
|
+
setup:
|
|
5
|
+
language: javascript
|
|
6
|
+
|
|
7
|
+
_subdirectory: template
|
|
8
|
+
|
|
9
|
+
project_name:
|
|
10
|
+
type: str
|
|
11
|
+
help: "Project name"
|
|
12
|
+
|
|
13
|
+
description:
|
|
14
|
+
type: str
|
|
15
|
+
help: "One-line project description"
|
|
16
|
+
default: "A JavaScript project"
|
|
17
|
+
|
|
18
|
+
author_name:
|
|
19
|
+
type: str
|
|
20
|
+
help: "Author name"
|
|
21
|
+
default: ""
|
|
22
|
+
|
|
23
|
+
framework:
|
|
24
|
+
type: str
|
|
25
|
+
help: "Framework"
|
|
26
|
+
choices:
|
|
27
|
+
- none
|
|
28
|
+
- react
|
|
29
|
+
- vue
|
|
30
|
+
default: none
|
|
31
|
+
|
|
32
|
+
typescript:
|
|
33
|
+
type: bool
|
|
34
|
+
help: "Use TypeScript"
|
|
35
|
+
default: false
|
|
36
|
+
|
|
37
|
+
package_manager:
|
|
38
|
+
type: str
|
|
39
|
+
help: "Package manager"
|
|
40
|
+
choices:
|
|
41
|
+
- npm
|
|
42
|
+
- pnpm
|
|
43
|
+
- yarn
|
|
44
|
+
- bun
|
|
45
|
+
default: npm
|
|
46
|
+
|
|
47
|
+
with_tests:
|
|
48
|
+
type: bool
|
|
49
|
+
help: "Include a Vitest setup"
|
|
50
|
+
default: true
|
|
51
|
+
|
|
52
|
+
with_ci:
|
|
53
|
+
type: bool
|
|
54
|
+
help: "Include a GitHub Actions CI workflow"
|
|
55
|
+
default: true
|
|
56
|
+
|
|
57
|
+
with_vscode:
|
|
58
|
+
type: bool
|
|
59
|
+
help: "Include shared VS Code settings"
|
|
60
|
+
default: true
|
|
61
|
+
|
|
62
|
+
license:
|
|
63
|
+
type: str
|
|
64
|
+
help: "License"
|
|
65
|
+
choices:
|
|
66
|
+
- MIT
|
|
67
|
+
- Apache-2.0
|
|
68
|
+
- proprietary
|
|
69
|
+
default: MIT
|
|
70
|
+
|
|
71
|
+
# A top-level file (e.g. tsconfig.json) cannot be gated by wrapping its own
|
|
72
|
+
# filename in a Jinja {% if %} block: Copier decides whether to Jinja-render
|
|
73
|
+
# and strip a file based on the *raw, literal* filename ending in ".jinja",
|
|
74
|
+
# so an empty-string {% if %} around the whole name breaks that detection.
|
|
75
|
+
# Exclusion patterns, on the other hand, are Jinja-rendered per answer set
|
|
76
|
+
# (Copier renders each `_exclude` entry against the current answers before
|
|
77
|
+
# matching), so a pattern that renders to an empty string simply matches no
|
|
78
|
+
# file — this is the supported way to conditionally drop a rendered file.
|
|
79
|
+
_exclude:
|
|
80
|
+
- "copier.yaml"
|
|
81
|
+
- "copier.yml"
|
|
82
|
+
- "~*"
|
|
83
|
+
- "*.py[co]"
|
|
84
|
+
- "__pycache__"
|
|
85
|
+
- ".git"
|
|
86
|
+
- ".DS_Store"
|
|
87
|
+
- ".svn"
|
|
88
|
+
- "{% if package_manager == 'bun' %}.nvmrc{% endif %}"
|
|
89
|
+
- "{% if not typescript %}tsconfig.json{% endif %}"
|
|
90
|
+
- "{% if framework == 'none' %}index.html{% endif %}"
|
|
91
|
+
- "{% if framework == 'none' %}vite.config.mjs{% endif %}"
|
|
92
|
+
- "{% if framework != 'vue' %}eslint.config.mjs{% endif %}"
|
|
93
|
+
- "{% if framework != 'vue' %}prettier.config.mjs{% endif %}"
|
|
94
|
+
- "{% if framework != 'vue' %}.prettierignore{% endif %}"
|
|
95
|
+
- "{% if framework == 'vue' %}biome.json{% endif %}"
|
|
96
|
+
- "{% if typescript or framework == 'react' %}src/main.js{% endif %}"
|
|
97
|
+
- "{% if not typescript or framework == 'react' %}src/main.ts{% endif %}"
|
|
98
|
+
- "{% if framework != 'react' or typescript %}src/index.jsx{% endif %}"
|
|
99
|
+
- "{% if framework != 'react' or not typescript %}src/index.tsx{% endif %}"
|
|
100
|
+
- "{% if framework != 'react' or typescript %}src/App.jsx{% endif %}"
|
|
101
|
+
- "{% if framework != 'react' or not typescript %}src/App.tsx{% endif %}"
|
|
102
|
+
- "{% if framework != 'vue' %}src/App.vue{% endif %}"
|
|
103
|
+
- "{% if typescript %}tests/smoke.test.js{% endif %}"
|
|
104
|
+
- "{% if not typescript %}tests/smoke.test.ts{% endif %}"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
|
|
4
|
+
# Build outputs
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
coverage/
|
|
8
|
+
|
|
9
|
+
# Logs
|
|
10
|
+
*.log
|
|
11
|
+
npm-debug.log*
|
|
12
|
+
yarn-debug.log*
|
|
13
|
+
yarn-error.log*
|
|
14
|
+
|
|
15
|
+
# Environment files
|
|
16
|
+
.env
|
|
17
|
+
.env.local
|
|
18
|
+
|
|
19
|
+
# Editors
|
|
20
|
+
.idea/
|
|
21
|
+
{%- if not with_vscode %}
|
|
22
|
+
.vscode/
|
|
23
|
+
{%- endif %}
|
|
24
|
+
|
|
25
|
+
# OS generated files
|
|
26
|
+
.DS_Store
|
|
27
|
+
Thumbs.db
|
|
28
|
+
|
|
29
|
+
# ESLint cache
|
|
30
|
+
.eslintcache
|
|
31
|
+
{%- if typescript %}
|
|
32
|
+
|
|
33
|
+
# TypeScript
|
|
34
|
+
*.tsbuildinfo
|
|
35
|
+
{%- endif %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
24
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# {{ project_name }}
|
|
2
|
+
|
|
3
|
+
{{ description }}
|
|
4
|
+
{%- if author_name %}
|
|
5
|
+
|
|
6
|
+
Author: {{ author_name }}
|
|
7
|
+
{%- endif %}
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
{{ package_manager }} install
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Commit the generated `{% if package_manager == "npm" %}package-lock.json{% elif package_manager == "pnpm" %}pnpm-lock.yaml{% elif package_manager == "yarn" %}yarn.lock{% else %}bun.lock{% endif %}` before pushing.
|
|
16
|
+
CI installs only from that lockfile.
|
|
17
|
+
{% if package_manager != "bun" %}This project supports Node.js 24 and 26; `.nvmrc` selects Node.js 24 for
|
|
18
|
+
local development.
|
|
19
|
+
{% endif %}
|
|
20
|
+
{% if package_manager in ("pnpm", "yarn") %}
|
|
21
|
+
Install Corepack before using {{ package_manager }} on Node.js 26, then run `corepack enable`.
|
|
22
|
+
{% endif %}
|
|
23
|
+
|
|
24
|
+
## Layout
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
src/ {% if framework == "react" -%}
|
|
28
|
+
React source (TypeScript){%- if not typescript %} (JavaScript){%- endif %}
|
|
29
|
+
{%- elif framework == "vue" -%}
|
|
30
|
+
Vue source (TypeScript){%- if not typescript %} (JavaScript){%- endif %}
|
|
31
|
+
{%- else -%}
|
|
32
|
+
Application source
|
|
33
|
+
{%- endif %}
|
|
34
|
+
{%- if with_tests %}
|
|
35
|
+
tests/ Test suite
|
|
36
|
+
{%- endif %}
|
|
37
|
+
```
|
|
38
|
+
{%- if with_tests %}
|
|
39
|
+
|
|
40
|
+
## Tests
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
{% if package_manager == "bun" -%}
|
|
44
|
+
bun run test
|
|
45
|
+
{%- else -%}
|
|
46
|
+
{{ package_manager }} test
|
|
47
|
+
{%- endif %}
|
|
48
|
+
```
|
|
49
|
+
{%- endif %}
|
|
50
|
+
|
|
51
|
+
## Development
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
{{ package_manager }} run dev
|
|
55
|
+
{{ package_manager }} run build
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Quality
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
{{ package_manager }} run lint
|
|
62
|
+
{{ package_manager }} run format:check
|
|
63
|
+
{%- if typescript %}
|
|
64
|
+
{{ package_manager }} run type-check
|
|
65
|
+
{%- endif %}
|
|
66
|
+
```
|
|
67
|
+
{%- if framework == "react" %}
|
|
68
|
+
|
|
69
|
+
## Framework
|
|
70
|
+
|
|
71
|
+
This project uses React{% if typescript %} with TypeScript{% endif %}.
|
|
72
|
+
{%- elif framework == "vue" %}
|
|
73
|
+
|
|
74
|
+
## Framework
|
|
75
|
+
|
|
76
|
+
This project uses Vue{% if typescript %} with TypeScript{% endif %}.
|
|
77
|
+
{%- endif %}
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
{{ license }}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.0/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": true
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"ignoreUnknown": false
|
|
10
|
+
},
|
|
11
|
+
"formatter": {
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"indentStyle": "space",
|
|
14
|
+
"indentWidth": 2,
|
|
15
|
+
"lineWidth": 100
|
|
16
|
+
},
|
|
17
|
+
"linter": {
|
|
18
|
+
"enabled": true,
|
|
19
|
+
"rules": {
|
|
20
|
+
"recommended": true,
|
|
21
|
+
"suspicious": {
|
|
22
|
+
"noConsole": "warn",
|
|
23
|
+
"noDebugger": "error"
|
|
24
|
+
},
|
|
25
|
+
"style": {
|
|
26
|
+
"noVar": "error",
|
|
27
|
+
"useConst": "error"
|
|
28
|
+
}{% if framework == "react" %},
|
|
29
|
+
"correctness": {
|
|
30
|
+
"useExhaustiveDependencies": "warn"
|
|
31
|
+
}{% endif %}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"javascript": {
|
|
35
|
+
"formatter": {
|
|
36
|
+
"quoteStyle": "double",
|
|
37
|
+
"semicolons": "always",
|
|
38
|
+
"trailingCommas": "all",
|
|
39
|
+
"arrowParentheses": "always"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"json": {
|
|
43
|
+
"formatter": {
|
|
44
|
+
"enabled": true
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"assist": {
|
|
48
|
+
"actions": {
|
|
49
|
+
"source": {
|
|
50
|
+
"organizeImports": "on"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import eslint from "@eslint/js";
|
|
2
|
+
import prettier from "eslint-config-prettier";
|
|
3
|
+
import globals from "globals";
|
|
4
|
+
{%- if typescript %}
|
|
5
|
+
import tseslint from "typescript-eslint";
|
|
6
|
+
{%- endif %}
|
|
7
|
+
import vue from "eslint-plugin-vue";
|
|
8
|
+
|
|
9
|
+
export default [
|
|
10
|
+
{
|
|
11
|
+
ignores: ["coverage/**", "dist/**", "node_modules/**"],
|
|
12
|
+
},
|
|
13
|
+
eslint.configs.recommended,
|
|
14
|
+
{%- if typescript %}
|
|
15
|
+
...tseslint.configs.recommended,
|
|
16
|
+
{%- endif %}
|
|
17
|
+
...vue.configs["flat/recommended"],
|
|
18
|
+
{
|
|
19
|
+
files: ["**/*.{js{% if typescript %},ts{% endif %},vue}"],
|
|
20
|
+
languageOptions: {
|
|
21
|
+
ecmaVersion: "latest",
|
|
22
|
+
globals: {
|
|
23
|
+
...globals.node,
|
|
24
|
+
{%- if framework in ("react", "vue") %}
|
|
25
|
+
...globals.browser,
|
|
26
|
+
{%- endif %}
|
|
27
|
+
},
|
|
28
|
+
{%- if typescript %}
|
|
29
|
+
parserOptions: {
|
|
30
|
+
parser: tseslint.parser,
|
|
31
|
+
},
|
|
32
|
+
{%- endif %}
|
|
33
|
+
sourceType: "module",
|
|
34
|
+
},
|
|
35
|
+
rules: {
|
|
36
|
+
"no-console": "warn",
|
|
37
|
+
"no-debugger": "error",
|
|
38
|
+
"no-eval": "error",
|
|
39
|
+
"no-var": "error",
|
|
40
|
+
"prefer-const": "error",
|
|
41
|
+
{%- if typescript %}
|
|
42
|
+
"no-unused-vars": "off",
|
|
43
|
+
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
|
44
|
+
{%- else %}
|
|
45
|
+
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
|
46
|
+
{%- endif %}
|
|
47
|
+
"vue/multi-word-component-names": "off",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
prettier,
|
|
51
|
+
];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>{{ project_name }}</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="{% if framework == 'react' %}root{% else %}app{% endif %}"></div>
|
|
10
|
+
<script type="module" src="/{% if framework == 'react' %}src/index.{% if typescript %}tsx{% else %}jsx{% endif %}{% else %}src/main.{% if typescript %}ts{% else %}js{% endif %}{% endif %}"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{%- set source_entry = ("src/index." if framework == "react" else "src/main.") + ("tsx" if (typescript and framework == "react") else "ts" if typescript else "jsx" if framework == "react" else "js") -%}
|
|
2
|
+
{%- set runtime_entry = "dist/main.js" if typescript else source_entry -%}
|
|
3
|
+
{%- set use_biome = framework != "vue" -%}
|
|
4
|
+
{%- set deps = [] -%}
|
|
5
|
+
{%- set dev_deps = ['"@biomejs/biome": "^2.5.0"'] if use_biome else [
|
|
6
|
+
'"@eslint/js": "^10.0.0"',
|
|
7
|
+
'"eslint": "^10.7.0"',
|
|
8
|
+
'"eslint-config-prettier": "^10.1.0"',
|
|
9
|
+
'"globals": "^16.0.0"',
|
|
10
|
+
'"prettier": "3.9.0"'
|
|
11
|
+
] -%}
|
|
12
|
+
{%- if framework == "react" -%}
|
|
13
|
+
{%- set _ = deps.extend(['"react": "^19.2.0"', '"react-dom": "^19.2.0"']) -%}
|
|
14
|
+
{%- set _ = dev_deps.extend(['"@vitejs/plugin-react": "^6.0.0"', '"vite": "^8.1.0"']) -%}
|
|
15
|
+
{%- elif framework == "vue" -%}
|
|
16
|
+
{%- set _ = deps.append('"vue": "^3.5.0"') -%}
|
|
17
|
+
{%- set _ = dev_deps.extend([
|
|
18
|
+
'"@vitejs/plugin-vue": "^6.0.0"',
|
|
19
|
+
'"eslint-plugin-vue": "^10.0.0"',
|
|
20
|
+
'"vite": "^8.1.0"'
|
|
21
|
+
]) -%}
|
|
22
|
+
{%- endif -%}
|
|
23
|
+
{%- if typescript -%}
|
|
24
|
+
{%- set _ = dev_deps.extend(['"@types/node": "^24.0.0"', '"typescript": "^5.9.0"']) -%}
|
|
25
|
+
{%- if not use_biome -%}
|
|
26
|
+
{%- set _ = dev_deps.append('"typescript-eslint": "^8.0.0"') -%}
|
|
27
|
+
{%- endif -%}
|
|
28
|
+
{%- if framework == "react" -%}
|
|
29
|
+
{%- set _ = dev_deps.extend(['"@types/react": "^19.0.0"', '"@types/react-dom": "^19.0.0"']) -%}
|
|
30
|
+
{%- elif framework == "vue" -%}
|
|
31
|
+
{%- set _ = dev_deps.append('"vue-tsc": "^3.0.0"') -%}
|
|
32
|
+
{%- endif -%}
|
|
33
|
+
{%- endif -%}
|
|
34
|
+
{%- if with_tests -%}
|
|
35
|
+
{%- set _ = dev_deps.append('"vitest": "^4.1.0"') -%}
|
|
36
|
+
{%- endif -%}
|
|
37
|
+
{
|
|
38
|
+
"name": "{{ project_name }}",
|
|
39
|
+
"version": "0.1.0",
|
|
40
|
+
"description": {{ description | tojson }},
|
|
41
|
+
"private": true,
|
|
42
|
+
"type": "module",
|
|
43
|
+
{%- if author_name %}
|
|
44
|
+
"author": "{{ author_name }}",
|
|
45
|
+
{%- endif %}
|
|
46
|
+
"license": "{{ 'UNLICENSED' if license == 'proprietary' else license }}",
|
|
47
|
+
{%- if package_manager == "pnpm" %}
|
|
48
|
+
"packageManager": "pnpm@10.0.0",
|
|
49
|
+
{%- elif package_manager == "yarn" %}
|
|
50
|
+
"packageManager": "yarn@4.6.0",
|
|
51
|
+
{%- elif package_manager == "bun" %}
|
|
52
|
+
"packageManager": "bun@1.2.0",
|
|
53
|
+
{%- endif %}
|
|
54
|
+
{%- if framework == "none" %}
|
|
55
|
+
"main": "{{ runtime_entry }}",
|
|
56
|
+
{%- endif %}
|
|
57
|
+
"scripts": {
|
|
58
|
+
{%- if framework in ("react", "vue") %}
|
|
59
|
+
"dev": "vite",
|
|
60
|
+
"build": "{% if typescript and framework == 'vue' %}vue-tsc --noEmit && {% elif typescript %}tsc --noEmit && {% endif %}vite build",
|
|
61
|
+
"preview": "vite preview",
|
|
62
|
+
{%- else %}
|
|
63
|
+
"dev": "node {{ source_entry }}",
|
|
64
|
+
"build": "{% if typescript %}tsc -p tsconfig.json{% else %}node --check {{ source_entry }}{% endif %}",
|
|
65
|
+
"start": "node {{ runtime_entry }}",
|
|
66
|
+
{%- endif %}
|
|
67
|
+
"lint": "{% if use_biome %}biome lint .{% else %}eslint .{% endif %}",
|
|
68
|
+
"lint:fix": "{% if use_biome %}biome lint --write .{% else %}eslint . --fix{% endif %}",
|
|
69
|
+
"format": "{% if use_biome %}biome format --write .{% else %}prettier --write .{% endif %}",
|
|
70
|
+
"format:check": "{% if use_biome %}biome format .{% else %}prettier --check .{% endif %}"{% if typescript %},
|
|
71
|
+
"type-check": "{% if framework == 'vue' %}vue-tsc{% else %}tsc{% endif %} --noEmit"{% endif %}{% if with_tests %},
|
|
72
|
+
"test": "vitest run",
|
|
73
|
+
"test:watch": "vitest"{% endif %}
|
|
74
|
+
},
|
|
75
|
+
"dependencies": {% if deps %}{
|
|
76
|
+
{%- for entry in deps %}
|
|
77
|
+
{{ entry }}{% if not loop.last %},{% endif %}
|
|
78
|
+
{%- endfor %}
|
|
79
|
+
}{% else %}{}{% endif %},
|
|
80
|
+
"devDependencies": {
|
|
81
|
+
{%- for entry in dev_deps | sort %}
|
|
82
|
+
{{ entry }}{% if not loop.last %},{% endif %}
|
|
83
|
+
{%- endfor %}
|
|
84
|
+
},
|
|
85
|
+
"engines": {
|
|
86
|
+
"node": ">=24.0.0"
|
|
87
|
+
}
|
|
88
|
+
}
|