shipit-cli 0.17.13__tar.gz → 0.18.0__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.
Files changed (42) hide show
  1. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/PKG-INFO +1 -1
  2. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/pyproject.toml +1 -1
  3. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/assets/wordpress/wp-config.php +0 -4
  4. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/generator.py +1 -1
  5. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/providers/base.py +0 -1
  6. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/providers/go.py +0 -3
  7. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/providers/hugo.py +0 -3
  8. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/providers/jekyll.py +0 -3
  9. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/providers/laravel.py +18 -35
  10. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/providers/mkdocs.py +0 -3
  11. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/providers/node_static.py +30 -12
  12. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/providers/php.py +22 -6
  13. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/providers/python.py +0 -3
  14. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/providers/staticfile.py +0 -3
  15. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/providers/wordpress.py +0 -3
  16. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/runners/wasmer.py +2 -1
  17. shipit_cli-0.18.0/src/shipit/version.py +5 -0
  18. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/tests/test_wordpress_phpix.py +1 -0
  19. shipit_cli-0.17.13/src/shipit/version.py +0 -5
  20. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/.gitignore +0 -0
  21. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/README.md +0 -0
  22. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/__init__.py +0 -0
  23. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/assets/php/php.ini +0 -0
  24. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/assets/wordpress/.htaccess +0 -0
  25. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/assets/wordpress/install.sh +0 -0
  26. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/assets/wordpress/start.php +0 -0
  27. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/builders/__init__.py +0 -0
  28. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/builders/base.py +0 -0
  29. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/builders/docker.py +0 -0
  30. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/builders/local.py +0 -0
  31. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/cli.py +0 -0
  32. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/procfile.py +0 -0
  33. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/providers/registry.py +0 -0
  34. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/runners/__init__.py +0 -0
  35. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/runners/base.py +0 -0
  36. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/runners/local.py +0 -0
  37. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/shipit_types.py +0 -0
  38. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/ui.py +0 -0
  39. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/src/shipit/utils.py +0 -0
  40. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/tests/test_e2e.py +0 -0
  41. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/tests/test_generate_shipit_examples.py +0 -0
  42. {shipit_cli-0.17.13 → shipit_cli-0.18.0}/tests/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shipit-cli
3
- Version: 0.17.13
3
+ Version: 0.18.0
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "shipit-cli"
3
- version = "0.17.13"
3
+ version = "0.18.0"
4
4
  description = "Shipit CLI is the best way to build, serve and deploy your projects anywhere."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -213,7 +213,3 @@ wpdefine_load_env_defines();
213
213
 
214
214
  /** Sets up WordPress vars and included files. */
215
215
  require_once ABSPATH . 'wp-settings.php';
216
-
217
- if ( PHP_SAPI === 'phpix' ) {
218
- add_filter( 'got_rewrite', '__return_true' );
219
- }
@@ -109,7 +109,7 @@ def generate_shipit(path: Path, provider: Provider) -> str:
109
109
 
110
110
  # Collect parts
111
111
  plan = ProviderPlan(
112
- serve_name=provider.serve_name() or default_serve_name,
112
+ serve_name=default_serve_name,
113
113
  provider=provider.name(),
114
114
  mounts=provider.mounts(),
115
115
  volumes=provider.volumes(),
@@ -67,7 +67,6 @@ class Provider(Protocol):
67
67
  cls, path: Path, config: Config
68
68
  ) -> Optional[DetectResult]: ...
69
69
  # Structured plan steps (no path args; use self.path)
70
- def serve_name(self) -> Optional[str]: ...
71
70
  def dependencies(self) -> list["DependencySpec"]: ...
72
71
  def declarations(self) -> Optional[str]: ...
73
72
  def build_steps(self) -> list[str]: ...
@@ -70,9 +70,6 @@ class GoProvider(Provider):
70
70
  return DetectResult(cls.name(), 80)
71
71
  return None
72
72
 
73
- def serve_name(self) -> Optional[str]:
74
- return None
75
-
76
73
  def dependencies(self) -> list[DependencySpec]:
77
74
  return [
78
75
  DependencySpec(
@@ -98,9 +98,6 @@ class HugoProvider(StaticFileProvider):
98
98
  return DetectResult(cls.name(), 80)
99
99
  return None
100
100
 
101
- def serve_name(self) -> Optional[str]:
102
- return None
103
-
104
101
  def dependencies(self) -> list[DependencySpec]:
105
102
  return [
106
103
  DependencySpec(
@@ -68,9 +68,6 @@ class JekyllProvider(StaticFileProvider):
68
68
  return DetectResult(cls.name(), 85)
69
69
  return None
70
70
 
71
- def serve_name(self) -> Optional[str]:
72
- return None
73
-
74
71
  def dependencies(self) -> list[DependencySpec]:
75
72
  return [
76
73
  DependencySpec(
@@ -30,6 +30,7 @@ class LaravelProvider(PhpProvider):
30
30
  @classmethod
31
31
  def load_config(cls, path: Path, base_config: Config) -> LaravelConfig:
32
32
  config = super().load_config(path, base_config)
33
+ config.use_composer = True
33
34
  node_config = NodeStaticProvider.load_config(path, base_config)
34
35
  node_config.static_dir = None
35
36
  node_config.static_generator = None
@@ -51,63 +52,45 @@ class LaravelProvider(PhpProvider):
51
52
  return DetectResult(cls.name(), 95)
52
53
  return None
53
54
 
54
- def serve_name(self) -> Optional[str]:
55
- return None
56
-
57
55
  def dependencies(self) -> list[DependencySpec]:
58
- php_dependency = "phpix" if self.config.phpix else "php"
59
56
  return [
60
- DependencySpec(
61
- php_dependency,
62
- var_name="config.php_version",
63
- use_in_build=True,
64
- use_in_serve=True,
65
- ),
66
- DependencySpec("composer", use_in_build=True),
67
- # DependencySpec("pie", use_in_build=True),
68
- *self.node_provider.dependencies(),
69
- DependencySpec("bash", use_in_serve=True),
57
+ *super().dependencies(),
58
+ *self.node_provider.dependencies()
70
59
  ]
71
60
 
72
61
  def build_steps(self) -> list[str]:
73
- return [
74
- 'env(COMPOSER_HOME="/tmp", COMPOSER_FUND="0", COMPOSER_ALLOW_SUPERUSER="1")',
75
- 'workdir(app.path)',
76
- # "run(\"pie install php/pdo_pgsql\")",
77
- 'run("composer install --optimize-autoloader --no-scripts --no-interaction", inputs=["composer.json", "composer.lock", "artisan"], outputs=["."], group="install")',
78
- *self.node_provider.build_steps(),
79
- ]
62
+ node_install = list(self.node_provider.build_steps_install())
63
+ node_build = list(self.node_provider.build_steps_build())
64
+ return super().build_steps_with_options(
65
+ extra_ignore=["node_modules"],
66
+ after_install=node_install,
67
+ after_build=node_build
68
+ )
80
69
 
81
70
  def prepare_steps(self) -> Optional[list[str]]:
82
- php_script = "phpix" if self.config.phpix else "php"
83
71
  return [
84
72
  'workdir(app.serve_path)',
85
73
  'run("mkdir -p storage/framework/{sessions,views,cache,testing} storage/logs bootstrap/cache")',
86
- f'run("{php_script} artisan config:cache")',
87
- f'run("{php_script} artisan event:cache")',
88
- f'run("{php_script} artisan route:cache")',
89
- f'run("{php_script} artisan view:cache")',
74
+ 'run("php artisan config:cache")',
75
+ 'run("php artisan event:cache")',
76
+ 'run("php artisan route:cache")',
77
+ 'run("php artisan view:cache")',
90
78
  ]
91
79
 
92
80
  def commands(self) -> Dict[str, str]:
93
- php_script = "phpix" if self.config.phpix else "php"
94
81
  return {
95
- "start": f'f"{php_script} -S localhost:{{PORT}} -t public"',
96
- "after_deploy": f'"{php_script} artisan migrate"',
82
+ "start": 'f"php -S localhost:{PORT} -t public"',
83
+ "after_deploy": '"php artisan migrate"',
97
84
  }
98
85
 
99
86
  def mounts(self) -> list[MountSpec]:
100
- return [MountSpec("app"), *self.node_provider.mounts()]
87
+ return [*super().mounts(), *self.node_provider.mounts()]
101
88
 
102
89
  def volumes(self) -> list[VolumeSpec]:
103
90
  return []
104
91
 
105
92
  def env(self) -> Optional[Dict[str, str]]:
106
- if self.config.phpix and self.config.phpix_worker_threads:
107
- return {
108
- "PHPIX_PHP_THREADS": f'"{self.config.phpix_worker_threads}"',
109
- }
110
- return None
93
+ return super().env()
111
94
 
112
95
  def services(self) -> list[ServiceSpec]:
113
96
  return []
@@ -55,9 +55,6 @@ class MkdocsProvider(StaticFileProvider):
55
55
  return DetectResult(cls.name(), 85)
56
56
  return None
57
57
 
58
- def serve_name(self) -> Optional[str]:
59
- return None
60
-
61
58
  def dependencies(self) -> list[DependencySpec]:
62
59
  return [
63
60
  *self.python_provider.dependencies(),
@@ -349,9 +349,6 @@ class NodeStaticProvider(StaticFileProvider):
349
349
  return DetectResult(cls.name(), 40)
350
350
  return None
351
351
 
352
- def serve_name(self) -> Optional[str]:
353
- return None
354
-
355
352
  def dependencies(self) -> list[DependencySpec]:
356
353
  package_manager_dep = self.config.package_manager.as_dependency(self.path)
357
354
  package_manager_dep.use_in_build = True
@@ -362,7 +359,7 @@ class NodeStaticProvider(StaticFileProvider):
362
359
  use_in_build=True,
363
360
  ),
364
361
  package_manager_dep,
365
- *super().dependencies(),
362
+ *(super().dependencies() if not self.only_build else []),
366
363
  ]
367
364
 
368
365
  @classmethod
@@ -383,34 +380,55 @@ class NodeStaticProvider(StaticFileProvider):
383
380
  command = static_generator.build_command()
384
381
  return package_manager.run_execute_command(command)
385
382
 
386
- def build_steps(self) -> list[str]:
383
+ def build_steps_install(self) -> list[str]:
387
384
  lockfile = self.config.package_manager.lockfile()
388
385
  has_lockfile = (self.path / lockfile).exists()
389
386
  install_command = self.config.package_manager.install_command(
390
387
  has_lockfile=has_lockfile
391
388
  )
392
- ignored_files = ["node_modules", ".git"]
393
- if has_lockfile:
394
- ignored_files.append(lockfile)
395
- all_ignored_files = ", ".join([f'"{file}"' for file in ignored_files])
396
-
397
389
  return filter(
398
390
  None,
399
391
  [
400
- 'workdir(temp.path)' if not self.only_build else None,
401
392
  f'copy("{lockfile}")' if has_lockfile else None,
402
393
  'env(CI="true", NODE_ENV="production", NPM_CONFIG_FUND="false")'
403
394
  if self.config.package_manager == PackageManager.NPM
404
395
  else None,
405
396
  # 'run("npx corepack enable", inputs=["package.json"], group="install")',
406
397
  f'run("{install_command}", inputs=["package.json"], group="install")',
407
- f'copy(".", ignore=[{all_ignored_files}])',
398
+ ],
399
+ )
400
+
401
+ def build_steps_build(self) -> list[str]:
402
+ return filter(
403
+ None,
404
+ [
408
405
  f'run("{self.config.build_command}", outputs=[config.static_dir], group="build")'
409
406
  if not self.only_build
410
407
  else None,
411
408
  f'run("{self.config.build_command}", group="build")'
412
409
  if self.only_build
413
410
  else None,
411
+ ]
412
+ )
413
+
414
+ def build_steps(self) -> list[str]:
415
+ lockfile = self.config.package_manager.lockfile()
416
+ has_lockfile = (self.path / lockfile).exists()
417
+ install_command = self.config.package_manager.install_command(
418
+ has_lockfile=has_lockfile
419
+ )
420
+ ignored_files = ["node_modules", ".git"]
421
+ if has_lockfile:
422
+ ignored_files.append(lockfile)
423
+ all_ignored_files = ", ".join([f'"{file}"' for file in ignored_files])
424
+
425
+ return filter(
426
+ None,
427
+ [
428
+ 'workdir(temp.path)' if not self.only_build else None,
429
+ *self.build_steps_install(),
430
+ f'copy(".", ignore=[{all_ignored_files}])',
431
+ *self.build_steps_build(),
414
432
  'run("cp -R {}/* {}/".format(config.static_dir, static_app.path))'
415
433
  if not self.only_build
416
434
  else None,
@@ -83,9 +83,6 @@ class PhpProvider:
83
83
  return DetectResult(cls.name(), 30)
84
84
  return None
85
85
 
86
- def serve_name(self) -> Optional[str]:
87
- return None
88
-
89
86
  def dependencies(self) -> list[DependencySpec]:
90
87
  deps = [
91
88
  DependencySpec(
@@ -104,7 +101,7 @@ class PhpProvider:
104
101
  def declarations(self) -> Optional[str]:
105
102
  return None
106
103
 
107
- def build_steps(self) -> list[str]:
104
+ def build_steps_with_options(self, extra_ignore: Optional[list[str]] = None, after_install: Optional[list[str]] = None, after_build: Optional[list] = None) -> list[str]:
108
105
  steps = [
109
106
  'workdir(app.path)',
110
107
  ]
@@ -121,20 +118,39 @@ class PhpProvider:
121
118
  'run("composer install --optimize-autoloader --ignore-platform-reqs --no-scripts --no-interaction", inputs=["composer.json", "composer.lock"], outputs=["."], group="install")'
122
119
  )
123
120
 
124
- dirs_to_ignore = [".git"]
121
+ if after_install:
122
+ assert isinstance(after_install, list), "after_install must be a list if provided"
123
+ steps = steps + after_install
124
+
125
+ dirs_to_ignore = [".git"]
126
+ if extra_ignore:
127
+ assert isinstance(extra_ignore, list), "extra_ignore must be a list if provided"
128
+ dirs_to_ignore += extra_ignore
129
+
125
130
  if self.config.use_composer:
126
131
  dirs_to_ignore.append("vendor")
127
132
  if self.config.framework == PhpFramework.Symfony:
128
133
  dirs_to_ignore.append("var")
129
134
 
130
- steps.append('copy(".", ".", ignore={})'.format(json.dumps(dirs_to_ignore)))
135
+ steps.append('copy(".", ignore={})'.format(json.dumps(dirs_to_ignore)))
131
136
 
132
137
  # Since we don't run the scripts during the install step, we need to run them after the build step
133
138
  if self.config.use_composer and self.config.composer_build_script:
134
139
  steps.append(f'run("composer run-script {self.config.composer_build_script}", outputs=["."], group="build")')
135
140
 
141
+ if after_build:
142
+ assert isinstance(after_build, list), "after_build must be a list if provided"
143
+ steps = steps + after_build
144
+
136
145
  return steps
137
146
 
147
+ def build_steps(self) -> list[str]:
148
+ return self.build_steps_with_options(
149
+ extra_ignore=None,
150
+ after_install=None,
151
+ after_build=None
152
+ )
153
+
138
154
  def prepare_steps(self) -> Optional[list[str]]:
139
155
  return None
140
156
 
@@ -315,9 +315,6 @@ class PythonProvider:
315
315
  return DetectResult(cls.name(), 10)
316
316
  return None
317
317
 
318
- def serve_name(self) -> Optional[str]:
319
- return None
320
-
321
318
  def dependencies(self) -> list[DependencySpec]:
322
319
  deps = [
323
320
  DependencySpec(
@@ -78,9 +78,6 @@ class StaticFileProvider:
78
78
  return DetectResult(cls.name(), 70)
79
79
  return None
80
80
 
81
- def serve_name(self) -> Optional[str]:
82
- return None
83
-
84
81
  def dependencies(self) -> list[DependencySpec]:
85
82
  return [
86
83
  DependencySpec(
@@ -45,9 +45,6 @@ class WordPressProvider(PhpProvider):
45
45
  return DetectResult(cls.name(), 80)
46
46
  return None
47
47
 
48
- def serve_name(self) -> Optional[str]:
49
- return None
50
-
51
48
  def dependencies(self) -> list[DependencySpec]:
52
49
  return [
53
50
  *super().dependencies(),
@@ -134,7 +134,7 @@ class WasmerRunner:
134
134
  },
135
135
  },
136
136
  "scripts": {"php", "phpix"},
137
- "aliases": {},
137
+ "aliases": {"php": "phpix"},
138
138
  "env": {},
139
139
  },
140
140
  "bash": {
@@ -504,6 +504,7 @@ class WasmerRunner:
504
504
  memory["limit"] = "2Gb"
505
505
  capabilities["memory"] = memory
506
506
  yaml_config["capabilities"] = capabilities
507
+ yaml_config["enable_email"] = True
507
508
 
508
509
  if has_phpix and serve.env and serve.env.get("PHPIX_PHP_THREADS"):
509
510
  app_env = yaml_config.get("env", {})
@@ -0,0 +1,5 @@
1
+ __all__ = ["version", "version_info"]
2
+
3
+
4
+ version = "0.18.0"
5
+ version_info = (0, 18, 0, "final", 0)
@@ -83,4 +83,5 @@ def test_wasmer_app_yaml_sets_memory_limit_for_wordpress_phpix(
83
83
 
84
84
  assert app_yaml["capabilities"]["database"]["engine"] == "mysql"
85
85
  assert app_yaml["capabilities"]["memory"]["limit"] == "2Gb"
86
+ assert app_yaml["enable_email"] is True
86
87
  assert app_yaml["env"]["PHPIX_PHP_THREADS"] == "4"
@@ -1,5 +0,0 @@
1
- __all__ = ["version", "version_info"]
2
-
3
-
4
- version = "0.17.13"
5
- version_info = (0, 17, 13, "final", 0)
File without changes
File without changes