Skip to content

Conversation

@buckhalt
Copy link
Member

@buckhalt buckhalt commented Jan 9, 2025

This pull request modernizes the development environment and build pipeline, updates documentation, and removes legacy dependencies. The main improvements include upgrading Node.js and package managers, updating GitHub Actions workflows, cleaning up submodules, and enhancing build and code quality tooling. Documentation has been thoroughly revised to reflect these changes and provide clearer guidance for developers.

Development Environment Modernization

  • Updated required Node.js version to 22.x (LTS), switched from npm to pnpm (v9.x) for package management, and added a .node-version file for version consistency. (README.md, .node-version, [1] [2]
  • Added .npmrc configuration for Electron and stricter dependency handling.
  • Updated documentation to reflect new development commands, prerequisites, and usage of pnpm. (README.md, CLAUDE.md, [1] [2]

Build and CI Pipeline Updates

  • Upgraded GitHub Actions workflow steps to use the latest versions of actions and switched build runners to ubuntu-latest. (.github/workflows/main.yml, .github/workflows/dist.yml, [1] [2] [3] [4] [5] [6]
  • Enhanced the macOS notarization script for Electron apps, making it more robust and configurable with environment variables. (build-resources/scripts/afterSignHook.js, build-resources/scripts/afterSignHook.jsL1-R84)

Repository and Dependency Cleanup

  • Removed the protocol-validation submodule and its references, reflecting its deprecation. (.gitmodules, .eslintignore, [1] [2]

Tooling and Configuration Improvements

  • Improved Babel configuration for better compatibility with Node.js 22 and modern JavaScript features, especially for test environments. (babel.config.js, babel.config.jsL3-R25)
  • Removed the unused and legacy config/env.js file.

Documentation Enhancements

  • Added a comprehensive CLAUDE.md file to help developers (and AI assistants) understand the project structure, workflows, and best practices.
  • Updated and clarified the README.md to match the new setup, commands, and architecture, and to note the temporary disabling of preview functionality. [1] [2]

Let me know if you have questions about any of these updates or need help getting your environment set up!

buckhalt and others added 30 commits December 4, 2024 08:57
user provides key value, value is saved to txt file in assets
buckhalt and others added 19 commits May 16, 2025 10:11
stage directly dispatches the update variable action to avoid circular deps with using updateVariableByUUID
This major refactor addresses critical security vulnerabilities and modernizes
the build toolchain:

Security:
- Upgrade Electron 9.4.4 → 34.5.8
- Enable context isolation with nodeIntegration: false
- Add preload scripts (appPreload.js, summaryPreload.js) with secure IPC bridge
- Migrate 30+ renderer files from direct Node.js imports to IPC-based electronBridge
- Disable preview mode pending network-canvas submodule modernization

Build System:
- Migrate from Webpack to electron-vite
- Migrate from Jest to Vitest (154/200 tests passing)
- Migrate from npm to pnpm
- Update Node.js requirement to 22.x LTS

Key Changes:
- Create src/utils/electronBridge.js for renderer-safe Electron API access
- Create src/utils/logger.js to replace electron-log in renderer
- Create public/components/ipcHandlers.js for main process IPC handlers
- Update all SCSS imports to remove webpack-specific ~ prefix
- Replace process.env with import.meta.env for Vite compatibility
- Fix protocol.handle() API for Electron 34 (returns void, not boolean)

Removed:
- Webpack configuration (config/webpack.*.js)
- Jest configuration (config/jest/)
- Legacy build scripts (scripts/build.js, scripts/start.js, etc.)
- package-lock.json (replaced by pnpm-lock.yaml)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create electron-builder.config.js with modern configuration
  - External config file for cleaner package.json
  - macOS, Windows, and Linux build targets
  - Proper asar and file inclusion patterns
  - File associations for .netcanvas files

- Update electron.vite.config.js
  - Fix JSX transformation with explicit Babel configuration
  - Output preload scripts to dist/preload/
  - Proper React plugin include patterns

- Update afterSignHook.js for modern notarization
  - Environment variable-based credentials (APPLE_API_KEY_*)
  - No hardcoded paths or credentials

- Update package.json build scripts
  - Clean scripts using external config file
  - Remove legacy inline build configuration

- Update preload paths in window creation files
  - createAppWindow.js: ../../preload/app.js
  - openPrintableSummaryWindow.js: ../../preload/summary.js

- Remove public/package.json (conflicting legacy file)

- Add *.tgz to .gitignore

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Suppress Sass deprecation warnings in electron.vite.config.js
- Add runtime dependencies (electron-log, fs-extra, archiver, decompress)
- Update network-canvas submodule reference
- Enhance preview window management for electron-vite
- Add shared electronAPI abstraction layer
- Update previewDriver for IPC-based communication

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jthrilly jthrilly marked this pull request as ready for review January 12, 2026 13:06
Copilot AI review requested due to automatic review settings January 12, 2026 13:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements version 7.0.0 of the application, focusing on modernizing the Electron integration by migrating from deprecated APIs to a secure context isolation architecture. The changes introduce a bridge layer for Electron API access, update the test framework from Jest to Vitest, and add new geospatial and anonymization features.

Changes:

  • Migrated from direct Electron API usage to a secure bridge layer (electronBridge.js) supporting context isolation
  • Replaced Jest with Vitest for testing infrastructure
  • Added new interface types: Geospatial and Anonymisation with supporting components
  • Updated protocol schema version from 7 to 8

Reviewed changes

Copilot reviewed 281 out of 289 changed files in this pull request and generated no comments.

Show a summary per file
File Description
vitest.config.js New Vitest configuration replacing Jest setup
src/utils/electronBridge.js New abstraction layer providing safe Electron API access via preload script
src/utils/logger.js New console-based logger replacing electron-log for renderer process
src/utils/validateProtocol.js Updated to use new logger and external protocol-validation package
src/utils/scrollTo.js Refactored to use native scrollTo API instead of anime.js
src/utils/protocols/*.js Updated to use electronAPI bridge and async/await patterns
src/components/sections/Geospatial* New components for geospatial interface functionality
src/components/sections/Anonymisation* New components for data anonymisation features
src/config/index.js Updated schema version to 8 and added geojson support
Multiple SCSS files Updated import paths removing tilde prefix for modern bundlers
Comments suppressed due to low confidence (3)

src/utils/netcanvasFile/lib.js:1

  • isFile should be called as a method with parentheses: stat.isFile(). The current code checks for the existence of the property rather than calling the method.
    src/utils/netcanvasFile/lib.js:1
  • isFile should be called as a method with parentheses: stat.isFile(). The current code checks for the existence of the property rather than calling the method.
    src/components/sections/MapOptions.js:1
  • Corrected spelling of 'retreiving' to 'retrieving'.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jthrilly and others added 8 commits January 12, 2026 22:08
- Rename .js test files to .jsx for proper JSX parsing in Vite
- Convert jest.mock() to vi.mock() across test files
- Replace jest.fn() with vi.fn() in PromptFields tests
- Add process-level error handler for framesync cleanup errors
  (framer-motion 5.x schedules timers that fire after jsdom teardown)
- Fix redux-form mocking in CodeView tests
- Update obsolete snapshots
- Remove tests for deleted components (VariablePicker, VariableSpotlight)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Vite requires explicit .jsx extension for files containing JSX syntax.
This change renames ~280 source files from .js to .jsx to ensure proper
parsing by the Vite bundler.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update script src from /src/index.js to /src/index.jsx after
the .js to .jsx file rename.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move the require('electron-devtools-installer') inside the function
after the environment check. This prevents the production build from
failing when the devDependency is not available.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Define 'module' as an object shim in Vite config to prevent
"module is not defined" errors from redux-form's hot reloading check.
The previous fix only defined module.hot, but redux-form checks
module itself before accessing .hot.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove Vite define replacement for 'module' (was breaking React bundling)
- Add runtime module shim in index.html instead
- The shim only sets window.module if undefined, avoiding conflicts

The previous approach of using Vite's define option did text replacement
on ALL occurrences of 'module', breaking CommonJS patterns in bundled
libraries like React.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add network-canvas/dist/**/* to electron-builder files config so the
preview window can load the built network-canvas renderer in production.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants