Skip to content
Merged

Dev #95

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a6f79aa
Fix: work around pnpm bug - use overrides to specify non-upgradable d…
bjones1 Dec 9, 2025
de91d22
Fix: use git version of htmd until my PRs are merged and a new versio…
bjones1 Dec 10, 2025
fc73e6e
Fix: get eslint working.
bjones1 Dec 10, 2025
fef5d42
Fix: respond to input, not dirty event in document-only mode.
bjones1 Dec 10, 2025
49c4d43
Docs: Update/reformat.
bjones1 Dec 10, 2025
80a3025
Fix: correct data corruption in Client.
bjones1 Dec 10, 2025
e9fc25d
Freeze for release.
bjones1 Dec 10, 2025
d686b93
Manually fix pnpm version.
bjones1 Dec 10, 2025
734b402
Fix: switch back to using the Dirty message.
bjones1 Dec 11, 2025
7bd582d
Revert "Fix: remove unused is_user_change flag."
bjones1 Dec 11, 2025
5458019
Fix: update is_user_change to depend on noAutosaveAnnotation.
bjones1 Dec 11, 2025
a01ee68
Fix: factor out utility functions from overall tests.
bjones1 Dec 11, 2025
c13d002
Fix: more test refactoring
bjones1 Dec 11, 2025
06599e1
Freeze for release.
bjones1 Dec 11, 2025
4d0b4b0
Fix: correct restoreSelection failure case logic.
bjones1 Dec 11, 2025
bafa956
Fix: starting with CodeMirror/view 6.39, remove old patch.
bjones1 Dec 11, 2025
ba133af
Clean: fix lints.
bjones1 Dec 11, 2025
acd72c3
Fix: update to htmd version that doesn't remove non-breaking spaces.
bjones1 Dec 12, 2025
17b96c3
Fix: send the transformed DOM tree directly to htmd, rather than seri…
bjones1 Dec 13, 2025
39a52bc
Clean: split browser automation tests into two separate tests.
bjones1 Dec 14, 2025
17ffdaa
Add: an example of using literate programming.
bjones1 Dec 14, 2025
8e09fee
Refactor: put test utils in a separate crate to avoid abusing features.
bjones1 Dec 15, 2025
7efa269
Update: to dist 0.30.3.
bjones1 Dec 15, 2025
fcd085e
Fix: correct ESLint config.
bjones1 Dec 15, 2025
eafce64
Clean: Fix lint.
bjones1 Dec 15, 2025
ee45699
Fix: correctly stream converted HTML to Markdown data.
bjones1 Dec 15, 2025
62d205c
Fix: lints.
bjones1 Dec 15, 2025
cf0cf64
Freeze for release.
bjones1 Dec 15, 2025
1679b26
Docs: fix typos.
bjones1 Dec 15, 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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
# we specify bash to get pipefail; it guards against the `curl` command
# failing. otherwise `sh` won't catch that `curl` returned non-0
shell: bash
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.30.2/cargo-dist-installer.sh | sh"
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.30.3/cargo-dist-installer.sh | sh"
- name: Cache dist
uses: actions/upload-artifact@v4
with:
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ Changelog

* No changes.

Version 0.1.46 -- 2025-Dec-15
--------------------------------------------------------------------------------

* Avoid spaces disappearing in Client when editing lists.
* Improve speed of convert
* Improve Client error reporting.

Version 0.1.45 -- 2025-Dec-11
--------------------------------------------------------------------------------

* Fix loss of editing in the Client when in document-only mode.
* Fix data corruption in the Client when in document-only mode and edits are
made in both the IDE and Client.
* Fix loss of autosave when making GUI-based edits in the Client.
* Correctly retain Client cursor position during IDE edits.
* Correctly translate table cells containing blocks from HTML to Markdown.

Version 0.1.44 -- 2025-Dec-09
--------------------------------------------------------------------------------

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ graph TD; A --> B;
</tbody>
</table>

The [Mermaid live editor](https://mermaid.live/) provide an focused environment for creating Mermaid chart.
The [Mermaid live editor](https://mermaid.live/) provide an focused environment
for creating Mermaid chart.

### Graphviz

The CodeChat Editor supports diagrams created by
[Graphviz](https://graphviz.org/). For example,


<table>
<thead>
<tr>
Expand Down Expand Up @@ -195,8 +195,8 @@ digraph { A -> B }
</tbody>
</table>


Several on-line tools, such as [Edotor](https://edotor.net/), provide a focused editing experience.
Several on-line tools, such as [Edotor](https://edotor.net/), provide a focused
editing experience.

### PlantUML

Expand Down
6 changes: 0 additions & 6 deletions builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ name = "builder"
version = "0.1.0"
edition = "2024"

# To make VSCode happy, create a unused `int_test` feature, then enable this
# feature in the VSCode Rust language server for a better experience. See
# `server/Cargo.toml` for its actual use.
[features]
int_tests = []

[dependencies]
clap = { version = "4.5.19", features = ["derive"] }
cmd_lib = "2.0.0"
Expand Down
51 changes: 26 additions & 25 deletions builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ struct TypeScriptBuildOptions {
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
Expand Down Expand Up @@ -311,15 +312,6 @@ 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<()> {
// 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
Expand Down Expand Up @@ -369,6 +361,8 @@ fn run_install(dev: bool) -> io::Result<()> {
cargo fetch --manifest-path=$BUILDER_PATH/Cargo.toml;
info "VSCode extension: cargo fetch";
cargo fetch --manifest-path=$VSCODE_PATH/Cargo.toml;
info "test_utils: cargo fetch"
cargo fetch --manifest-path=$TEST_UTILS_PATH/Cargo.toml;
info "cargo fetch";
cargo fetch;
)?;
Expand Down Expand Up @@ -420,6 +414,8 @@ fn run_update() -> io::Result<()> {
cargo update --manifest-path=$BUILDER_PATH/Cargo.toml;
info "VSCoe extension: cargo update";
cargo update --manifest-path=$VSCODE_PATH/Cargo.toml;
info "test_utils: cargo update"
cargo update --manifest-path=$TEST_UTILS_PATH/Cargo.toml;
info "cargo update";
cargo update;
)?;
Expand All @@ -431,6 +427,8 @@ fn run_update() -> io::Result<()> {
cargo outdated --manifest-path=$BUILDER_PATH/Cargo.toml;
info "VSCode extension: cargo outdated";
cargo outdated --manifest-path=$VSCODE_PATH/Cargo.toml;
info "test_utils: cargo outdated"
cargo outdated --manifest-path=$TEST_UTILS_PATH/Cargo.toml;
info "cargo outdated";
cargo outdated;
)?;
Expand All @@ -440,10 +438,10 @@ fn run_update() -> io::Result<()> {
fn run_format_and_lint(check_only: bool) -> io::Result<()> {
// The `-D warnings` flag causes clippy to return a non-zero exit status if
// it issues warnings.
let (clippy_check_only, check, prettier_check) = if check_only {
("-Dwarnings", "--check", "--check")
let (clippy_check_only, check, eslint_check) = if check_only {
("-Dwarnings", "--check", "")
} else {
("", "", "--write")
("", "", "--fix")
};
run_cmd!(
info "cargo clippy and fmt";
Expand All @@ -455,6 +453,9 @@ fn run_format_and_lint(check_only: bool) -> io::Result<()> {
info "VSCode extension: cargo clippy and fmt";
cargo clippy --all-targets --all-features --tests --manifest-path=$VSCODE_PATH/Cargo.toml -- $clippy_check_only;
cargo fmt --all $check --manifest-path=$VSCODE_PATH/Cargo.toml;
info "test_utils: cargo clippy and fmt"
cargo clippy --all-targets --all-features --tests --manifest-path=$TEST_UTILS_PATH/Cargo.toml -- $clippy_check_only;
cargo fmt --all $check --manifest-path=$TEST_UTILS_PATH/Cargo.toml;
info "cargo sort";
cargo sort $check;
cd $BUILDER_PATH;
Expand All @@ -463,19 +464,17 @@ fn run_format_and_lint(check_only: bool) -> io::Result<()> {
cd $VSCODE_PATH;
info "VSCode extension: cargo sort";
cargo sort $check;
info "test_utils: cargo sort"
cd $TEST_UTILS_PATH;
cargo sort $check;

)?;
run_script(
"npx",
&["prettier", "src", prettier_check],
CLIENT_PATH,
true,
)?;
run_script(
"npx",
&["prettier", "src", prettier_check],
VSCODE_PATH,
true,
)
let mut eslint_args = vec!["eslint", "src"];
if !eslint_check.is_empty() {
eslint_args.push(eslint_check)
}
run_script("npx", &eslint_args, CLIENT_PATH, true)?;
run_script("npx", &eslint_args, VSCODE_PATH, true)
}

fn run_test() -> io::Result<()> {
Expand All @@ -492,8 +491,10 @@ fn run_test() -> io::Result<()> {
cargo test --manifest-path=$BUILDER_PATH/Cargo.toml;
info "VSCode extension: cargo test";
cargo test --manifest-path=$VSCODE_PATH/Cargo.toml;
info "test_utils: cargo test"
cargo test --manifest-path=$TEST_UTILS_PATH/Cargo.toml;
info "cargo test";
cargo test --features int_tests;
cargo test;
)?;
Ok(())
}
Expand Down
42 changes: 0 additions & 42 deletions client/.eslintrc.yml

This file was deleted.

54 changes: 54 additions & 0 deletions client/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright (C) 2025 Bryan A. Jones.
//
// This file is part of the CodeChat Editor.
//
// The CodeChat Editor is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version.
//
// The CodeChat Editor is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// the CodeChat Editor. If not, see
// [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/).
//
// `.eslintrc.yml` -- Configure ESLint for this project
// ====================================================
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import eslint from "@eslint/js";
import { defineConfig } from "eslint/config";
import tseslint from "typescript-eslint";

export default defineConfig(
eslint.configs.recommended,
tseslint.configs.recommended,
eslintPluginPrettierRecommended,
defineConfig([
{
// This must be the only key in this dict to be treated as a global ignore. Only global ignores can ignore directories. See the [docs](https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores).
ignores: ["src/third-party/**"],
},
{
name: "local",
rules: {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
},
},
]),
);
23 changes: 13 additions & 10 deletions client/package.json5
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
url: 'https://github.com/bjones1/CodeChat_editor',
},
type: 'module',
version: '0.1.44',
version: '0.1.46',
dependencies: {
'@codemirror/commands': '^6.10.0',
'@codemirror/lang-cpp': '^6.0.3',
Expand All @@ -61,34 +61,37 @@
'@codemirror/lang-xml': '^6.1.0',
'@codemirror/lang-yaml': '^6.1.2',
'@codemirror/state': '^6.5.2',
'@codemirror/view': '=6.38.8',
'@hpcc-js/wasm-graphviz': '^1.16.0',
'@mathjax/mathjax-newcm-font': '4.0.0',
'@codemirror/view': '^6.39.4',
'@hpcc-js/wasm-graphviz': '^1.17.0',
'@mathjax/mathjax-newcm-font': '4.1.0',
codemirror: '^6.0.2',
mathjax: '4.0.0',
mermaid: '^11.12.2',
'npm-check-updates': '^19.1.2',
'npm-check-updates': '^19.2.0',
'pdfjs-dist': '^5.4.449',
tinymce: '^8.2.2',
tinymce: '^8.3.0',
'toastify-js': '^1.12.0',
},
devDependencies: {
'@eslint/js': '^9.39.2',
'@types/chai': '^5.2.3',
'@types/dom-navigation': '^1.0.6',
'@types/js-beautify': '^1.14.3',
'@types/mocha': '^10.0.10',
'@types/node': '^24.10.2',
'@types/node': '^24.10.4',
'@types/toastify-js': '^1.12.4',
'@typescript-eslint/eslint-plugin': '^8.49.0',
'@typescript-eslint/parser': '^8.49.0',
'@typescript-eslint/eslint-plugin': '^8.50.0',
'@typescript-eslint/parser': '^8.50.0',
chai: '^6.2.1',
esbuild: '^0.27.1',
eslint: '^9.39.1',
eslint: '^9.39.2',
'eslint-config-prettier': '^10.1.8',
'eslint-plugin-import': '^2.32.0',
'eslint-plugin-prettier': '^5.5.4',
mocha: '^11.7.5',
prettier: '^3.7.4',
typescript: '^5.9.3',
'typescript-eslint': '^8.50.0',
},
scripts: {
test: 'echo "Error: no test specified" && exit 1',
Expand Down
Loading
Loading