nextpy-framework 2.1.0__tar.gz → 2.3.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 (77) hide show
  1. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/cli.py +108 -9
  2. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy_framework.egg-info/PKG-INFO +1 -1
  3. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/PKG-INFO +1 -1
  4. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/pyproject.toml +1 -1
  5. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/__init__.py +0 -0
  6. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/auth.py +0 -0
  7. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/builder.py +0 -0
  8. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components/__init__.py +0 -0
  9. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components/debug/AutoDebug.py +0 -0
  10. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components/debug/DebugIcon.py +0 -0
  11. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components/debug/DebugIconFixed.py +0 -0
  12. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components/feedback.py +0 -0
  13. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components/form.py +0 -0
  14. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components/head.py +0 -0
  15. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components/hooks_provider.py +0 -0
  16. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components/image.py +0 -0
  17. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components/layout.py +0 -0
  18. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components/link.py +0 -0
  19. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components/loader.py +0 -0
  20. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components/navigation.py +0 -0
  21. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components/toast.py +0 -0
  22. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components/ui.py +0 -0
  23. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components/visual.py +0 -0
  24. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/components.py +0 -0
  25. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/config.py +0 -0
  26. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/core/__init__.py +0 -0
  27. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/core/builder.py +0 -0
  28. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/core/component_renderer.py +0 -0
  29. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/core/component_router.py +0 -0
  30. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/core/data_fetching.py +0 -0
  31. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/core/demo_pages_simple.py +0 -0
  32. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/core/demo_router.py +0 -0
  33. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/core/renderer.py +0 -0
  34. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/core/router.py +0 -0
  35. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/core/sync.py +0 -0
  36. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/db.py +0 -0
  37. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/dev_server.py +0 -0
  38. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/dev_tools.py +0 -0
  39. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/errors.py +0 -0
  40. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/hooks.py +0 -0
  41. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/hooks_provider.py +0 -0
  42. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/hooks_provider_new.py +0 -0
  43. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/jsx.py +0 -0
  44. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/jsx_preprocessor.py +0 -0
  45. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/jsx_transformer.py +0 -0
  46. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/main.py +0 -0
  47. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/performance.py +0 -0
  48. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/plugins/__init__.py +0 -0
  49. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/plugins/base.py +0 -0
  50. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/plugins/builtin.py +0 -0
  51. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/plugins/config.py +0 -0
  52. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/plugins.py +0 -0
  53. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/py.typed +0 -0
  54. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/security.py +0 -0
  55. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/server/__init__.py +0 -0
  56. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/server/app.py +0 -0
  57. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/server/debug.py +0 -0
  58. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/server/middleware.py +0 -0
  59. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/true_jsx.py +0 -0
  60. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/utils/__init__.py +0 -0
  61. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/utils/cache.py +0 -0
  62. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/utils/email.py +0 -0
  63. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/utils/file_upload.py +0 -0
  64. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/utils/logging.py +0 -0
  65. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/utils/search.py +0 -0
  66. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/utils/seo.py +0 -0
  67. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/utils/validators.py +0 -0
  68. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy/websocket.py +0 -0
  69. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy_framework.egg-info/SOURCES.txt +0 -0
  70. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy_framework.egg-info/dependency_links.txt +0 -0
  71. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy_framework.egg-info/entry_points.txt +0 -0
  72. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy_framework.egg-info/requires.txt +0 -0
  73. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/.nextpy_framework/nextpy_framework.egg-info/top_level.txt +0 -0
  74. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/LICENSE +0 -0
  75. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/README.md +0 -0
  76. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/setup.cfg +0 -0
  77. {nextpy_framework-2.1.0 → nextpy_framework-2.3.0}/tests/test_routing.py +0 -0
@@ -272,7 +272,7 @@ def dev(port: int, host: str, reload: bool, debug: bool):
272
272
  if dir_path.exists():
273
273
  existing_reload_dirs.append(reload_dir)
274
274
  if debug:
275
- click.echo(f" 📁 Watching: {reload_dir}/", dim=True)
275
+ click.echo(click.style(f" 📁 Watching: {reload_dir}/"))
276
276
 
277
277
  # Enhanced reload patterns for JSX files
278
278
  reload_includes = [
@@ -529,7 +529,7 @@ def version():
529
529
  click.echo(click.style("\n 📋 NextPy Framework Info", fg="cyan", bold=True))
530
530
  click.echo(click.style(" ===================\n", fg="cyan"))
531
531
 
532
- click.echo(f" 🏷️ Version: 2.0.0")
532
+ click.echo(f" 🏷️ Version: 2.2.0")
533
533
  click.echo(f" 🐍 Python: {sys.version.split()[0]}")
534
534
  click.echo(f" ⚡ Framework: NextPy")
535
535
  click.echo(f" 🎨 Architecture: True JSX")
@@ -758,7 +758,7 @@ def {name.title()}(props = None):
758
758
  title = props.get("title", "{name.title()} Page")
759
759
 
760
760
  return (
761
- <div class="max-w-4xl mx-auto px-4 py-12">
761
+ <div class="max-w-4xl px-4 py-12 mx-auto">
762
762
  <h1 class="mb-6 text-4xl font-bold text-gray-900">{{title}}</h1>
763
763
  <p class="text-lg text-gray-600">
764
764
  This is the {name} page generated by NextPy.
@@ -912,9 +912,9 @@ def About(props = None):
912
912
  description = props.get("description", "Learn about the NextPy framework")
913
913
 
914
914
  return (
915
- <div class="max-w-4xl mx-auto px-4 py-12">
915
+ <div class="max-w-4xl px-4 py-12 mx-auto">
916
916
  <h1 class="mb-6 text-4xl font-bold text-gray-900">{title}</h1>
917
- <p class="text-lg text-gray-600 mb-4">{description}</p>
917
+ <p class="mb-4 text-lg text-gray-600">{description}</p>
918
918
  <p class="text-gray-700">
919
919
  NextPy is a Python web framework inspired by Next.js, offering file-based routing,
920
920
  server-side rendering, static site generation, and a modern True JSX component-based architecture.
@@ -977,9 +977,9 @@ def Layout(props = None):
977
977
  children = props.get("children", "")
978
978
 
979
979
  return (
980
- <div class="min-h-screen flex flex-col">
980
+ <div class="flex flex-col min-h-screen">
981
981
  <header class="bg-white shadow-sm">
982
- <div class="max-w-7xl mx-auto px-4 py-4">
982
+ <div class="px-4 py-4 mx-auto max-w-7xl">
983
983
  <div class="flex items-center justify-between">
984
984
  <h1 class="text-2xl font-bold text-gray-900">{title}</h1>
985
985
  <nav class="flex space-x-4">
@@ -992,8 +992,8 @@ def Layout(props = None):
992
992
  <main class="flex-1">
993
993
  {children}
994
994
  </main>
995
- <footer class="bg-gray-100 mt-auto">
996
- <div class="max-w-7xl mx-auto px-4 py-6 text-center text-gray-600">
995
+ <footer class="mt-auto bg-gray-100">
996
+ <div class="px-4 py-6 mx-auto text-center text-gray-600 max-w-7xl">
997
997
  <p>© 2025 NextPy Framework. All rights reserved.</p>
998
998
  </div>
999
999
  </footer>
@@ -1147,6 +1147,105 @@ pyjwt>=2.8.0
1147
1147
  markdown>=3.0.0 # Added markdown for documentation rendering
1148
1148
  ''')
1149
1149
  click.echo(" Created: requirements.txt")
1150
+
1151
+ # Create main.py file for ASGI app
1152
+ (project_dir / "main.py").write_text('''"""NextPy ASGI Application Entry Point"""
1153
+
1154
+ from fastapi import FastAPI
1155
+ from nextpy.server.app import NextPyApp
1156
+ from nextpy.core.router import Router
1157
+ from pathlib import Path
1158
+ import os
1159
+
1160
+ # Create NextPy app
1161
+ app = NextPyApp()
1162
+
1163
+ # Configure pages directory
1164
+ pages_dir = Path("pages")
1165
+ if pages_dir.exists():
1166
+ router = Router(pages_dir=pages_dir)
1167
+ app.add_router(router)
1168
+
1169
+ # Add debug icon in development
1170
+ if os.getenv("DEVELOPMENT") or os.getenv("DEBUG") or os.getenv("NEXTPY_DEBUG"):
1171
+ from nextpy.components.debug.AutoDebug import AutoDebug
1172
+ app.add_middleware(AutoDebug)
1173
+
1174
+ # Health check endpoint
1175
+ @app.get("/health")
1176
+ async def health_check():
1177
+ return {"status": "healthy", "framework": "NextPy"}
1178
+
1179
+ # Root endpoint
1180
+ @app.get("/")
1181
+ async def root():
1182
+ return {"message": "NextPy is running!", "docs": "/docs"}
1183
+
1184
+ if __name__ == "__main__":
1185
+ import uvicorn
1186
+ uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)
1187
+ ''')
1188
+ click.echo(" Created: main.py")
1189
+
1190
+ # Create .env file for development
1191
+ (project_dir / ".env").write_text('''# NextPy Development Environment
1192
+ DEVELOPMENT=true
1193
+ DEBUG=true
1194
+ NEXTPY_DEBUG=true
1195
+
1196
+ # Server Configuration
1197
+ HOST=0.0.0.0
1198
+ PORT=8000
1199
+
1200
+ # Database (if needed)
1201
+ DATABASE_URL=sqlite:///./app.db
1202
+
1203
+ # Secret Key
1204
+ SECRET_KEY=your-secret-key-here
1205
+
1206
+ # NextPy Settings
1207
+ NEXTPY_DEBUG_ICON=true
1208
+ NEXTPY_HOT_RELOAD=true
1209
+ NEXTPY_LOG_LEVEL=info
1210
+ ''')
1211
+ click.echo(" Created: .env")
1212
+
1213
+ # Install VS Code extension if available
1214
+ try:
1215
+ import sys
1216
+ import subprocess
1217
+ from pathlib import Path
1218
+
1219
+ # Check if VS Code is available
1220
+ result = subprocess.run([sys.executable, "-c", "import vscode"],
1221
+ capture_output=True, text=True)
1222
+
1223
+ if result.returncode == 0:
1224
+ extension_id = "nextpy.nextpy-vscode"
1225
+
1226
+ # Check if extension is already installed
1227
+ check_cmd = ["code", "--list-extensions", "--show-versions", extension_id]
1228
+ check_result = subprocess.run(check_cmd, capture_output=True, text=True)
1229
+
1230
+ if extension_id not in check_result.stdout:
1231
+ click.echo(click.style(" 🔌 Installing NextPy VS Code extension...", fg="blue"))
1232
+
1233
+ # Try to install from marketplace
1234
+ install_cmd = ["code", "--install-extension", extension_id]
1235
+ install_result = subprocess.run(install_cmd, capture_output=True, text=True)
1236
+
1237
+ if install_result.returncode == 0:
1238
+ click.echo(click.style(" ✅ NextPy VS Code extension installed!", fg="green"))
1239
+ click.echo(click.style(" 📝 Restart VS Code to activate", fg="yellow"))
1240
+ else:
1241
+ click.echo(click.style(" ⚠️ Extension installation failed", fg="orange"))
1242
+ click.echo(" 💡 Install manually: code --install-extension nextpy.nextpy-vscode")
1243
+ else:
1244
+ click.echo(click.style(" ✅ NextPy VS Code extension already installed", fg="green"))
1245
+ else:
1246
+ click.echo(click.style(" ⚠️ VS Code not available", fg="orange"))
1247
+ except Exception as e:
1248
+ click.echo(click.style(f" ⚠️ Could not install VS Code extension: {e}", fg="orange"))
1150
1249
 
1151
1250
 
1152
1251
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nextpy-framework
3
- Version: 2.1.0
3
+ Version: 2.3.0
4
4
  Summary: A Python web framework inspired by Next.js with file-based routing, SSR, and SSG and more
5
5
  Author: NextPy Team
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nextpy-framework
3
- Version: 2.1.0
3
+ Version: 2.3.0
4
4
  Summary: A Python web framework inspired by Next.js with file-based routing, SSR, and SSG and more
5
5
  Author: NextPy Team
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "nextpy-framework"
7
- version = "2.1.0"
7
+ version = "2.3.0"
8
8
  description = "A Python web framework inspired by Next.js with file-based routing, SSR, and SSG and more"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"