Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 23 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"lint:server": "npm run lint -w tools/ReFlex.TrackingServer/ClientApp",
"test:emulator": "npm run test -w tools/emulator",
"test:net-with-report": "dotnet coverage collect dotnet test --output test/artifacts/coverage-net/cobertura-coverage.xml --output-format cobertura && dotnet reportgenerator -reports:test/artifacts/coverage-net/cobertura-coverage.xml -targetdir:\"test/artifacts/coverage-net/report\" -reporttypes:Html -assemblyfilters:\"+ReFlex.*;-*.Test\"",
"test:server": "npm run test-ci -w tools/ReFlex.TrackingServer/ClientApp"
"test:server": "npm run test-ci -w tools/ReFlex.TrackingServer/ClientApp",
"update:server:dependencies": "node scripts/update_trackingserver_dependencies.cjs"
},
"workspaces": [
"packages/reflex-shared-types",
Expand Down
2 changes: 1 addition & 1 deletion packages/reflex-angular-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@reflex/angular-components",
"version": "1.0.0",
"version": "0.9.10",
"description": "Angular Component library for common Components used by the ReFlex Framework",
"sideEffects": false,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/reflex-shared-types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@reflex/shared-types",
"version": "0.9.8",
"version": "0.9.10",
"description": "common types for reuse between typescript projects",
"module": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
75 changes: 75 additions & 0 deletions scripts/update_trackingserver_dependencies.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// Usage: npm run update:server:dependencies
// Requires no npm install. Paths are resolved relative to this script.
// Merge declared dependencies (not devDependencies or installed/lockfile versions).
// App entries override root entries; file: references use the local package version.
// Only the target's dependencies object is replaced; all other bytes are preserved.
const fs = require('node:fs');
const path = require('node:path');

const root = path.resolve(__dirname, '..');
const app = path.join(root, 'tools/ReFlex.TrackingServer/ClientApp');
const target = path.join(app, 'src/assets/data/package.json');
const readJson = (file) => JSON.parse(fs.readFileSync(file, 'utf8'));
const isObject = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);

try {
const dependencies = {};
for (const directory of [root, app]) {
const source = path.join(directory, 'package.json');
const entries = readJson(source).dependencies ?? {};
if (!isObject(entries)) throw new Error(`Invalid dependencies in ${source}`);
for (const [name, specification] of Object.entries(entries)) {
if (typeof specification !== 'string') throw new Error(`Invalid dependency ${name} in ${source}`);
let version = specification;
if (specification.startsWith('file:')) {
const localFile = path.resolve(directory, specification.slice(5), 'package.json');
const local = readJson(localFile);
if (local.name !== name || typeof local.version !== 'string' || !local.version.trim()) {
throw new Error(`Expected package ${name} with a version in ${localFile}`);
}
version = local.version;
}
dependencies[name] = version;
}
}

const original = fs.readFileSync(target, 'utf8');
if (!isObject(readJson(target).dependencies)) throw new Error(`Missing dependencies object in ${target}`);

// Find the top-level object without reformatting the surrounding JSON.
// Strings are consumed as complete tokens so braces inside strings are ignored.
const tokens = /"(?:\\.|[^"\\])*"|[{}\[\]]/g;
let depth = 0;
let start;
let end;
let keyPosition;
for (const token of original.matchAll(tokens)) {
const value = token[0];
if (depth === 1 && value.startsWith('"') && JSON.parse(value) === 'dependencies') {
const following = original.slice(token.index + value.length).match(/^\s*:\s*\{/);
if (following) {
start = token.index + value.length + following[0].length - 1;
keyPosition = token.index;
}
}
if (value === '{' || value === '[') depth++;
if (value === '}' || value === ']') depth--;
if (start !== undefined && token.index >= start && depth === 1) {
end = token.index + 1;
break;
}
}
if (end === undefined) throw new Error(`Cannot locate dependencies in ${target}`);

const indent = original.slice(original.lastIndexOf('\n', keyPosition) + 1, keyPosition).match(/^[\t ]*/)[0];
const newline = original.includes('\r\n') ? '\r\n' : '\n';
const sorted = Object.fromEntries(Object.entries(dependencies).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0));
const replacement = JSON.stringify(sorted, null, 2).replace(/\n/g, newline + indent);
const updated = original.slice(0, start) + replacement + original.slice(end);
JSON.parse(updated);
if (updated !== original) fs.writeFileSync(target, updated);
console.log(`Updated ${Object.keys(dependencies).length} dependencies in ${target}`);
} catch (error) {
console.error(`Error: ${error.message}`);
process.exitCode = 1;
}
3 changes: 2 additions & 1 deletion tools/ReFlex.TrackingServer/ClientApp/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ function initWindow() {
autoHideMenuBar: true,
frame: false,
webPreferences: {
nodeIntegration: true,
nodeIntegration: false,
contextIsolation: true,
backgroundThrottling: false
}
});
Expand Down
2 changes: 1 addition & 1 deletion tools/ReFlex.TrackingServer/ClientApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
],
"private": true,
"dependencies": {
"@microsoft/signalr": "6.0.1",
"@microsoft/signalr": "^10.0.11",
"@reflex/angular-components": "file:../../../packages/reflex-angular-components",
"@reflex/shared-types": "file:../../../packages/reflex-shared-types",
"d3": "^7.9.0",
Expand Down
100 changes: 23 additions & 77 deletions tools/ReFlex.TrackingServer/ClientApp/src/assets/data/package.json
Original file line number Diff line number Diff line change
@@ -1,87 +1,33 @@
{
"name": "@reflex/trackingserver",
"version": "0.9.9",
"description": "Platform-independent server application using ASP.NET Core as backend and Angular as frontend.",
"main": "app.js",
"repository": {
"type": "git",
"url": "git+https://github.com/visualengineers/reflex.git"
},
"author": "Mathias Müller",
"license": "MIT",
"keywords": [
"electron",
"sdk",
"dotnet-core",
"shape-changing-interfaces",
"elastic-displays"
],
"private": true,
"name": "@reflex/trackingserver",
"version": "0.9.10",
"description": "Platform-independent server application using ASP.NET Core as backend and Angular as frontend.",
"main": "app.js",
"repository": {
"type": "git",
"url": "git+https://github.com/visualengineers/reflex.git"
},
"dependencies": {
"@angular/animations": "19.0.5",
"@angular/common": "19.0.5",
"@angular/compiler": "19.0.5",
"@angular/core": "19.0.5",
"@angular/forms": "19.0.5",
"@angular/platform-browser": "19.0.5",
"@angular/platform-browser-dynamic": "19.0.5",
"@angular/platform-server": "19.0.5",
"@angular/router": "19.0.5",
"@angular/ssr": "19.0.6",
"@microsoft/signalr": "6.0.1",
"@reflex/shared-types": "0.9.8",
"@reflex/angular-components": "0.9.9",
"@angular/animations": "19.1.4",
"@angular/common": "19.1.4",
"@angular/compiler": "19.1.4",
"@angular/core": "19.1.4",
"@angular/forms": "19.1.4",
"@angular/platform-browser": "19.1.4",
"@angular/platform-browser-dynamic": "19.1.4",
"@angular/platform-server": "19.1.4",
"@angular/router": "19.1.4",
"@angular/ssr": "19.2.26",
"@microsoft/signalr": "^10.0.11",
"@reflex/angular-components": "0.9.10",
"@reflex/shared-types": "0.9.10",
"angular-plotly.js": "^5.2.2",
"d3": "^7.9.0",
"file-saver": "^2.0.5",
"happy-dom": "15.11.7",
"happy-dom": "17.4.4",
"plotly.js-dist-min": "^2.33.0",
"rxjs": "^7.8.1",
"three": "^0.170.0",
"three": "^0.175.0",
"zone.js": "^0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^19.0.6",
"@angular-eslint/builder": "^19.0.2",
"@angular-eslint/eslint-plugin": "^19.0.2",
"@angular-eslint/eslint-plugin-template": "^19.0.2",
"@angular-eslint/schematics": "^19.0.2",
"@angular-eslint/template-parser": "^19.0.2",
"@angular/cli": "19.0.6",
"@angular/compiler-cli": "19.0.5",
"@types/d3": "^7.4.3",
"@angular/language-service": "19.0.5",
"@gtvmbh/eslint-config": "^1.1.7",
"@stylistic/eslint-plugin-ts": "^2.12.1",
"@types/file-saver": "^2.0.7",
"@types/jasmine": "~5.1.0",
"@types/jasminewd2": "~2.0.8",
"@types/node": "^18.18.0",
"@types/plotly.js-dist-min": "^2.3.4",
"@types/three": "^0.170.0",
"@types/ws": "<8.5.5",
"@types/webxr": "^0.5.20",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"electron-builder": "^24.13.3",
"eslint": "^8.45.0",
"eslint-config-angular": "^0.5.0",
"eslint-plugin-angular": "^4.1.0",
"eslint-plugin-jsdoc": "^48.2.6",
"jasmine-core": "~5.5.0",
"jasmine-marbles": "^0.9.2",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.4.1",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "^2.1.0",
"karma-junit-reporter": "^2.0.1",
"karma-spec-reporter": "^0.0.36",
"karma-viewport": "^1.0.9",
"ng-packagr": "^19.0.1",
"puppeteer": "^23.11.1",
"tslib": "^2.3.0",
"typescript": "5.6.3"
}
}
11 changes: 10 additions & 1 deletion tools/ReFlex.TrackingServer/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,16 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
try
{
var window = await Electron.WindowManager.CreateWindowAsync();
var window = await Electron.WindowManager.CreateWindowAsync(
new ElectronNET.API.Entities.BrowserWindowOptions
{
WebPreferences = new ElectronNET.API.Entities.WebPreferences
{
NodeIntegration = false,
ContextIsolation = true
}
}
);
window.SetFullScreen(true);
window.SetAutoHideMenuBar(true);
}
Expand Down
Loading