shipit-cli 0.11.0__tar.gz → 0.11.1__tar.gz
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.
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/PKG-INFO +1 -1
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/pyproject.toml +1 -1
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/cli.py +10 -1
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/generator.py +6 -2
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/providers/base.py +0 -13
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/providers/php.py +8 -2
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/providers/python.py +1 -1
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/providers/registry.py +0 -2
- shipit_cli-0.11.1/src/shipit/version.py +5 -0
- shipit_cli-0.11.0/src/shipit/providers/gatsby.py +0 -90
- shipit_cli-0.11.0/src/shipit/version.py +0 -5
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/.gitignore +0 -0
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/README.md +0 -0
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/__init__.py +0 -0
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/assets/php/php.ini +0 -0
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/assets/wordpress/install.sh +0 -0
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/assets/wordpress/wp-config.php +0 -0
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/procfile.py +0 -0
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/providers/hugo.py +0 -0
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/providers/laravel.py +0 -0
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/providers/mkdocs.py +0 -0
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/providers/node_static.py +0 -0
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/providers/staticfile.py +0 -0
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/src/shipit/providers/wordpress.py +0 -0
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/tests/test_e2e.py +0 -0
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/tests/test_generate_shipit_examples.py +0 -0
- {shipit_cli-0.11.0 → shipit_cli-0.11.1}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: shipit-cli
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.1
|
|
4
4
|
Summary: Shipit CLI is the best way to build, serve and deploy your projects anywhere.
|
|
5
5
|
Project-URL: homepage, https://wasmer.io
|
|
6
6
|
Project-URL: repository, https://github.com/wasmerio/shipit
|
|
@@ -1491,6 +1491,10 @@ def auto(
|
|
|
1491
1491
|
None,
|
|
1492
1492
|
help="The environment to use (defaults to `.env`, it will use .env.<env_name> if provided)",
|
|
1493
1493
|
),
|
|
1494
|
+
use_provider: Optional[str] = typer.Option(
|
|
1495
|
+
None,
|
|
1496
|
+
help="Use a specific provider to build the project.",
|
|
1497
|
+
),
|
|
1494
1498
|
):
|
|
1495
1499
|
if not path.exists():
|
|
1496
1500
|
raise Exception(f"The path {path} does not exist")
|
|
@@ -1503,6 +1507,7 @@ def auto(
|
|
|
1503
1507
|
install_command=install_command,
|
|
1504
1508
|
build_command=build_command,
|
|
1505
1509
|
start_command=start_command,
|
|
1510
|
+
use_provider=use_provider,
|
|
1506
1511
|
)
|
|
1507
1512
|
|
|
1508
1513
|
build(
|
|
@@ -1561,6 +1566,10 @@ def generate(
|
|
|
1561
1566
|
None,
|
|
1562
1567
|
help="The start command to use (overwrites the default)",
|
|
1563
1568
|
),
|
|
1569
|
+
use_provider: Optional[str] = typer.Option(
|
|
1570
|
+
None,
|
|
1571
|
+
help="Use a specific provider to build the project.",
|
|
1572
|
+
),
|
|
1564
1573
|
):
|
|
1565
1574
|
if not path.exists():
|
|
1566
1575
|
raise Exception(f"The path {path} does not exist")
|
|
@@ -1591,7 +1600,7 @@ def generate(
|
|
|
1591
1600
|
custom_commands.install = install_command
|
|
1592
1601
|
if build_command:
|
|
1593
1602
|
custom_commands.build = build_command
|
|
1594
|
-
content = generate_shipit(path, custom_commands)
|
|
1603
|
+
content = generate_shipit(path, custom_commands, use_provider=use_provider)
|
|
1595
1604
|
out.write_text(content)
|
|
1596
1605
|
console.print(f"[bold]Generated Shipit[/bold] at {out.absolute()}")
|
|
1597
1606
|
|
|
@@ -84,8 +84,12 @@ def _emit_dependencies_declarations(
|
|
|
84
84
|
return "\n".join(lines), serve_vars, build_vars
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
def generate_shipit(path: Path, custom_commands: CustomCommands) -> str:
|
|
88
|
-
provider_cls =
|
|
87
|
+
def generate_shipit(path: Path, custom_commands: CustomCommands, use_provider: Optional[str] = None) -> str:
|
|
88
|
+
provider_cls = None
|
|
89
|
+
if use_provider:
|
|
90
|
+
provider_cls = next((p for p in _providers() if p.name().lower() == use_provider.lower()), None)
|
|
91
|
+
if not provider_cls:
|
|
92
|
+
provider_cls = detect_provider(path, custom_commands)
|
|
89
93
|
provider = provider_cls(path, custom_commands)
|
|
90
94
|
|
|
91
95
|
# Collect parts
|
|
@@ -92,16 +92,3 @@ class ProviderPlan:
|
|
|
92
92
|
|
|
93
93
|
def _exists(path: Path, *candidates: str) -> bool:
|
|
94
94
|
return any((path / c).exists() for c in candidates)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
def _has_dependency(pkg_json: Path, dep: str) -> bool:
|
|
98
|
-
try:
|
|
99
|
-
import json
|
|
100
|
-
|
|
101
|
-
data = json.loads(pkg_json.read_text())
|
|
102
|
-
for section in ("dependencies", "devDependencies", "peerDependencies"):
|
|
103
|
-
if dep in data.get(section, {}):
|
|
104
|
-
return True
|
|
105
|
-
except Exception:
|
|
106
|
-
return False
|
|
107
|
-
return False
|
|
@@ -20,7 +20,9 @@ class PhpProvider:
|
|
|
20
20
|
def __init__(self, path: Path, custom_commands: CustomCommands):
|
|
21
21
|
self.path = path
|
|
22
22
|
self.custom_commands = custom_commands
|
|
23
|
-
self.has_composer = _exists(self.path, "composer.json", "composer.lock")
|
|
23
|
+
self.has_composer = _exists(self.path, "composer.json", "composer.lock") or (
|
|
24
|
+
custom_commands.install and custom_commands.install.startswith("composer ")
|
|
25
|
+
)
|
|
24
26
|
|
|
25
27
|
@classmethod
|
|
26
28
|
def name(cls) -> str:
|
|
@@ -40,6 +42,8 @@ class PhpProvider:
|
|
|
40
42
|
return DetectResult(cls.name(), 10)
|
|
41
43
|
if custom_commands.start and custom_commands.start.startswith("php "):
|
|
42
44
|
return DetectResult(cls.name(), 70)
|
|
45
|
+
if custom_commands.install and custom_commands.install.startswith("composer "):
|
|
46
|
+
return DetectResult(cls.name(), 30)
|
|
43
47
|
return None
|
|
44
48
|
|
|
45
49
|
def initialize(self) -> None:
|
|
@@ -115,7 +119,9 @@ class PhpProvider:
|
|
|
115
119
|
}
|
|
116
120
|
elif _exists(self.path, "index.php"):
|
|
117
121
|
return {"start": '"php -S localhost:{} -t {}".format(PORT, app["serve"])'}
|
|
118
|
-
return {
|
|
122
|
+
return {
|
|
123
|
+
"start": '"php -S localhost:{} -t {}".format(PORT, app["serve"])',
|
|
124
|
+
}
|
|
119
125
|
|
|
120
126
|
def mounts(self) -> list[MountSpec]:
|
|
121
127
|
return [
|
|
@@ -216,7 +216,7 @@ class PythonProvider:
|
|
|
216
216
|
return DetectResult(cls.name(), 70)
|
|
217
217
|
return DetectResult(cls.name(), 50)
|
|
218
218
|
if custom_commands.start:
|
|
219
|
-
if custom_commands.start.startswith("python ") or custom_commands.start.startswith("uv ") or custom_commands.start.startswith("uvicorn "):
|
|
219
|
+
if custom_commands.start.startswith("python ") or custom_commands.start.startswith("uv ") or custom_commands.start.startswith("uvicorn ") or custom_commands.start.startswith("gunicorn "):
|
|
220
220
|
return DetectResult(cls.name(), 80)
|
|
221
221
|
return None
|
|
222
222
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from .base import Provider
|
|
4
|
-
from .gatsby import GatsbyProvider
|
|
5
4
|
from .hugo import HugoProvider
|
|
6
5
|
from .laravel import LaravelProvider
|
|
7
6
|
from .mkdocs import MkdocsProvider
|
|
@@ -16,7 +15,6 @@ def providers() -> list[type[Provider]]:
|
|
|
16
15
|
# Order matters: more specific providers first
|
|
17
16
|
return [
|
|
18
17
|
LaravelProvider,
|
|
19
|
-
# GatsbyProvider,
|
|
20
18
|
HugoProvider,
|
|
21
19
|
MkdocsProvider,
|
|
22
20
|
PythonProvider,
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from pathlib import Path
|
|
4
|
-
from typing import Dict, Optional
|
|
5
|
-
|
|
6
|
-
from .base import (
|
|
7
|
-
DetectResult,
|
|
8
|
-
DependencySpec,
|
|
9
|
-
Provider,
|
|
10
|
-
_exists,
|
|
11
|
-
_has_dependency,
|
|
12
|
-
MountSpec,
|
|
13
|
-
ServiceSpec,
|
|
14
|
-
VolumeSpec,
|
|
15
|
-
CustomCommands,
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class GatsbyProvider:
|
|
20
|
-
def __init__(self, path: Path, custom_commands: CustomCommands):
|
|
21
|
-
self.path = path
|
|
22
|
-
self.custom_commands = custom_commands
|
|
23
|
-
|
|
24
|
-
@classmethod
|
|
25
|
-
def name(cls) -> str:
|
|
26
|
-
return "gatsby"
|
|
27
|
-
|
|
28
|
-
@classmethod
|
|
29
|
-
def detect(cls, path: Path, custom_commands: CustomCommands) -> Optional[DetectResult]:
|
|
30
|
-
pkg = path / "package.json"
|
|
31
|
-
if not pkg.exists():
|
|
32
|
-
return None
|
|
33
|
-
if _exists(path, "gatsby-config.js", "gatsby-config.ts") or _has_dependency(
|
|
34
|
-
pkg, "gatsby"
|
|
35
|
-
):
|
|
36
|
-
return DetectResult(cls.name(), 90)
|
|
37
|
-
return None
|
|
38
|
-
|
|
39
|
-
def initialize(self) -> None:
|
|
40
|
-
pass
|
|
41
|
-
|
|
42
|
-
def serve_name(self) -> str:
|
|
43
|
-
return self.path.name
|
|
44
|
-
|
|
45
|
-
def provider_kind(self) -> str:
|
|
46
|
-
return "staticsite"
|
|
47
|
-
|
|
48
|
-
def platform(self) -> Optional[str]:
|
|
49
|
-
return "gatsby"
|
|
50
|
-
|
|
51
|
-
def declarations(self) -> Optional[str]:
|
|
52
|
-
return None
|
|
53
|
-
|
|
54
|
-
def dependencies(self) -> list[DependencySpec]:
|
|
55
|
-
return [
|
|
56
|
-
DependencySpec(
|
|
57
|
-
"node",
|
|
58
|
-
env_var="SHIPIT_NODE_VERSION",
|
|
59
|
-
default_version="22",
|
|
60
|
-
use_in_build=True,
|
|
61
|
-
),
|
|
62
|
-
DependencySpec("npm", use_in_build=True),
|
|
63
|
-
DependencySpec("static-web-server", env_var="SHIPIT_SWS_VERSION", use_in_serve=True),
|
|
64
|
-
]
|
|
65
|
-
|
|
66
|
-
def build_steps(self) -> list[str]:
|
|
67
|
-
return [
|
|
68
|
-
"run(\"npm install\", inputs=[\"package.json\", \"package-lock.json\"], group=\"install\")",
|
|
69
|
-
"copy(\".\", \".\", ignore=[\"node_modules\", \".git\"])",
|
|
70
|
-
"run(\"npm run build\", outputs=[\"public\"], group=\"build\")",
|
|
71
|
-
"run(\"cp -R public/* {}/\".format(app[\"build\"]))",
|
|
72
|
-
]
|
|
73
|
-
|
|
74
|
-
def prepare_steps(self) -> Optional[list[str]]:
|
|
75
|
-
return None
|
|
76
|
-
|
|
77
|
-
def commands(self) -> Dict[str, str]:
|
|
78
|
-
return {"start": '"static-web-server --root /app"'}
|
|
79
|
-
|
|
80
|
-
def mounts(self) -> list[MountSpec]:
|
|
81
|
-
return [MountSpec("app")]
|
|
82
|
-
|
|
83
|
-
def volumes(self) -> list[VolumeSpec]:
|
|
84
|
-
return []
|
|
85
|
-
|
|
86
|
-
def env(self) -> Optional[Dict[str, str]]:
|
|
87
|
-
return None
|
|
88
|
-
|
|
89
|
-
def services(self) -> list[ServiceSpec]:
|
|
90
|
-
return []
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|