diff --git a/.appveyor.yml b/.appveyor.yml index a25b3ac..a13a793 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -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\* diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..dd84ea7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -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. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -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. diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml new file mode 100644 index 0000000..0ebd768 --- /dev/null +++ b/.github/workflows/jekyll-gh-pages.yml @@ -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 diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 875b921..0000000 --- a/.gitmodules +++ /dev/null @@ -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 diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..8f62a2b --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +welson.js.org \ No newline at end of file diff --git a/README.md b/README.md index d9bb197..d862e5c 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs b/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs index 162d26d..3d78fbe 100644 --- a/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs +++ b/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs @@ -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()); } diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs b/WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs index b796fb5..42f6d07 100644 --- a/WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs +++ b/WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs @@ -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 }); diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/Properties/Resources.Designer.cs b/WelsonJS.Toolkit/WelsonJS.Launcher/Properties/Resources.Designer.cs index c3ebefd..24f5ca1 100644 --- a/WelsonJS.Toolkit/WelsonJS.Launcher/Properties/Resources.Designer.cs +++ b/WelsonJS.Toolkit/WelsonJS.Launcher/Properties/Resources.Designer.cs @@ -105,6 +105,24 @@ namespace WelsonJS.Launcher.Properties { } } + /// + /// http://localhost:9222/과(와) 유사한 지역화된 문자열을 찾습니다. + /// + internal static string ChromiumDevToolsPrefix { + get { + return ResourceManager.GetString("ChromiumDevToolsPrefix", resourceCulture); + } + } + + /// + /// msedge.exe과(와) 유사한 지역화된 문자열을 찾습니다. + /// + internal static string ChromiumFileName { + get { + return ResourceManager.GetString("ChromiumFileName", resourceCulture); + } + } + /// /// 과(와) 유사한 지역화된 문자열을 찾습니다. /// @@ -141,15 +159,6 @@ namespace WelsonJS.Launcher.Properties { } } - /// - /// http://localhost:9222/과(와) 유사한 지역화된 문자열을 찾습니다. - /// - internal static string DevToolsPrefix { - get { - return ResourceManager.GetString("DevToolsPrefix", resourceCulture); - } - } - /// /// 1.1.1.1과(와) 유사한 지역화된 문자열을 찾습니다. /// @@ -277,6 +286,15 @@ namespace WelsonJS.Launcher.Properties { } } + /// + /// true과(와) 유사한 지역화된 문자열을 찾습니다. + /// + internal static string ResourceServerAutoStart { + get { + return ResourceManager.GetString("ResourceServerAutoStart", resourceCulture); + } + } + /// /// http://localhost:3000/과(와) 유사한 지역화된 문자열을 찾습니다. /// diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/Properties/Resources.resx b/WelsonJS.Toolkit/WelsonJS.Launcher/Properties/Resources.resx index 7bf3635..c619a4c 100644 --- a/WelsonJS.Toolkit/WelsonJS.Launcher/Properties/Resources.resx +++ b/WelsonJS.Toolkit/WelsonJS.Launcher/Properties/Resources.resx @@ -157,7 +157,7 @@ http://localhost:3000/ - + http://localhost:9222/ @@ -199,4 +199,10 @@ yyyy-MM-dd HH:mm:ss + + true + + + msedge.exe + \ No newline at end of file diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/ResourceServer.cs b/WelsonJS.Toolkit/WelsonJS.Launcher/ResourceServer.cs index d87f0d3..7ea8dc0 100644 --- a/WelsonJS.Toolkit/WelsonJS.Launcher/ResourceServer.cs +++ b/WelsonJS.Toolkit/WelsonJS.Launcher/ResourceServer.cs @@ -30,6 +30,7 @@ namespace WelsonJS.Launcher private string _prefix; private string _resourceName; private List _tools = new List(); + 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)); diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/app.config b/WelsonJS.Toolkit/WelsonJS.Launcher/app.config index 3e9cad8..59bea5f 100644 --- a/WelsonJS.Toolkit/WelsonJS.Launcher/app.config +++ b/WelsonJS.Toolkit/WelsonJS.Launcher/app.config @@ -2,9 +2,11 @@ + - + +