Skip to content

Commit 26f6be5

Browse files
committed
Updated with new @tubular packages to get rid of CommonJS warnings, as well as getting rid of most dependencies on lodash (the remainder of which are now supported by lodash-es).
1 parent e7b83a8 commit 26f6be5

49 files changed

Lines changed: 835 additions & 944 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

angular.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"src/favicon.ico",
2323
{
2424
"glob": "**/*",
25-
"input": "node_modules/ks-astronomy/dist/resources",
25+
"input": "node_modules/@tubular/astronomy/dist/resources",
2626
"output": "/assets/resources"
2727
}
2828
],
@@ -101,7 +101,7 @@
101101
"src/favicon.ico",
102102
{
103103
"glob": "**/*",
104-
"input": "node_modules/ks-astronomy/dist/resources",
104+
"input": "node_modules/@tubular/astronomy/dist/resources",
105105
"output": "/assets/resources"
106106
}
107107
]

package-lock.json

Lines changed: 643 additions & 748 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
"@angular/platform-browser-dynamic": "^10.2.3",
2626
"@angular/router": "^10.2.3",
2727
"@fortawesome/fontawesome-free": "^5.15.1",
28+
"@tubular/astronomy": "^2.0.5",
29+
"@tubular/math": "^2.1.3",
30+
"@tubular/time": "^2.3.0",
31+
"@tubular/util": "^3.1.3",
2832
"array-buffer-reader": "^1.0.4",
2933
"core-js": "^2.6.12",
3034
"detect-resize": "^0.1.5",
31-
"ks-astronomy": "^1.3.2",
32-
"ks-date-time-zone": "^1.9.0",
33-
"ks-math": "^1.2.1",
34-
"ks-util": "^1.11.3",
35-
"lodash": "^4.17.20",
35+
"lodash-es": "^4.17.20",
3636
"ng-busy": "^10.0.0",
3737
"primeicons": "^4.1.0",
3838
"primeng": "^10.0.3",
@@ -48,7 +48,7 @@
4848
"@types/googlemaps": "^3.40.3",
4949
"@types/jasmine": "^3.6.2",
5050
"@types/jasminewd2": "^2.0.8",
51-
"@types/lodash": "^4.14.165",
51+
"@types/lodash-es": "^4.17.4",
5252
"codelyzer": "^5.1.2",
5353
"jasmine-core": "~3.5.0",
5454
"jasmine-spec-reporter": "~5.0.0",

src/app/app.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ <h2>Sky View Café NP</h2>
2828
<button pButton type="button" (click)="setToNow()" [disabled]="trackTime" label="Now"></button>
2929
</div>
3030
<div class="time-panel-item">
31-
<svc-time-editor [(ngModel)]="time" [timeZone]="timeZone" [viewOnly]="trackTime" [gregorianChangeDate]="gcDate"
31+
<svc-time-editor [(ngModel)]="time" [timezone]="timezone" [viewOnly]="trackTime" [gregorianChangeDate]="gcDate"
3232
[nativeDateTime]="nativeDateTime"></svc-time-editor>
3333
</div>
3434
<div class="time-panel-item">
3535
<p-overlayPanel #calendarPopup class="calendar-popup">
36-
<ks-calendar [(ngModel)]="date" [timeZone]="timeZone" [gregorianChangeDate]="gcDate" [showDst]="true" [minYear]="-6000" [maxYear]="9999"
36+
<ks-calendar [(ngModel)]="date" [timezone]="timezone" [gregorianChangeDate]="gcDate" [showDst]="true" [minYear]="-6000" [maxYear]="9999"
3737
(dayClick)="calendarPopup.hide()"></ks-calendar>
3838
</p-overlayPanel>
3939
<ks-icon-button [disabled]="trackTime" icon="far fa-calendar-alt" (click)="calendarPopup.toggle($event)"></ks-icon-button>&nbsp;

src/app/app.component.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323
import { AfterViewInit, Component, HostListener, OnDestroy } from '@angular/core';
2424
import { Router } from '@angular/router';
25-
import { KsDateTime, KsTimeZone, YMDDate } from 'ks-date-time-zone';
26-
import { toggleFullScreen } from 'ks-util';
27-
import { debounce } from 'lodash';
25+
import { DateTime, Timezone, YMDDate } from '@tubular/time';
26+
import { toggleFullScreen } from '@tubular/util';
27+
import { debounce } from 'lodash-es';
2828
import { MenuItem, MessageService } from 'primeng/api';
2929
import { Subscription, timer } from 'rxjs';
3030
import { AppService, currentMinuteMillis, CurrentTab, PROPERTY_GREGORIAN_CHANGE_DATE, PROPERTY_NATIVE_DATE_TIME,
@@ -41,10 +41,10 @@ const MIN_APP_HEIGHT = 640;
4141
providers: [AppService, MessageService]
4242
})
4343
export class AppComponent implements AfterViewInit, OnDestroy {
44-
private dateTime = new KsDateTime(null, KsTimeZone.OS_ZONE);
44+
private dateTime = new DateTime(null, Timezone.OS_ZONE);
4545
private _date = <YMDDate> {};
4646
private debouncedResize: () => void;
47-
private _timeZone: KsTimeZone = KsTimeZone.OS_ZONE;
47+
private _timeZone: Timezone = Timezone.OS_ZONE;
4848
private _time: number = this.dateTime.utcTimeMillis;
4949
private _trackTime = false;
5050
private timer: Subscription;
@@ -125,7 +125,7 @@ export class AppComponent implements AfterViewInit, OnDestroy {
125125
}
126126
}
127127

128-
get timeZone(): KsTimeZone { return this._timeZone; }
128+
get timezone(): Timezone { return this._timeZone; }
129129

130130
get date(): YMDDate {
131131
const wt = this.dateTime.wallTime;
@@ -168,8 +168,8 @@ export class AppComponent implements AfterViewInit, OnDestroy {
168168
}
169169

170170
private updateTimeZone(): void {
171-
this._timeZone = KsTimeZone.getTimeZone(this.app.location.zone, this.app.location.longitude);
172-
this.dateTime.timeZone = this._timeZone;
171+
this._timeZone = Timezone.getTimezone(this.app.location.zone, this.app.location.longitude);
172+
this.dateTime.timezone = this._timeZone;
173173

174174
if (this._timeZone.error)
175175
this.messageService.add({key: 'general', severity: 'error', summary: 'Failed to retrieve time zone',

src/app/app.service.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import { HttpClient } from '@angular/common/http';
2424
import { Injectable } from '@angular/core';
2525
import { DomSanitizer } from '@angular/platform-browser';
2626
import { NavigationEnd, Router } from '@angular/router';
27-
import { SolarSystem, StarCatalog } from 'ks-astronomy';
28-
import { KsCalendar } from 'ks-date-time-zone';
29-
import { clone, compact, debounce, forEach, isEqual, isString, sortedIndexBy } from 'lodash';
27+
import { SolarSystem, StarCatalog } from '@tubular/astronomy';
28+
import { Calendar } from '@tubular/time';
29+
import { clone, compact, debounce, forEach, isEqual, isString, sortedIndexBy } from 'lodash-es';
3030
import { BehaviorSubject, Observable, Subject, Subscription } from 'rxjs';
3131
import { AstroDataService } from './astronomy/astro-data.service';
3232

@@ -211,7 +211,7 @@ export class AppService {
211211
}
212212
sendAppEvent(appEventOrName: AppEvent | string, value?: any): void {
213213
if (isString(appEventOrName))
214-
this._appEvent.next({name: appEventOrName, value: value});
214+
this._appEvent.next({ name: appEventOrName, value: value });
215215
else
216216
this._appEvent.next(appEventOrName);
217217
}
@@ -256,8 +256,8 @@ export class AppService {
256256
}
257257
}
258258

259-
get timeZone(): string { return this._location.getValue().zone; }
260-
set timeZone(newZone: string) {
259+
get timezone(): string { return this._location.getValue().zone; }
260+
set timezone(newZone: string) {
261261
if (this._location.getValue().zone !== newZone) {
262262
const newLocation = clone(this._location.getValue());
263263

@@ -395,7 +395,7 @@ export class AppService {
395395
return CalendarSetting.CUSTOM_GCD;
396396
}
397397

398-
applyCalendarType(dateTime: KsCalendar): void {
398+
applyCalendarType(dateTime: Calendar): void {
399399
if (dateTime)
400400
dateTime.setGregorianChange(this._gcDate);
401401
}

src/app/astronomy/astro-data.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import { HttpClient } from '@angular/common/http';
2121
import { Injectable } from '@angular/core';
22-
import { AsteroidCometInfo, IAstroDataService } from 'ks-astronomy';
22+
import { AsteroidCometInfo, IAstroDataService } from '@tubular/astronomy';
2323

2424
@Injectable()
2525
export class AstroDataService implements IAstroDataService {

src/app/svc/generic-planetary-view.directive.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
*/
2222

2323
import { AfterViewInit, Directive } from '@angular/core';
24-
import * as C_ from 'ks-astronomy';
24+
import * as C_ from '@tubular/astronomy';
2525
import {
2626
ABERRATION, EARTH, Ecliptic, KM_PER_AU, MOON, MOON_SHADOW, NEPTUNE, NO_MATCH, NO_SELECTION, NUTATION, PlanetaryMoons, PLUTO,
2727
SolarSystem, SUN, TOPOCENTRIC, UNKNOWN_MAGNITUDE, URANUS
28-
} from 'ks-astronomy';
28+
} from '@tubular/astronomy';
2929
import {
3030
abs, Angle, cos_deg, floor, FMT_MINS, FMT_SECS, intersects, max, min, mod2, Point, Rectangle, round, sin_deg, SphericalPosition,
3131
SphericalPosition3D, sqrt, TWO_PI, union
32-
} from 'ks-math';
33-
import { getTextWidth, toDefaultLocaleFixed } from 'ks-util';
32+
} from '@tubular/math';
33+
import { getTextWidth, toDefaultLocaleFixed } from '@tubular/util';
3434
import { AppService, CurrentTab, PROPERTY_NORTH_AZIMUTH, UserSetting, VIEW_APP } from '../app.service';
3535
import { DrawingContext, GenericViewDirective } from './generic-view.directive';
3636

src/app/svc/generic-sky-view.directive.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
*/
2222

2323
import { AfterViewInit, Directive } from '@angular/core';
24-
import { LABEL_ANCHOR, LINE_BREAK, NO_MATCH, REFRACTION } from 'ks-astronomy';
25-
import { max, min, Point, pow, round, SphericalPosition, SphericalPosition3D } from 'ks-math';
26-
import { strokeEllipse } from 'ks-util';
27-
import { reverse, sortBy } from 'lodash';
24+
import { LABEL_ANCHOR, LINE_BREAK, NO_MATCH, REFRACTION } from '@tubular/astronomy';
25+
import { max, min, Point, pow, round, SphericalPosition, SphericalPosition3D } from '@tubular/math';
26+
import { strokeEllipse } from '@tubular/util';
27+
import { reverse, sortBy } from 'lodash-es';
2828
import { AppService, CurrentTab } from '../app.service';
2929
import {
3030
DrawingContextPlanetary, FAR_AWAY, GenericPlanetaryViewDirective, highlightedStarColor, LABEL_TYPE, NONPLANET, SELECTION_TYPE,

src/app/svc/generic-view.directive.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ import { SafeStyle } from '@angular/platform-browser';
2525
import {
2626
ASTEROID_BASE, COMET_BASE, EARTH, FIRST_PLANET, HALF_MINUTE, ISkyObserver, LAST_PLANET, NO_MATCH, SkyObserver, SolarSystem,
2727
StarCatalog, UT_to_TDB
28-
} from 'ks-astronomy';
29-
import { KsDateTime } from 'ks-date-time-zone';
30-
import { ceil, max, round, sqrt } from 'ks-math';
31-
import { FontMetrics, getFontMetrics, isSafari, padLeft } from 'ks-util';
32-
import { clone, debounce, isString, throttle } from 'lodash';
28+
} from '@tubular/astronomy';
29+
import { DateTime } from '@tubular/time';
30+
import { ceil, max, round, sqrt } from '@tubular/math';
31+
import { FontMetrics, getFontMetrics, isSafari, padLeft } from '@tubular/util';
32+
import { clone, debounce, isString, throttle } from 'lodash-es';
3333
import { BehaviorSubject, Observable, Subscription } from 'rxjs';
3434
import { AppService, CurrentTab } from '../app.service';
3535
import { getXYForTouchEvent } from '../util/ks-touch-events';
@@ -458,7 +458,7 @@ export abstract class GenericViewDirective implements AfterViewInit {
458458
dc.ss = this.appService.solarSystem;
459459
dc.skyObserver = new SkyObserver(this.appService.longitude, this.appService.latitude);
460460
// Bias time half a minute ahead of the clock time for rounding to the middle of the selected minute.
461-
dc.jdu = KsDateTime.julianDay(this.time) + HALF_MINUTE;
461+
dc.jdu = DateTime.julianDay(this.time) + HALF_MINUTE;
462462
dc.jde = UT_to_TDB(dc.jdu);
463463
dc.inkSaver = GenericViewDirective.printing && this.appService.inkSaver;
464464

0 commit comments

Comments
 (0)