nexus-framework 0.3.2__tar.gz → 0.4.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.
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/PKG-INFO +1 -1
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/pyproject.toml +1 -1
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/__init__.py +1 -1
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/studio/manager.py +273 -0
- nexus_framework-0.4.0/src/nexus/porter/__init__.py +14 -0
- nexus_framework-0.4.0/src/nexus/porter/converters/base.py +46 -0
- nexus_framework-0.4.0/src/nexus/porter/converters/django.py +256 -0
- nexus_framework-0.4.0/src/nexus/porter/converters/flask.py +232 -0
- nexus_framework-0.4.0/src/nexus/porter/converters/laravel.py +452 -0
- nexus_framework-0.4.0/src/nexus/porter/converters/reverse.py +277 -0
- nexus_framework-0.4.0/src/nexus/porter/detector.py +73 -0
- nexus_framework-0.4.0/src/nexus/porter/manager.py +97 -0
- nexus_framework-0.4.0/src/nexus/porter/porter_service_provider.py +15 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/routing/router.py +61 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/starters/standard.py +1 -1
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus_framework.egg-info/PKG-INFO +1 -1
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus_framework.egg-info/SOURCES.txt +9 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/README.md +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/setup.cfg +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/application.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/auth/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/auth/access/gate.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/auth/auth_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/auth/authenticatable.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/auth/guard.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/auth/hashing.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/auth/manager.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/auth/middleware.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/auth/sanctum/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/auth/sanctum/guard.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/auth/sanctum/has_api_tokens.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/auth/sanctum/middleware.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/auth/sanctum/migration.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/auth/sanctum/new_access_token.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/auth/sanctum/personal_access_token.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/auth/user_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/cache/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/cache/cache_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/cache/driver.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/cache/manager.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/cache/store.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/config/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/config/repository.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/cli.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/command.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/commands/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/commands/clear.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/commands/config.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/commands/database.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/commands/db_reverse.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/commands/install_tools.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/commands/key_generate.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/commands/make.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/commands/new_command.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/commands/queue.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/commands/route_list.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/commands/schedule.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/commands/serve.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/commands/starter.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/commands/tinker.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/console_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/generators/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/generators/stubs.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/console/kernel.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/container/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/container/container.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/container/exceptions.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/connection.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/database_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/factory.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/migrations/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/migrations/migration.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/migrations/migrator.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/models/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/models/exceptions.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/models/model.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/models/relations/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/models/relations/base.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/models/relations/belongs_to.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/models/relations/belongs_to_many.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/models/relations/has_many.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/models/relations/has_one.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/models/soft_deletes.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/query/builder.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/schema/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/schema/blueprint.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/schema/schema.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/seeder.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/database/studio/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/events/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/events/dispatcher.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/events/event_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/exceptions/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/exceptions/exception_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/exceptions/handler.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/app.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/artisan.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/auth.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/cache.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/config.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/date.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/db.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/event.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/facade.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/gate.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/hash.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/inertia.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/log.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/mail.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/notification.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/queue.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/rate_limiter.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/request.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/route.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/schedule.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/schema.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/session.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/storage.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/telescope.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/url.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/validator.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/facades/view.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/filesystem/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/filesystem/driver.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/filesystem/filesystem_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/filesystem/manager.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/foundation/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/foundation/application.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/foundation/provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/foundation/runner.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/foundation/service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/http/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/http/exceptions.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/http/middleware.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/http/request.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/http/requests/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/http/requests/form_request.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/http/resources/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/http/resources/json_resource.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/http/resources/resource_collection.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/http/response.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/http/uploaded_file.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/inertia/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/inertia/helpers.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/inertia/inertia.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/inertia/inertia_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/inertia/lazy.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/inertia/middleware.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/inertia/response.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/logging/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/logging/logging_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/logging/manager.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/mail/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/mail/mail_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/mail/mailable.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/mail/manager.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/mail/transport.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/notifications/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/notifications/manager.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/notifications/notification.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/notifications/notification_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/py.typed +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/queue/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/queue/driver.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/queue/job.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/queue/manager.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/queue/queue_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/queue/worker.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/routing/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/routing/limiter.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/routing/route.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/routing/throttle.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/routing/url.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/schedule/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/schedule/event.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/schedule/schedule.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/schedule/schedule_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/security/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/security/cors.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/security/csrf.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/security/headers.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/session/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/session/driver.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/session/manager.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/session/middleware.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/session/session.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/session/session_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/starters/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/starters/api.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/starters/inertia.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/starters/openapi.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/starters/web.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/support/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/support/arr.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/support/carbon.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/support/collection.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/support/env.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/support/helpers.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/support/str.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/telescope/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/telescope/debugbar.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/telescope/entry.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/telescope/middleware.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/telescope/telescope.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/telescope/telescope_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/testing/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/testing/client.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/testing/database.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/testing/fakes/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/testing/fakes/event_fake.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/testing/fakes/log_fake.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/testing/fakes/mail_fake.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/testing/fakes/notification_fake.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/testing/fakes/queue_fake.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/testing/fakes/storage_fake.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/testing/response.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/testing/test_case.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/testing/time.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/validation/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/validation/rule.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/validation/validation_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/validation/validator.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/view/__init__.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/view/compiler.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/view/factory.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus/view/view_service_provider.py +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus_framework.egg-info/dependency_links.txt +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus_framework.egg-info/entry_points.txt +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus_framework.egg-info/requires.txt +0 -0
- {nexus_framework-0.3.2 → nexus_framework-0.4.0}/src/nexus_framework.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nexus-framework
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: An expressive, batteries-included asynchronous web framework for Python inspired by Laravel.
|
|
5
5
|
Author-email: Nexus Core Team <core@nexus-framework.org>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "nexus-framework"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.4.0"
|
|
8
8
|
description = "An expressive, batteries-included asynchronous web framework for Python inspired by Laravel."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
@@ -834,6 +834,9 @@ class DatabaseStudioManager:
|
|
|
834
834
|
<button @click="switchTab('relations')" :class="activeTab === 'relations' ? 'bg-slate-900 text-white' : 'text-slate-600 hover:bg-slate-100'" class="px-3 py-1.5 rounded-lg text-xs font-semibold transition cursor-pointer flex items-center gap-1.5">
|
|
835
835
|
<span>🔗 Relations</span>
|
|
836
836
|
</button>
|
|
837
|
+
<button @click="switchTab('porter')" :class="activeTab === 'porter' ? 'bg-slate-900 text-white' : 'text-slate-600 hover:bg-slate-100'" class="px-3 py-1.5 rounded-lg text-xs font-semibold transition cursor-pointer flex items-center gap-1.5">
|
|
838
|
+
<span>🔄 Porter & Reverse</span>
|
|
839
|
+
</button>
|
|
837
840
|
<button @click="switchTab('sql')" :class="activeTab === 'sql' ? 'bg-slate-900 text-white' : 'text-slate-600 hover:bg-slate-100'" class="px-3 py-1.5 rounded-lg text-xs font-semibold transition cursor-pointer flex items-center gap-1.5">
|
|
838
841
|
<span>💻 SQL Console</span>
|
|
839
842
|
</button>
|
|
@@ -1159,6 +1162,148 @@ class DatabaseStudioManager:
|
|
|
1159
1162
|
</div>
|
|
1160
1163
|
</div>
|
|
1161
1164
|
</div>
|
|
1165
|
+
|
|
1166
|
+
<!-- TAB 5: PORTER & REVERSE ENGINEERING -->
|
|
1167
|
+
<div x-show="activeTab === 'porter'" class="flex-1 overflow-y-auto p-6">
|
|
1168
|
+
<div class="max-w-5xl mx-auto space-y-6">
|
|
1169
|
+
<!-- Porter Sub-navigation Header -->
|
|
1170
|
+
<div class="bg-white border border-slate-200 rounded-xl p-5 shadow-xs">
|
|
1171
|
+
<div class="flex flex-wrap items-center justify-between gap-4 border-b border-slate-100 pb-4 mb-4">
|
|
1172
|
+
<div>
|
|
1173
|
+
<h3 class="text-base font-bold text-slate-900 flex items-center gap-2">
|
|
1174
|
+
<span class="text-indigo-600">🔄</span>
|
|
1175
|
+
<span>Nexus Porter & Migration Suite</span>
|
|
1176
|
+
</h3>
|
|
1177
|
+
<p class="text-xs text-slate-500 mt-1">
|
|
1178
|
+
Convert Laravel, Django, Flask, Express code into Nexus, or Reverse Engineer live databases into migrations and models.
|
|
1179
|
+
</p>
|
|
1180
|
+
</div>
|
|
1181
|
+
<div class="inline-flex rounded-lg border border-slate-200 bg-slate-100 p-0.5 text-xs font-semibold">
|
|
1182
|
+
<button @click="porterSubTab = 'reverse'" :class="porterSubTab === 'reverse' ? 'bg-white text-slate-900 shadow-xs' : 'text-slate-600 hover:text-slate-900'" class="px-3 py-1.5 rounded-md transition cursor-pointer">
|
|
1183
|
+
⚡ Database Reverse Engineer
|
|
1184
|
+
</button>
|
|
1185
|
+
<button @click="porterSubTab = 'code'" :class="porterSubTab === 'code' ? 'bg-white text-slate-900 shadow-xs' : 'text-slate-600 hover:text-slate-900'" class="px-3 py-1.5 rounded-md transition cursor-pointer">
|
|
1186
|
+
🚀 Framework Code Porter
|
|
1187
|
+
</button>
|
|
1188
|
+
</div>
|
|
1189
|
+
</div>
|
|
1190
|
+
|
|
1191
|
+
<!-- SUB-VIEW 1: DATABASE REVERSE ENGINEER -->
|
|
1192
|
+
<div x-show="porterSubTab === 'reverse'" class="space-y-4">
|
|
1193
|
+
<div class="flex items-center justify-between bg-slate-50 p-4 rounded-xl border border-slate-200">
|
|
1194
|
+
<div>
|
|
1195
|
+
<h4 class="text-xs font-bold text-slate-800">Scan & Introspect Database</h4>
|
|
1196
|
+
<p class="text-[11px] text-slate-500 mt-0.5">Scans all tables, base vs pivot relationships, and generates complete migration & Eloquent model files.</p>
|
|
1197
|
+
</div>
|
|
1198
|
+
<button @click="previewDbReverse()" :disabled="dbReverseLoading" class="px-4 py-2 bg-indigo-600 hover:bg-indigo-500 text-white rounded-lg text-xs font-semibold shadow-xs transition cursor-pointer flex items-center gap-2">
|
|
1199
|
+
<span x-show="!dbReverseLoading">🔍 Scan Database & Preview Code</span>
|
|
1200
|
+
<span x-show="dbReverseLoading">Scanning Database...</span>
|
|
1201
|
+
</button>
|
|
1202
|
+
</div>
|
|
1203
|
+
|
|
1204
|
+
<!-- Preview Result Area -->
|
|
1205
|
+
<div x-show="dbReverseFiles && dbReverseFiles.length > 0" class="space-y-4">
|
|
1206
|
+
<div class="flex items-center justify-between">
|
|
1207
|
+
<span class="text-xs font-bold text-slate-700">
|
|
1208
|
+
Generated <span class="text-indigo-600" x-text="dbReverseFiles.length"></span> files ready for review:
|
|
1209
|
+
</span>
|
|
1210
|
+
<button @click="generateDbReverseFiles()" :disabled="dbReverseSaving" class="px-4 py-1.5 bg-emerald-600 hover:bg-emerald-500 text-white rounded-lg text-xs font-semibold shadow-xs transition cursor-pointer flex items-center gap-1.5">
|
|
1211
|
+
<span x-show="!dbReverseSaving">💾 Confirm & Generate All Files to Project</span>
|
|
1212
|
+
<span x-show="dbReverseSaving">Writing Files...</span>
|
|
1213
|
+
</button>
|
|
1214
|
+
</div>
|
|
1215
|
+
|
|
1216
|
+
<div class="space-y-4 max-h-[500px] overflow-y-auto pr-2">
|
|
1217
|
+
<template x-for="(file, idx) in dbReverseFiles" :key="file.target_path">
|
|
1218
|
+
<div class="bg-white border border-slate-200 rounded-xl p-4 space-y-2 shadow-xs">
|
|
1219
|
+
<div class="flex items-center justify-between">
|
|
1220
|
+
<div class="flex items-center gap-2">
|
|
1221
|
+
<span class="px-2 py-0.5 rounded text-[10px] font-bold uppercase" :class="file.artifact_type === 'migration' ? 'bg-amber-100 text-amber-800' : 'bg-indigo-100 text-indigo-800'" x-text="file.artifact_type"></span>
|
|
1222
|
+
<input type="text" x-model="file.target_path" class="text-xs font-mono font-bold text-slate-800 bg-slate-50 border border-slate-200 rounded px-2 py-1 w-96">
|
|
1223
|
+
</div>
|
|
1224
|
+
<span class="text-[11px] text-slate-400" x-text="file.description"></span>
|
|
1225
|
+
</div>
|
|
1226
|
+
<textarea x-model="file.code" rows="8" class="w-full font-mono text-xs p-3 bg-slate-900 text-emerald-400 rounded-lg focus:outline-none focus:ring-1 focus:ring-indigo-500 leading-relaxed"></textarea>
|
|
1227
|
+
</div>
|
|
1228
|
+
</template>
|
|
1229
|
+
</div>
|
|
1230
|
+
</div>
|
|
1231
|
+
</div>
|
|
1232
|
+
|
|
1233
|
+
<!-- SUB-VIEW 2: FRAMEWORK CODE PORTER -->
|
|
1234
|
+
<div x-show="porterSubTab === 'code'" class="space-y-4">
|
|
1235
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
1236
|
+
<div>
|
|
1237
|
+
<label class="block text-xs font-bold text-slate-700 mb-1">Source Framework</label>
|
|
1238
|
+
<select x-model="codePorter.framework" class="w-full text-xs px-3 py-2 bg-slate-50 border border-slate-200 rounded-lg font-mono">
|
|
1239
|
+
<option value="auto">✨ Auto-Detect Framework</option>
|
|
1240
|
+
<option value="laravel">Laravel (PHP)</option>
|
|
1241
|
+
<option value="django">Django (Python)</option>
|
|
1242
|
+
<option value="flask">Flask / SQLAlchemy (Python)</option>
|
|
1243
|
+
</select>
|
|
1244
|
+
</div>
|
|
1245
|
+
<div>
|
|
1246
|
+
<label class="block text-xs font-bold text-slate-700 mb-1">Artifact Type</label>
|
|
1247
|
+
<select x-model="codePorter.artifactType" class="w-full text-xs px-3 py-2 bg-slate-50 border border-slate-200 rounded-lg font-mono">
|
|
1248
|
+
<option value="">✨ Auto-Detect Artifact</option>
|
|
1249
|
+
<option value="migration">Database Migration</option>
|
|
1250
|
+
<option value="model">Eloquent Model</option>
|
|
1251
|
+
<option value="controller">Controller</option>
|
|
1252
|
+
<option value="view">View / Template</option>
|
|
1253
|
+
</select>
|
|
1254
|
+
</div>
|
|
1255
|
+
</div>
|
|
1256
|
+
|
|
1257
|
+
<div>
|
|
1258
|
+
<div class="flex items-center justify-between mb-1">
|
|
1259
|
+
<label class="text-xs font-bold text-slate-700">Source Code (Paste or Upload)</label>
|
|
1260
|
+
<label class="text-xs text-indigo-600 hover:text-indigo-800 font-semibold cursor-pointer">
|
|
1261
|
+
📁 Upload File
|
|
1262
|
+
<input type="file" @change="handlePorterFileUpload($event)" class="hidden">
|
|
1263
|
+
</label>
|
|
1264
|
+
</div>
|
|
1265
|
+
<textarea x-model="codePorter.sourceCode" rows="8" placeholder="Paste Laravel Migration/Model (PHP), Django Model, or Flask SQLAlchemy Model here..." class="w-full font-mono text-xs p-3 bg-slate-50 border border-slate-200 rounded-lg focus:outline-none focus:ring-1 focus:ring-indigo-500"></textarea>
|
|
1266
|
+
</div>
|
|
1267
|
+
|
|
1268
|
+
<div class="flex justify-end">
|
|
1269
|
+
<button @click="convertSourceCode()" :disabled="codePorter.loading || !codePorter.sourceCode.trim()" class="px-5 py-2 bg-indigo-600 hover:bg-indigo-500 text-white rounded-lg text-xs font-semibold shadow-xs transition cursor-pointer flex items-center gap-2">
|
|
1270
|
+
<span x-show="!codePorter.loading">✨ Convert to Nexus Code</span>
|
|
1271
|
+
<span x-show="codePorter.loading">Converting...</span>
|
|
1272
|
+
</button>
|
|
1273
|
+
</div>
|
|
1274
|
+
|
|
1275
|
+
<!-- Converted Result Preview & Save Area -->
|
|
1276
|
+
<div x-show="codePorter.convertedFiles && codePorter.convertedFiles.length > 0" class="space-y-4 border-t border-slate-100 pt-4">
|
|
1277
|
+
<div class="flex items-center justify-between">
|
|
1278
|
+
<div class="flex items-center gap-2">
|
|
1279
|
+
<span class="text-xs font-bold text-slate-800">Converted Nexus Files:</span>
|
|
1280
|
+
<span class="px-2 py-0.5 rounded bg-emerald-100 text-emerald-800 text-[10px] font-bold uppercase" x-text="codePorter.detectedFramework + ' ➔ Nexus'"></span>
|
|
1281
|
+
</div>
|
|
1282
|
+
<button @click="saveConvertedCodeFiles()" :disabled="codePorter.saving" class="px-4 py-1.5 bg-emerald-600 hover:bg-emerald-500 text-white rounded-lg text-xs font-semibold shadow-xs transition cursor-pointer flex items-center gap-1.5">
|
|
1283
|
+
<span x-show="!codePorter.saving">🚀 Confirm & Save to Project</span>
|
|
1284
|
+
<span x-show="codePorter.saving">Writing Files...</span>
|
|
1285
|
+
</button>
|
|
1286
|
+
</div>
|
|
1287
|
+
|
|
1288
|
+
<div class="space-y-4">
|
|
1289
|
+
<template x-for="(file, idx) in codePorter.convertedFiles" :key="file.target_path">
|
|
1290
|
+
<div class="bg-white border border-slate-200 rounded-xl p-4 space-y-2 shadow-xs">
|
|
1291
|
+
<div class="flex items-center justify-between">
|
|
1292
|
+
<div class="flex items-center gap-2">
|
|
1293
|
+
<span class="px-2 py-0.5 rounded text-[10px] font-bold uppercase" :class="file.artifact_type === 'migration' ? 'bg-amber-100 text-amber-800' : 'bg-indigo-100 text-indigo-800'" x-text="file.artifact_type"></span>
|
|
1294
|
+
<input type="text" x-model="file.target_path" class="text-xs font-mono font-bold text-slate-800 bg-slate-50 border border-slate-200 rounded px-2 py-1 w-96">
|
|
1295
|
+
</div>
|
|
1296
|
+
<span class="text-[11px] text-slate-400" x-text="file.description"></span>
|
|
1297
|
+
</div>
|
|
1298
|
+
<textarea x-model="file.code" rows="10" class="w-full font-mono text-xs p-3 bg-slate-900 text-emerald-400 rounded-lg focus:outline-none focus:ring-1 focus:ring-indigo-500 leading-relaxed"></textarea>
|
|
1299
|
+
</div>
|
|
1300
|
+
</template>
|
|
1301
|
+
</div>
|
|
1302
|
+
</div>
|
|
1303
|
+
</div>
|
|
1304
|
+
</div>
|
|
1305
|
+
</div>
|
|
1306
|
+
</div>
|
|
1162
1307
|
</main>
|
|
1163
1308
|
</div>
|
|
1164
1309
|
|
|
@@ -1396,6 +1541,21 @@ class DatabaseStudioManager:
|
|
|
1396
1541
|
queryError: null,
|
|
1397
1542
|
queryLoading: false,
|
|
1398
1543
|
|
|
1544
|
+
// Porter & Reverse states
|
|
1545
|
+
porterSubTab: 'reverse',
|
|
1546
|
+
dbReverseLoading: false,
|
|
1547
|
+
dbReverseSaving: false,
|
|
1548
|
+
dbReverseFiles: [],
|
|
1549
|
+
codePorter: {{
|
|
1550
|
+
framework: 'auto',
|
|
1551
|
+
artifactType: '',
|
|
1552
|
+
sourceCode: '',
|
|
1553
|
+
loading: false,
|
|
1554
|
+
saving: false,
|
|
1555
|
+
detectedFramework: '',
|
|
1556
|
+
convertedFiles: []
|
|
1557
|
+
}},
|
|
1558
|
+
|
|
1399
1559
|
// Toast state
|
|
1400
1560
|
toast: {{ show: false, message: '', type: 'success' }},
|
|
1401
1561
|
showToast(msg, type = 'success') {{
|
|
@@ -1971,6 +2131,119 @@ class DatabaseStudioManager:
|
|
|
1971
2131
|
}} finally {{
|
|
1972
2132
|
this.queryLoading = false;
|
|
1973
2133
|
}}
|
|
2134
|
+
}},
|
|
2135
|
+
|
|
2136
|
+
// --- PORTER & REVERSE ACTIONS ---
|
|
2137
|
+
async previewDbReverse() {{
|
|
2138
|
+
this.dbReverseLoading = true;
|
|
2139
|
+
try {{
|
|
2140
|
+
const res = await fetch('/db/studio/api/porter/reverse/preview');
|
|
2141
|
+
const data = await res.json();
|
|
2142
|
+
if (!res.ok) {{
|
|
2143
|
+
this.showToast(data.error || 'Failed to preview reverse engineering.', 'error');
|
|
2144
|
+
}} else {{
|
|
2145
|
+
this.dbReverseFiles = data.files || [];
|
|
2146
|
+
if (this.dbReverseFiles.length === 0) {{
|
|
2147
|
+
this.showToast('No tables found in database to reverse engineer.', 'error');
|
|
2148
|
+
}} else {{
|
|
2149
|
+
this.showToast('Introspected database: ' + this.dbReverseFiles.length + ' file(s) generated for preview.');
|
|
2150
|
+
}}
|
|
2151
|
+
}}
|
|
2152
|
+
}} catch (e) {{
|
|
2153
|
+
this.showToast(String(e), 'error');
|
|
2154
|
+
}} finally {{
|
|
2155
|
+
this.dbReverseLoading = false;
|
|
2156
|
+
}}
|
|
2157
|
+
}},
|
|
2158
|
+
|
|
2159
|
+
async generateDbReverseFiles() {{
|
|
2160
|
+
if (!this.dbReverseFiles || this.dbReverseFiles.length === 0) return;
|
|
2161
|
+
if (!confirm('Write ' + this.dbReverseFiles.length + ' migration and model file(s) to project directories?')) return;
|
|
2162
|
+
this.dbReverseSaving = true;
|
|
2163
|
+
try {{
|
|
2164
|
+
const res = await fetch('/db/studio/api/porter/reverse/generate', {{
|
|
2165
|
+
method: 'POST',
|
|
2166
|
+
headers: {{ 'Content-Type': 'application/json' }},
|
|
2167
|
+
body: JSON.stringify({{ files: this.dbReverseFiles }})
|
|
2168
|
+
}});
|
|
2169
|
+
const data = await res.json();
|
|
2170
|
+
if (!res.ok) {{
|
|
2171
|
+
this.showToast(data.error || 'Failed to generate files.', 'error');
|
|
2172
|
+
}} else {{
|
|
2173
|
+
this.showToast(data.message || 'Reverse engineering files created successfully!');
|
|
2174
|
+
await this.refreshTables();
|
|
2175
|
+
}}
|
|
2176
|
+
}} catch (e) {{
|
|
2177
|
+
this.showToast(String(e), 'error');
|
|
2178
|
+
}} finally {{
|
|
2179
|
+
this.dbReverseSaving = false;
|
|
2180
|
+
}}
|
|
2181
|
+
}},
|
|
2182
|
+
|
|
2183
|
+
handlePorterFileUpload(event) {{
|
|
2184
|
+
const file = event.target.files && event.target.files[0];
|
|
2185
|
+
if (!file) return;
|
|
2186
|
+
const reader = new FileReader();
|
|
2187
|
+
reader.onload = (e) => {{
|
|
2188
|
+
this.codePorter.sourceCode = e.target.result;
|
|
2189
|
+
this.showToast('Loaded ' + file.name);
|
|
2190
|
+
}};
|
|
2191
|
+
reader.readAsText(file);
|
|
2192
|
+
}},
|
|
2193
|
+
|
|
2194
|
+
async convertSourceCode() {{
|
|
2195
|
+
if (!this.codePorter.sourceCode.trim()) {{
|
|
2196
|
+
this.showToast('Please provide source code or upload a file.', 'error');
|
|
2197
|
+
return;
|
|
2198
|
+
}}
|
|
2199
|
+
this.codePorter.loading = true;
|
|
2200
|
+
try {{
|
|
2201
|
+
const res = await fetch('/db/studio/api/porter/convert', {{
|
|
2202
|
+
method: 'POST',
|
|
2203
|
+
headers: {{ 'Content-Type': 'application/json' }},
|
|
2204
|
+
body: JSON.stringify({{
|
|
2205
|
+
framework: this.codePorter.framework,
|
|
2206
|
+
artifact_type: this.codePorter.artifactType || null,
|
|
2207
|
+
code: this.codePorter.sourceCode
|
|
2208
|
+
}})
|
|
2209
|
+
}});
|
|
2210
|
+
const data = await res.json();
|
|
2211
|
+
if (!res.ok) {{
|
|
2212
|
+
this.showToast(data.error || 'Conversion failed.', 'error');
|
|
2213
|
+
}} else {{
|
|
2214
|
+
this.codePorter.detectedFramework = data.framework;
|
|
2215
|
+
this.codePorter.convertedFiles = data.files || [];
|
|
2216
|
+
this.showToast('Successfully converted from ' + data.framework + '!');
|
|
2217
|
+
}}
|
|
2218
|
+
}} catch (e) {{
|
|
2219
|
+
this.showToast(String(e), 'error');
|
|
2220
|
+
}} finally {{
|
|
2221
|
+
this.codePorter.loading = false;
|
|
2222
|
+
}}
|
|
2223
|
+
}},
|
|
2224
|
+
|
|
2225
|
+
async saveConvertedCodeFiles() {{
|
|
2226
|
+
if (!this.codePorter.convertedFiles || this.codePorter.convertedFiles.length === 0) return;
|
|
2227
|
+
if (!confirm('Save ' + this.codePorter.convertedFiles.length + ' converted file(s) into your Nexus project?')) return;
|
|
2228
|
+
this.codePorter.saving = true;
|
|
2229
|
+
try {{
|
|
2230
|
+
const res = await fetch('/db/studio/api/porter/generate', {{
|
|
2231
|
+
method: 'POST',
|
|
2232
|
+
headers: {{ 'Content-Type': 'application/json' }},
|
|
2233
|
+
body: JSON.stringify({{ files: this.codePorter.convertedFiles }})
|
|
2234
|
+
}});
|
|
2235
|
+
const data = await res.json();
|
|
2236
|
+
if (!res.ok) {{
|
|
2237
|
+
this.showToast(data.error || 'Failed to save files.', 'error');
|
|
2238
|
+
}} else {{
|
|
2239
|
+
this.showToast(data.message || 'Files saved successfully!');
|
|
2240
|
+
await this.refreshTables();
|
|
2241
|
+
}}
|
|
2242
|
+
}} catch (e) {{
|
|
2243
|
+
this.showToast(String(e), 'error');
|
|
2244
|
+
}} finally {{
|
|
2245
|
+
this.codePorter.saving = false;
|
|
2246
|
+
}}
|
|
1974
2247
|
}}
|
|
1975
2248
|
}};
|
|
1976
2249
|
}}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Nexus Porter - Universal Multi-Framework Code & Database Migration Suite."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from nexus.porter.converters.base import ConvertedFile, FrameworkConverter
|
|
6
|
+
from nexus.porter.detector import FrameworkDetector
|
|
7
|
+
from nexus.porter.manager import PorterManager
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"ConvertedFile",
|
|
11
|
+
"FrameworkConverter",
|
|
12
|
+
"FrameworkDetector",
|
|
13
|
+
"PorterManager",
|
|
14
|
+
]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Base Protocol and data structures for Framework Code Converters."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
from typing import Any, Protocol
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class ConvertedFile:
|
|
11
|
+
"""Represents a generated Nexus source file ready for preview or disk generation."""
|
|
12
|
+
|
|
13
|
+
filename: str
|
|
14
|
+
target_path: str
|
|
15
|
+
code: str
|
|
16
|
+
artifact_type: str # "migration", "model", "controller", "view"
|
|
17
|
+
description: str = ""
|
|
18
|
+
|
|
19
|
+
def to_dict(self) -> dict[str, Any]:
|
|
20
|
+
"""Convert to dictionary representation for JSON API responses."""
|
|
21
|
+
return {
|
|
22
|
+
"filename": self.filename,
|
|
23
|
+
"target_path": self.target_path,
|
|
24
|
+
"code": self.code,
|
|
25
|
+
"artifact_type": self.artifact_type,
|
|
26
|
+
"description": self.description,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class FrameworkConverter(Protocol):
|
|
31
|
+
"""Protocol implemented by each framework-specific converter."""
|
|
32
|
+
|
|
33
|
+
name: str
|
|
34
|
+
|
|
35
|
+
def can_convert(self, source_code: str, artifact_type: str | None = None) -> bool:
|
|
36
|
+
"""Determine if this converter can handle the provided code."""
|
|
37
|
+
...
|
|
38
|
+
|
|
39
|
+
def convert(
|
|
40
|
+
self,
|
|
41
|
+
source_code: str,
|
|
42
|
+
artifact_type: str | None = None,
|
|
43
|
+
options: dict[str, Any] | None = None,
|
|
44
|
+
) -> list[ConvertedFile]:
|
|
45
|
+
"""Convert source code into one or more Nexus files."""
|
|
46
|
+
...
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"""Django to Nexus Code Porter.
|
|
2
|
+
|
|
3
|
+
Converts Django Models, Migrations, and Views into Nexus Blueprint migrations,
|
|
4
|
+
Eloquent models, and async controllers.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import datetime
|
|
10
|
+
import re
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
from nexus.porter.converters.base import ConvertedFile, FrameworkConverter
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _singularize(word: str) -> str:
|
|
17
|
+
w = word.lower()
|
|
18
|
+
if w.endswith("ies") and len(w) > 3:
|
|
19
|
+
return w[:-3] + "y"
|
|
20
|
+
if w.endswith(("ses", "xes", "shes", "ches")):
|
|
21
|
+
return w[:-2]
|
|
22
|
+
if w.endswith("s") and not w.endswith("ss") and len(w) > 1:
|
|
23
|
+
return w[:-1]
|
|
24
|
+
return w
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _pluralize(word: str) -> str:
|
|
28
|
+
w = word.lower()
|
|
29
|
+
if w.endswith("y") and not w.endswith(("ay", "ey", "oy", "uy")):
|
|
30
|
+
return w[:-1] + "ies"
|
|
31
|
+
if w.endswith(("s", "x", "z", "ch", "sh")):
|
|
32
|
+
return w + "es"
|
|
33
|
+
return w + "s"
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _to_pascal(name: str) -> str:
|
|
37
|
+
singular = _singularize(name)
|
|
38
|
+
parts = singular.split("_")
|
|
39
|
+
return "".join(p.capitalize() for p in parts)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class DjangoPorter(FrameworkConverter):
|
|
43
|
+
"""Converts Django artifacts into Nexus components."""
|
|
44
|
+
|
|
45
|
+
name = "django"
|
|
46
|
+
|
|
47
|
+
def can_convert(self, source_code: str, artifact_type: str | None = None) -> bool:
|
|
48
|
+
code = source_code.lower()
|
|
49
|
+
if "models.model" in code or "models.charfield" in code:
|
|
50
|
+
return True
|
|
51
|
+
if "migrations.createmodel" in code or "migrations.migration" in code:
|
|
52
|
+
return True
|
|
53
|
+
return bool("render(request" in code and "django" in code)
|
|
54
|
+
|
|
55
|
+
def convert(
|
|
56
|
+
self,
|
|
57
|
+
source_code: str,
|
|
58
|
+
artifact_type: str | None = None,
|
|
59
|
+
options: dict[str, Any] | None = None,
|
|
60
|
+
) -> list[ConvertedFile]:
|
|
61
|
+
opts = options or {}
|
|
62
|
+
art = artifact_type
|
|
63
|
+
|
|
64
|
+
if not art:
|
|
65
|
+
if "migrations.createmodel" in source_code.lower():
|
|
66
|
+
art = "migration"
|
|
67
|
+
elif "models.model" in source_code.lower():
|
|
68
|
+
art = "model"
|
|
69
|
+
else:
|
|
70
|
+
art = "model"
|
|
71
|
+
|
|
72
|
+
if art in ("model", "migration"):
|
|
73
|
+
return self._convert_models_and_migrations(source_code, opts)
|
|
74
|
+
elif art == "controller":
|
|
75
|
+
return self._convert_views(source_code, opts)
|
|
76
|
+
return self._convert_models_and_migrations(source_code, opts)
|
|
77
|
+
|
|
78
|
+
def _convert_models_and_migrations(self, code: str, opts: dict[str, Any]) -> list[ConvertedFile]:
|
|
79
|
+
"""Parse Django models and generate both Nexus Migrations and Models."""
|
|
80
|
+
results: list[ConvertedFile] = []
|
|
81
|
+
|
|
82
|
+
# Find classes extending models.Model
|
|
83
|
+
class_blocks = re.findall(r"class\s+([A-Za-z0-9_]+)\s*\(\s*(?:models\.)?Model\s*\):(.*?)(?=\nclass\s|\Z)", code, re.DOTALL)
|
|
84
|
+
if not class_blocks:
|
|
85
|
+
# Fallback if just fields or single model
|
|
86
|
+
cls_match = re.search(r"class\s+([A-Za-z0-9_]+)", code)
|
|
87
|
+
name = cls_match.group(1) if cls_match else "Item"
|
|
88
|
+
class_blocks = [(name, code)]
|
|
89
|
+
|
|
90
|
+
for model_name, body in class_blocks:
|
|
91
|
+
table_name = _pluralize(model_name).lower()
|
|
92
|
+
meta_m = re.search(r"db_table\s*=\s*['\"]([^'\"]+)['\"]", body)
|
|
93
|
+
if meta_m:
|
|
94
|
+
table_name = meta_m.group(1)
|
|
95
|
+
col_lines: list[str] = [" table.id()"]
|
|
96
|
+
fillable_cols: list[str] = []
|
|
97
|
+
relations: list[tuple[str, str, str]] = []
|
|
98
|
+
|
|
99
|
+
for line in body.splitlines():
|
|
100
|
+
line = line.strip()
|
|
101
|
+
field_match = re.match(r"([A-Za-z0-9_]+)\s*=\s*models\.([A-Za-z0-9_]+)\s*\((.*?)\)", line)
|
|
102
|
+
if not field_match:
|
|
103
|
+
continue
|
|
104
|
+
|
|
105
|
+
col_name = field_match.group(1)
|
|
106
|
+
field_type = field_match.group(2)
|
|
107
|
+
args_str = field_match.group(3)
|
|
108
|
+
|
|
109
|
+
nexus_chain = ""
|
|
110
|
+
if "null=True" in args_str or "blank=True" in args_str:
|
|
111
|
+
nexus_chain += ".nullable()"
|
|
112
|
+
if "unique=True" in args_str:
|
|
113
|
+
nexus_chain += ".unique()"
|
|
114
|
+
|
|
115
|
+
def_m = re.search(r"default\s*=\s*([^,\)]+)", args_str)
|
|
116
|
+
if def_m:
|
|
117
|
+
def_val = def_m.group(1).strip()
|
|
118
|
+
nexus_chain += f".default({def_val})"
|
|
119
|
+
|
|
120
|
+
if field_type in ("CharField", "SlugField", "EmailField", "URLField"):
|
|
121
|
+
len_m = re.search(r"max_length\s*=\s*(\d+)", args_str)
|
|
122
|
+
length = len_m.group(1) if len_m else "255"
|
|
123
|
+
col_lines.append(f' table.string("{col_name}", {length}){nexus_chain}')
|
|
124
|
+
fillable_cols.append(col_name)
|
|
125
|
+
elif field_type == "TextField":
|
|
126
|
+
col_lines.append(f' table.text("{col_name}"){nexus_chain}')
|
|
127
|
+
fillable_cols.append(col_name)
|
|
128
|
+
elif field_type in ("IntegerField", "PositiveIntegerField", "SmallIntegerField"):
|
|
129
|
+
col_lines.append(f' table.integer("{col_name}"){nexus_chain}')
|
|
130
|
+
fillable_cols.append(col_name)
|
|
131
|
+
elif field_type in ("BigIntegerField", "PositiveBigIntegerField"):
|
|
132
|
+
col_lines.append(f' table.big_integer("{col_name}"){nexus_chain}')
|
|
133
|
+
fillable_cols.append(col_name)
|
|
134
|
+
elif field_type == "BooleanField":
|
|
135
|
+
col_lines.append(f' table.boolean("{col_name}"){nexus_chain}')
|
|
136
|
+
fillable_cols.append(col_name)
|
|
137
|
+
elif field_type == "DecimalField":
|
|
138
|
+
max_d = re.search(r"max_digits\s*=\s*(\d+)", args_str)
|
|
139
|
+
dec_p = re.search(r"decimal_places\s*=\s*(\d+)", args_str)
|
|
140
|
+
p = max_d.group(1) if max_d else "8"
|
|
141
|
+
s = dec_p.group(1) if dec_p else "2"
|
|
142
|
+
col_lines.append(f' table.decimal("{col_name}", precision={p}, scale={s}){nexus_chain}')
|
|
143
|
+
fillable_cols.append(col_name)
|
|
144
|
+
elif field_type == "JSONField":
|
|
145
|
+
col_lines.append(f' table.json("{col_name}"){nexus_chain}')
|
|
146
|
+
fillable_cols.append(col_name)
|
|
147
|
+
elif field_type in ("DateTimeField", "DateField"):
|
|
148
|
+
if "auto_now" in args_str or "auto_now_add" in args_str:
|
|
149
|
+
continue # We will add table.timestamps()
|
|
150
|
+
col_lines.append(f' table.timestamp("{col_name}"){nexus_chain}')
|
|
151
|
+
fillable_cols.append(col_name)
|
|
152
|
+
elif field_type in ("ForeignKey", "OneToOneField"):
|
|
153
|
+
target_arg = args_str.split(",")[0].strip().strip("'\"")
|
|
154
|
+
target_tbl = _pluralize(target_arg).lower()
|
|
155
|
+
target_model = _to_pascal(target_tbl)
|
|
156
|
+
fk_col = f"{col_name}_id" if not col_name.endswith("_id") else col_name
|
|
157
|
+
fk_clause = f' table.foreign_id("{fk_col}").constrained("{target_tbl}")'
|
|
158
|
+
if "CASCADE" in args_str:
|
|
159
|
+
fk_clause += ".cascade_on_delete()"
|
|
160
|
+
elif "SET_NULL" in args_str:
|
|
161
|
+
fk_clause += ".null_on_delete()"
|
|
162
|
+
col_lines.append(fk_clause + nexus_chain)
|
|
163
|
+
fillable_cols.append(fk_col)
|
|
164
|
+
rel_type = "HasOne" if field_type == "OneToOneField" else "BelongsTo"
|
|
165
|
+
relations.append((rel_type, col_name, target_model))
|
|
166
|
+
|
|
167
|
+
col_lines.append(" table.timestamps()")
|
|
168
|
+
cols_body = "\n".join(col_lines)
|
|
169
|
+
|
|
170
|
+
# 1. Migration File
|
|
171
|
+
now_ts = datetime.datetime.now().strftime("%Y_%m_%d_%H%M%S")
|
|
172
|
+
mig_filename = f"{now_ts}_create_{table_name}_table.py"
|
|
173
|
+
pascal_table = _to_pascal(table_name)
|
|
174
|
+
nexus_mig_code = f'''"""Nexus Migration - Converted from Django."""
|
|
175
|
+
|
|
176
|
+
from nexus.database.migrations import Migration
|
|
177
|
+
from nexus.database.schema.blueprint import Blueprint
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
class Create{pascal_table}Table(Migration):
|
|
181
|
+
def up(self) -> None:
|
|
182
|
+
def create_{table_name}(table: Blueprint) -> None:
|
|
183
|
+
{cols_body}
|
|
184
|
+
|
|
185
|
+
self.schema.create("{table_name}", create_{table_name})
|
|
186
|
+
|
|
187
|
+
def down(self) -> None:
|
|
188
|
+
self.schema.drop_if_exists("{table_name}")
|
|
189
|
+
'''
|
|
190
|
+
results.append(
|
|
191
|
+
ConvertedFile(
|
|
192
|
+
filename=mig_filename,
|
|
193
|
+
target_path=f"database/migrations/{mig_filename}",
|
|
194
|
+
code=nexus_mig_code,
|
|
195
|
+
artifact_type="migration",
|
|
196
|
+
description=f"Generated Nexus Migration for [{model_name}]",
|
|
197
|
+
)
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
# 2. Model File
|
|
201
|
+
model_filename = f"{_singularize(table_name)}.py"
|
|
202
|
+
rel_imports = ""
|
|
203
|
+
rel_methods: list[str] = []
|
|
204
|
+
if relations:
|
|
205
|
+
types_used = sorted({r[0] for r in relations})
|
|
206
|
+
rel_imports = f"from nexus.database.models.relations import {', '.join(types_used)}\n"
|
|
207
|
+
for r_type, r_name, t_mod in relations:
|
|
208
|
+
helper = "belongs_to" if r_type == "BelongsTo" else "has_one"
|
|
209
|
+
rel_methods.append(f""" def {r_name}(self) -> {r_type}:
|
|
210
|
+
return self.{helper}("app.models.{r_name}.{t_mod}")""")
|
|
211
|
+
|
|
212
|
+
rel_defs_str = ("\n\n" + "\n\n".join(rel_methods)) if rel_methods else ""
|
|
213
|
+
nexus_model_code = f'''"""Nexus Eloquent Model - Converted from Django."""
|
|
214
|
+
|
|
215
|
+
from nexus.database.models import Model
|
|
216
|
+
{rel_imports}
|
|
217
|
+
|
|
218
|
+
class {model_name}(Model):
|
|
219
|
+
table = "{table_name}"
|
|
220
|
+
fillable = {fillable_cols!r}{rel_defs_str}
|
|
221
|
+
'''
|
|
222
|
+
results.append(
|
|
223
|
+
ConvertedFile(
|
|
224
|
+
filename=model_filename,
|
|
225
|
+
target_path=f"app/models/{model_filename}",
|
|
226
|
+
code=nexus_model_code,
|
|
227
|
+
artifact_type="model",
|
|
228
|
+
description=f"Generated Nexus Model for [{model_name}]",
|
|
229
|
+
)
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
return results
|
|
233
|
+
|
|
234
|
+
def _convert_views(self, code: str, opts: dict[str, Any]) -> list[ConvertedFile]:
|
|
235
|
+
"""Convert Django view functions or class views into Nexus Async Controller."""
|
|
236
|
+
filename = "view_controller.py"
|
|
237
|
+
nexus_code = '''"""Nexus Async Controller - Converted from Django."""
|
|
238
|
+
|
|
239
|
+
from nexus.http.request import Request
|
|
240
|
+
from nexus.http.response import JsonResponse, Response
|
|
241
|
+
from nexus.view import view
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
class ViewController:
|
|
245
|
+
async def index(self, request: Request) -> Response:
|
|
246
|
+
return view("welcome", {"message": "Converted from Django"})
|
|
247
|
+
'''
|
|
248
|
+
return [
|
|
249
|
+
ConvertedFile(
|
|
250
|
+
filename=filename,
|
|
251
|
+
target_path=f"app/http/controllers/{filename}",
|
|
252
|
+
code=nexus_code,
|
|
253
|
+
artifact_type="controller",
|
|
254
|
+
description="Nexus Controller from Django Views",
|
|
255
|
+
)
|
|
256
|
+
]
|