Merge pull request #301 from gnh1201/master

Merge master to dev branch
This commit is contained in:
Namhyeon Go 2025-07-27 16:22:03 +09:00 committed by GitHub
commit 782f1ebb28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 186 additions and 36 deletions

View File

@ -25,6 +25,7 @@ after_build:
#- cmd: xcopy /s /y WelsonJS.Toolkit\WelsonJS.Toolkit\bin\x86\%CONFIGURATION%\* artifacts\
- cmd: xcopy /s /y WelsonJS.Toolkit\WelsonJS.Service\bin\x86\%CONFIGURATION%\* artifacts\
- cmd: xcopy /s /y WelsonJS.Toolkit\WelsonJS.Launcher\bin\x86\%CONFIGURATION%\* artifacts\
- cmd: xcopy /s /y WelsonJS.Toolkit\EsentInterop\bin\%CONFIGURATION%\* artifacts\
- cmd: nuget pack WelsonJS.Toolkit\WelsonJS.Toolkit\ -properties Configuration=%CONFIGURATION% -properties Platform=x86 -OutputDirectory artifacts\
- cmd: 7z a artifacts.zip artifacts\*

38
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

51
.github/workflows/jekyll-gh-pages.yml vendored Normal file
View File

@ -0,0 +1,51 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

9
.gitmodules vendored
View File

@ -1,9 +0,0 @@
[submodule "app/assets/tessdata"]
path = app/assets/tessdata
url = https://github.com/tesseract-ocr/tessdata
[submodule "app/assets/tessdata_best"]
path = app/assets/tessdata_best
url = https://github.com/tesseract-ocr/tessdata_best
[submodule "app/assets/tessdata_fast"]
path = app/assets/tessdata_fast
url = https://github.com/tesseract-ocr/tessdata_fast

1
CNAME Normal file
View File

@ -0,0 +1 @@
welson.js.org

View File

@ -77,6 +77,7 @@ WelsonJS is tailored for developers who need a reliable, lightweight JavaScript
* Generative AI integrations: [Multiple LLM and sLLM](https://catswords-oss.rdbl.io/5719744820/5510319392) (e.g., ChatGPT, Claude, ...)
* Aviation Data integrations: [AviationStack](https://aviationstack.com?utm_source=FirstPromoter&utm_medium=Affiliate&fpr=namhyeon71), [SerpApi Google Flights API](https://serpapi.com/google-flights-api?utm_source=welsonjs)
* VM infrastructure tool integrations: [OVFTool for Broadcom/VMware infrastructures](https://developer.broadcom.com/tools/open-virtualization-format-ovf-tool/latest)
* ***:fire: NEW!*** Windows bulit-in database engine AKA. [ESENT (ESE) database](https://learn.microsoft.com/en-us/windows/win32/extensible-storage-engine/database-overview) interface library (WelsonJS.Esent)
* Everything you can imagine.
## Quick start
@ -163,6 +164,8 @@ The WelsonJS framework suggests the following application release methods:
* :eyes: [daily.dev](https://app.daily.dev/posts/js-libraries-svg-tools-json-databases-8quregz3a)
* :eyes: [PitchHut](https://www.pitchhut.com/project/proj_Ya136OLSW5at)
* :eyes: [Disquiet](https://dis.qa/nv6T6)
* :eyes: [Node Weekly](https://nodeweekly.com/issues/582)
* :eyes: [Zhouexin (周e信)](https://www.zhouexin.com/issues/321)
## Report abuse
* [GitHub Security Advisories (gnh1201/welsonjs)](https://github.com/gnh1201/welsonjs/security)

View File

@ -17,7 +17,6 @@ namespace WelsonJS.Launcher
public partial class MainForm : Form
{
private const string _entryFileName = "bootstrap.bat";
private readonly string _dateTimeFormat;
private string _workingDirectory;
@ -26,18 +25,28 @@ namespace WelsonJS.Launcher
public MainForm()
{
// set the datetime format
_dateTimeFormat = Program.GetAppConfig("DateTimeFormat");
// initialize UI
InitializeComponent();
// Check the user is an Administator
if (IsInAdministrator())
{
Text += " (Administrator)";
}
// Send to the tray (to the background)
notifyIcon1.DoubleClick += OnShow;
openLauncherToolStripMenuItem.Click += OnShow;
exitToolStripMenuItem.Click += OnExit;
// Autostart the resource server
if (Program.GetAppConfig("ResourceServerAutoStart").ToLower() == "true")
{
RunResourceServer();
}
}
protected override void OnFormClosing(FormClosingEventArgs e)
@ -120,12 +129,12 @@ namespace WelsonJS.Launcher
string filePath = openFileDialog.FileName;
DisableUI();
Task.Run(() => ExtractAndRun(filePath));
Task.Run(() => RunAppPackageFile(filePath));
}
}
}
private void ExtractAndRun(string filePath)
private void RunAppPackageFile(string filePath)
{
_instanceId = Guid.NewGuid().ToString();
_workingDirectory = Program.GetWorkingDirectory(_instanceId);
@ -160,6 +169,19 @@ namespace WelsonJS.Launcher
SafeInvoke(() => EnableUI());
}
private bool RunResourceServer()
{
Program.InitializeResourceServer();
if (!Program._ResourceServer.IsRunning())
{
Program._ResourceServer.Start(false);
startCodeEditorToolStripMenuItem.Text = "Open the code editor...";
}
return Program._ResourceServer.IsRunning();
}
private void RecordFirstDeployTime(string directory, string instanceId)
{
// get current time
@ -263,14 +285,7 @@ namespace WelsonJS.Launcher
private void startCodeEditorToolStripMenuItem_Click(object sender, EventArgs e)
{
Program.StartResourceServer();
if (!Program._ResourceServer.IsRunning())
{
Program._ResourceServer.Start();
((ToolStripMenuItem)sender).Text = "Open the code editor...";
}
else
if (RunResourceServer())
{
Program.OpenWebBrowser(Program._ResourceServer.GetPrefix());
}

View File

@ -146,7 +146,7 @@ namespace WelsonJS.Launcher
return workingDirectory;
}
public static void StartResourceServer()
public static void InitializeResourceServer()
{
lock(typeof(Program))
{
@ -159,7 +159,7 @@ namespace WelsonJS.Launcher
public static void OpenWebBrowser(string url)
{
Uri resourceServerUri = new Uri(GetAppConfig("ResourceServerPrefix"));
Uri devToolsUri = new Uri(GetAppConfig("DevToolsPrefix"));
Uri devToolsUri = new Uri(GetAppConfig("ChromiumDevToolsPrefix"));
string userDataDir = Path.Combine(GetAppDataPath(), "EdgeUserProfile");
string remoteAllowOrigins = $"{resourceServerUri.Scheme}://{resourceServerUri.Host}:{resourceServerUri.Port}";
@ -173,7 +173,7 @@ namespace WelsonJS.Launcher
Process.Start(new ProcessStartInfo
{
FileName = "msedge.exe",
FileName = Program.GetAppConfig("ChromiumFileName"),
Arguments = string.Join(" ", arguments),
UseShellExecute = true
});

View File

@ -105,6 +105,24 @@ namespace WelsonJS.Launcher.Properties {
}
}
/// <summary>
/// http://localhost:9222/과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string ChromiumDevToolsPrefix {
get {
return ResourceManager.GetString("ChromiumDevToolsPrefix", resourceCulture);
}
}
/// <summary>
/// msedge.exe과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string ChromiumFileName {
get {
return ResourceManager.GetString("ChromiumFileName", resourceCulture);
}
}
/// <summary>
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
@ -141,15 +159,6 @@ namespace WelsonJS.Launcher.Properties {
}
}
/// <summary>
/// http://localhost:9222/과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string DevToolsPrefix {
get {
return ResourceManager.GetString("DevToolsPrefix", resourceCulture);
}
}
/// <summary>
/// 1.1.1.1과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
@ -277,6 +286,15 @@ namespace WelsonJS.Launcher.Properties {
}
}
/// <summary>
/// true과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string ResourceServerAutoStart {
get {
return ResourceManager.GetString("ResourceServerAutoStart", resourceCulture);
}
}
/// <summary>
/// http://localhost:3000/과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>

View File

@ -157,7 +157,7 @@
<data name="ResourceServerPrefix" xml:space="preserve">
<value>http://localhost:3000/</value>
</data>
<data name="DevToolsPrefix" xml:space="preserve">
<data name="ChromiumDevToolsPrefix" xml:space="preserve">
<value>http://localhost:9222/</value>
</data>
<data name="AzureAiServiceApiKey" xml:space="preserve">
@ -199,4 +199,10 @@
<data name="DateTimeFormat" xml:space="preserve">
<value>yyyy-MM-dd HH:mm:ss</value>
</data>
<data name="ResourceServerAutoStart" xml:space="preserve">
<value>true</value>
</data>
<data name="ChromiumFileName" xml:space="preserve">
<value>msedge.exe</value>
</data>
</root>

View File

@ -30,6 +30,7 @@ namespace WelsonJS.Launcher
private string _prefix;
private string _resourceName;
private List<IResourceTool> _tools = new List<IResourceTool>();
private static readonly HttpClient _httpClient = new HttpClient();
private static readonly string _defaultMimeType = "application/octet-stream";
private static BlobConfig _blobConfig;
@ -66,7 +67,7 @@ namespace WelsonJS.Launcher
return _prefix;
}
public void Start()
public void Start(bool IsOpenWebBrowser = true)
{
if (_isRunning) return;
@ -75,7 +76,10 @@ namespace WelsonJS.Launcher
_listener.Start();
// Open the web browser
Program.OpenWebBrowser(_prefix);
if (IsOpenWebBrowser)
{
Program.OpenWebBrowser(_prefix);
}
// Run a task with cancellation token
_serverTask = Task.Run(() => ListenLoop(_cts.Token));

View File

@ -2,9 +2,11 @@
<configuration>
<appSettings>
<add key="ResourceServerPrefix" value="http://localhost:3000/"/>
<add key="ResourceServerAutoStart" value="true"/>
<add key="RepositoryUrl" value="https://github.com/gnh1201/welsonjs"/>
<add key="CopilotUrl" value="https://copilot.microsoft.com/"/>
<add key="DevToolsPrefix" value="http://localhost:9222/"/>
<add key="ChromiumDevToolsPrefix" value="http://localhost:9222/"/>
<add key="ChromiumFileName" value="msedge.exe"/>
<add key="AzureAiServicePrefix" value="https://ai-catswords656881030318.services.ai.azure.com/"/>
<add key="AzureAiServiceApiKey" value=""/>
<add key="AzureAiServiceApiVersion" value="2024-05-01-preview"/>