Skip to content

Commit

Permalink
Fix Angular app not building correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
9inpachi committed Aug 27, 2024
1 parent 51e4186 commit 975521a
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 22 deletions.
1 change: 0 additions & 1 deletion packages/phoenix-event-display/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "API for web-based experiment independent event display.",
"main": "dist/index",
"types": "dist/index",
"type": "module",
"author": "Phoenix contributors (https://github.com/HSF/phoenix/graphs/contributors)",
"license": "Apache-2.0",
"homepage": "http://github.com/HSF/phoenix/tree/main/packages/phoenix-event-display#readme",
Expand Down
3 changes: 2 additions & 1 deletion packages/phoenix-event-display/src/event-display.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { httpRequest, build, openFile } from 'jsroot';
import { httpRequest, openFile } from 'jsroot';
import { settings as jsrootSettings } from 'jsroot';
import { build } from 'jsroot/geom';
import { ThreeManager } from './managers/three-manager/index.js';
import { UIManager } from './managers/ui-manager/index.js';
import { InfoLogger } from './helpers/info-logger.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,8 @@ export class PhoenixObjects {

// if radius is not part of clusterParams then set it to defaultRadius (if cylindrical is false), or radius+defaultZ otherwise
const radius = cylindrical
? clusterParams.radius ?? defaultRadius + defaultZ
: clusterParams.radius ?? defaultRadius;
? (clusterParams.radius ?? defaultRadius + defaultZ)
: (clusterParams.radius ?? defaultRadius);

const position = CoordinateHelper.sphericalToCartesian(
radius,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LoadingManager } from '../managers/loading-manager.js';
import { LoadingManager } from '../managers/loading-manager';

/**
* Script loader for dynamically loading external scripts.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class ThreeManager {
/** Store the name of the object of first intersect while finding 3D Distance */
private prevIntersectName: string = '';
/** Canvas used for rendering the distance line */
private distanceCanvas: HTMLCanvasElement = new HTMLCanvasElement();
private distanceCanvas: HTMLCanvasElement = document.createElement('canvas');
/** Color of the text to be displayed as per dark theme */
private displayColor: string = 'black';
/** Mousemove callback to draw dynamic distance line */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Stats from 'stats.js';
import Stats from 'three/examples/jsm/libs/stats.module.js';
import { Color, Object3D, Vector3 } from 'three';
import { ThreeManager } from '../three-manager/index.js';
import type { Configuration } from '../../lib/types/configuration.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class PhoenixMenuUI implements PhoenixUI<PhoenixMenuNode> {
*/
public addEventDataFolder() {
// Phoenix menu
if (this.eventFolder !== null) {
if (this.eventFolder) {
this.eventFolderState = this.eventFolder.getNodeState();
this.eventFolder.remove();
}
Expand Down
10 changes: 3 additions & 7 deletions packages/phoenix-event-display/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@
"declaration": true,
"target": "es2020",
"outDir": "dist",
"module": "node16",
"moduleResolution": "node16",
"module": "esnext",
"moduleResolution": "node",
"sourceMap": true,
"declarationMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"strict": true,
"strictPropertyInitialization": false,
"verbatimModuleSyntax": true
"esModuleInterop": true
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
Expand Down
8 changes: 7 additions & 1 deletion packages/phoenix-ng/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
const { pathsToModuleNameMapper } = require('ts-jest');
const { paths } = require('./tsconfig.json').compilerOptions;

const esModules = ['@angular', '@ngrx', 'three/examples/jsm/', 'jsroot'];
const esModules = [
'@angular',
'@ngrx',
'three/examples/jsm/',
'jsroot',
'jsroot/geom',
];

// eslint-disable-next-line no-undef
globalThis.ngJest = {
Expand Down
8 changes: 2 additions & 6 deletions packages/phoenix-ng/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"sourceMap": true,
"declaration": false,
"experimentalDecorators": true,
"moduleResolution": "bundler",
"moduleResolution": "node",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
Expand All @@ -18,11 +18,7 @@
"phoenix-ui-components": [
"./projects/phoenix-ui-components/lib/public_api.ts"
]
},
"noEmit": true, // or `emitDeclarationOnly`
"allowImportingTsExtensions": true,
"allowArbitraryExtensions": true,
"verbatimModuleSyntax": true, // or `isolatedModules`
}
},
"angularCompilerOptions": {
"strictTemplates": true,
Expand Down

0 comments on commit 975521a

Please sign in to comment.