Skip to content
Merged

Dev #96

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7b8bfe9
Docs: improve; wrap lines.
bjones1 Dec 16, 2025
e538b9a
Fix: revert to @codemirror/view 6.38 until bugs are fixed.
bjones1 Dec 16, 2025
baca5d6
Fix: use correct random funtion to avoid fractional floating-point va…
bjones1 Dec 17, 2025
82260b9
Docs: updates.
bjones1 Dec 17, 2025
523ca4e
Add: include version numbers in OutOfSync message.
bjones1 Dec 17, 2025
39e9b34
Fix: add an is_toc parameters to a LoadFile request.
bjones1 Dec 17, 2025
4b5c7f4
Fix: correctly access TinyMCE instance inside dirty handler.
bjones1 Dec 17, 2025
8db1b75
Fix: improve error reporting.
bjones1 Dec 17, 2025
d6b6f93
Fix: change c/c++ lexer name to something that doesn't get escaped.
bjones1 Dec 18, 2025
013fdd7
Fix: correct is_toc to is_current.
bjones1 Dec 18, 2025
e7ae18a
Docs: Update.
bjones1 Dec 18, 2025
16d5ef0
Docs: correct problems.
bjones1 Dec 18, 2025
a62877b
Docs: wrap files.
bjones1 Dec 18, 2025
743c2b6
Fix: move version in structs before source, to make debug easier.
bjones1 Dec 18, 2025
448150e
Fix: Remove unused feature.
bjones1 Dec 18, 2025
38b5214
Fix: move version in structs before source, to make debug easier.
bjones1 Dec 19, 2025
c8d1b94
Fix: remove verbose debug prints.
bjones1 Dec 19, 2025
ff3588a
Docs: properly comment out code.
bjones1 Dec 19, 2025
db37085
Docs: wrap.
bjones1 Dec 19, 2025
296d50c
Fix: prevent editing of the span that wraps math.
bjones1 Dec 19, 2025
483b98c
Fix: automatically re-sync Client when out of sync.
bjones1 Dec 19, 2025
3632264
docs: indent Mermaid diagram.
bjones1 Dec 19, 2025
f65ac3a
Clean: remove debug logging.
bjones1 Dec 19, 2025
f3d1ee8
Freeze for release.
bjones1 Dec 19, 2025
bb132a1
Docs: wrap.
bjones1 Dec 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@ Changelog
[Github master](https://github.com/bjones1/CodeChat_Editor)
--------------------------------------------------------------------------------

* No changes.
* Fix errors in Client when editing a file with adjacent doc blocks.
* Fix out of sync errors when the table of contents file is open.
* Fix incorrect version info sent by the VSCode extension.
* Change lexer name for C/C++ code to avoid escaping when converting from HTML
to Markdown.
* Fix Client so that edits produces updates to the IDE; previous, edits would
occasionally stop updating the IDE.
* Prevent editing the `<span>` that wraps math expressions.
* Automatically re-sync Client with IDE when out of sync.
* Update to latest release of MathJax.

Version 0.1.46 -- 2025-Dec-15
--------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion builder/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/).
#
# `.gitignore` -- files for Git to ignore
# =======================================
# ==============================================================================
#
# Rust build output
target/
Expand Down
2 changes: 1 addition & 1 deletion builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/).
#
# `Cargo.toml` -- Rust build/package management config for the builder
# ====================================================================
# ==============================================================================
[package]
name = "builder"
version = "0.1.0"
Expand Down
54 changes: 33 additions & 21 deletions builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
// the CodeChat Editor. If not, see
// [http://www.gnu.org/licenses](http://www.gnu.org/licenses).
/// `main.rs` -- Entrypoint for the CodeChat Editor Builder
/// =======================================================
/// ============================================================================
///
/// This code uses [dist](https://opensource.axo.dev/cargo-dist/book/) as a part
/// of the release process. To update the `./release.yaml` file this tool
/// creates:
///
/// 1. Edit `server/dist-workspace.toml`: change `allow-dirty` to `[]`.
/// 2. Run `dist init` and accept the defaults, then run `dist generate`.
/// 3. Review changes to `./release.yaml`, reapplying hand edits.
/// 4. Revert the changes to `server/dist-workspace.toml`.
/// 5. Test
/// 1. Edit `server/dist-workspace.toml`: change `allow-dirty` to `[]`.
/// 2. Run `dist init` and accept the defaults, then run `dist generate`.
/// 3. Review changes to `./release.yaml`, reapplying hand edits.
/// 4. Revert the changes to `server/dist-workspace.toml`.
/// 5. Test
// Imports
// -------
// -----------------------------------------------------------------------------
//
// ### Standard library
use std::{
Expand All @@ -50,7 +50,7 @@ use regex::Regex;
// None
//
// Data structures
// ---------------
// -----------------------------------------------------------------------------
//
// The following defines the command-line interface for the CodeChat Editor.
#[derive(Parser)]
Expand Down Expand Up @@ -117,15 +117,15 @@ struct TypeScriptBuildOptions {
}

// Constants
// ---------
// -----------------------------------------------------------------------------
static VSCODE_PATH: &str = "../extensions/VSCode";
static CLIENT_PATH: &str = "../client";
static BUILDER_PATH: &str = "../builder";
static TEST_UTILS_PATH: &str = "../test_utils";
static NAPI_TARGET: &str = "NAPI_TARGET";

// Code
// ----
// -----------------------------------------------------------------------------
//
// ### Utilities
//
Expand Down Expand Up @@ -242,8 +242,8 @@ fn quick_copy_dir<P: AsRef<Path>>(src: P, dest: P, files: Option<P>) -> io::Resu
.status()?
.code()
.expect("Copy process terminated by signal");
// Per [these
// docs](https://learn.microsoft.com/en-us/troubleshoot/windows-server/backup-and-storage/return-codes-used-robocopy-utility),
// Per
// [these docs](https://learn.microsoft.com/en-us/troubleshoot/windows-server/backup-and-storage/return-codes-used-robocopy-utility),
// check the return code.
if cfg!(windows) && exit_code >= 8 || !cfg!(windows) && exit_code != 0 {
Err(io::Error::other(format!(
Expand Down Expand Up @@ -288,7 +288,7 @@ fn search_and_replace_file<
}

// Core routines
// -------------
// -----------------------------------------------------------------------------
//
// These functions simplify common build-focused development tasks and support
// CI builds.
Expand All @@ -312,8 +312,17 @@ fn patch_file(patch: &str, before_patch: &str, file_path: &str) -> io::Result<()
}
/// After updating files in the client's Node files, perform some fix-ups.
fn patch_client_libs() -> io::Result<()> {
// In [older
// releases](https://www.tiny.cloud/docs/tinymce/5/6.0-upcoming-changes/#options),
// Apply a the fixes described in
// [issue 27](https://github.com/bjones1/CodeChat_Editor/issues/27).
patch_file(
"
selectionNotFocus = this.view.state.facet(editable) ? focused : hasSelection(this.dom, this.view.observer.selectionRange)",
" let selectionNotFocus = !focused && !(this.view.state.facet(editable) || this.dom.tabIndex > -1) &&
hasSelection(this.dom, this.view.observer.selectionRange) && !(activeElt && this.dom.contains(activeElt));",
&format!("{CLIENT_PATH}/node_modules/@codemirror/view/dist/index.js")
)?;
// In
// [older releases](https://www.tiny.cloud/docs/tinymce/5/6.0-upcoming-changes/#options),
// TinyMCE allowed users to change `whitespace_elements`; the whitespace
// inside these isn't removed by TinyMCE. However, this was removed in v6.0.
// Therefore, manually patch TinyMCE instead.
Expand Down Expand Up @@ -376,8 +385,8 @@ fn run_install(dev: bool) -> io::Result<()> {
#[cfg(not(windows))]
// The original command had `'=https'`, but single quotes confused
// `cmd_lib` and aren't needed to quote this. Note that `//` in the URL
// is a comment in Rust, so it must be [enclosed in
// quotes](https://github.com/rust-shell-script/rust_cmd_lib/issues/88).
// is a comment in Rust, so it must be
// [enclosed in quotes](https://github.com/rust-shell-script/rust_cmd_lib/issues/88).
run_cmd! {
curl -L --proto =https --tlsv1.2 -sSf "https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh" | bash;
}?;
Expand Down Expand Up @@ -551,7 +560,7 @@ fn run_client_build(
true,
)?;

// <a id="#pdf.js>The PDF viewer for use with VSCode. Built it separately,
// \<a id="#pdf.js>The PDF viewer for use with VSCode. Built it separately,
// since it's loaded apart from the rest of the Client.
run_script(
&esbuild,
Expand Down Expand Up @@ -634,7 +643,8 @@ fn run_extensions_build(
if dist {
napi_args.push("--release");
}
// See if this is a cross-platform build -- if so, add in the specified target.
// See if this is a cross-platform build -- if so, add in the specified
// target.
let target;
if let Ok(tmp) = env::var(NAPI_TARGET) {
target = tmp;
Expand Down Expand Up @@ -730,7 +740,9 @@ fn run_postrelease(target: &str) -> io::Result<()> {
"aarch64-apple-darwin" => "darwin-arm64",
_ => panic!("Unsupported platform {target}."),
};
// `vsce` will invoke this program's `ext_build`; however, it doesn't provide a way to pass the target when cross-compiling. Use an environment variable instead.
// `vsce` will invoke this program's `ext_build`; however, it doesn't
// provide a way to pass the target when cross-compiling. Use an environment
// variable instead.
unsafe {
env::set_var(NAPI_TARGET, target);
}
Expand All @@ -754,7 +766,7 @@ fn run_postrelease(target: &str) -> io::Result<()> {
}

// CLI implementation
// ------------------
// -----------------------------------------------------------------------------
//
// The following code implements the command-line interface for the CodeChat
// Editor.
Expand Down
14 changes: 7 additions & 7 deletions client/package.json5
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
url: 'https://github.com/bjones1/CodeChat_editor',
},
type: 'module',
version: '0.1.46',
version: '0.1.47',
dependencies: {
'@codemirror/commands': '^6.10.0',
'@codemirror/commands': '^6.10.1',
'@codemirror/lang-cpp': '^6.0.3',
'@codemirror/lang-css': '^6.3.1',
'@codemirror/lang-go': '^6.0.1',
Expand All @@ -61,15 +61,15 @@
'@codemirror/lang-xml': '^6.1.0',
'@codemirror/lang-yaml': '^6.1.2',
'@codemirror/state': '^6.5.2',
'@codemirror/view': '^6.39.4',
'@codemirror/view': '6.38.8',
'@hpcc-js/wasm-graphviz': '^1.17.0',
'@mathjax/mathjax-newcm-font': '4.1.0',
'@mathjax/mathjax-newcm-font': '^4.1.0',
codemirror: '^6.0.2',
mathjax: '4.0.0',
mathjax: '^4.1.0',
mermaid: '^11.12.2',
'npm-check-updates': '^19.2.0',
'pdfjs-dist': '^5.4.449',
tinymce: '^8.3.0',
tinymce: '^8.3.1',
'toastify-js': '^1.12.0',
},
devDependencies: {
Expand All @@ -83,7 +83,7 @@
'@typescript-eslint/eslint-plugin': '^8.50.0',
'@typescript-eslint/parser': '^8.50.0',
chai: '^6.2.1',
esbuild: '^0.27.1',
esbuild: '^0.27.2',
eslint: '^9.39.2',
'eslint-config-prettier': '^10.1.8',
'eslint-plugin-import': '^2.32.0',
Expand Down
Loading
Loading