Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: jan on web - experimental #4325

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft

feat: jan on web - experimental #4325

wants to merge 2 commits into from

Conversation

louis-jan
Copy link
Contributor

@louis-jan louis-jan commented Dec 23, 2024

Describe Your Changes

This PR is to enable the standalone web deployment with Jan frontend to run with a running cortex.cpp server.

Caution:
This is just an experimental PR

CleanShot 2024-12-23 at 16 47 13

To run this:

  1. Build core, joi and extensions as usual
  2. Run yarn dev:web:standalone
  3. Voila - Access localhost:3000 on safari or chrome browser (there is a known issue with Arc, WIP)

Changes made

This pull request includes several changes to enhance the functionality and compatibility of the JanHQ application, particularly focusing on handling web and electron environments, improving theme management, and updating extension handling. The most important changes include modifications to the ExtensionManager class, the addition of a new theme, and updates to the build and development scripts.

Enhancements to Extension Handling:

  • web/extension/ExtensionManager.ts: Added logic to handle extensions differently based on the environment (electron or web). This includes using WebExtensions for web environments and modifying the activateExtension method to simplify the URL handling for extensions. [1] [2] [3] [4]
  • web/extensions.json: Added a JSON file that lists all available extensions with their metadata, which will be used in web environments.

Theme Management Improvements:

  • web/hooks/useLoadTheme.ts: Added logic to load a default theme (DefaultTheme) when the application is running in a web environment. [1] [2]
  • web/theme.json: Introduced a new theme configuration file to define the "Joi Light" theme, including various UI element styles.

Build and Development Script Updates:

  • package.json: Added a new script dev:web:standalone for running the web application in standalone mode and updated the build:web script to fix a syntax issue.

Code Simplification:

Compatibility Enhancements:

Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant