From 1774789bf4f699c97e1ca3c373b7445cbf8aa4d7 Mon Sep 17 00:00:00 2001 From: "Michael J. Roberts" Date: Tue, 29 Mar 2022 10:21:24 +0100 Subject: [PATCH 1/2] chore: Upgraded @observerly/celestia => @observerly/polaris dependency. chore: Upgraded @observerly/celestia => @observerly/polaris dependency. Includes all necessary inline changes for the upgrade. --- package-lock.json | 19 +++++++++---------- package.json | 2 +- src/composables/useDegreeFormat/index.ts | 10 +++++----- .../useEquatorialCoordinate/index.ts | 12 ++++++------ src/composables/useMount/index.ts | 6 +++--- src/composables/useObserver/index.ts | 2 +- 6 files changed, 25 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index 46037e5..a48b64a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.11.1", "license": "ISC", "dependencies": { - "@observerly/celestia": "^0.19.3", + "@observerly/polaris": "^0.53.0", "@vueuse/core": "^7.4.1", "vue": "^3.2.26" }, @@ -1266,11 +1266,10 @@ "node": ">= 8" } }, - "node_modules/@observerly/celestia": { - "version": "0.19.3", - "resolved": "https://npm.pkg.github.com/download/@observerly/celestia/0.19.3/cc5e7c4a95e852e49ed391255b887e743f41cefa40c411f0d8c1c1245bce1ad9", - "integrity": "sha512-zr0MNdBgVhsQyk84PYQ6GyqKBFwY0b/hnO/4gcsUCNazsM13CZfAT6IEVibTgcZGftW38rP/eqBdDZPyIhaNDw==", - "license": "ISC" + "node_modules/@observerly/polaris": { + "version": "0.53.0", + "resolved": "https://npm.pkg.github.com/download/@observerly/polaris/0.53.0/7bfff59d87d51cfe2a229942b8d3b756831feede29f252d89d3eb69b9eb8f5a9", + "integrity": "sha512-QvtQ1O0XaoqciDvb4pGMDl2FPoF7SAJZ55Cm7n94RsF96HNRbxXsPlqyHnqKppHF96UrlDOhRITpMnCjbZxCVw==" }, "node_modules/@rollup/plugin-typescript": { "version": "8.3.0", @@ -23650,10 +23649,10 @@ "fastq": "^1.6.0" } }, - "@observerly/celestia": { - "version": "0.19.3", - "resolved": "https://npm.pkg.github.com/download/@observerly/celestia/0.19.3/cc5e7c4a95e852e49ed391255b887e743f41cefa40c411f0d8c1c1245bce1ad9", - "integrity": "sha512-zr0MNdBgVhsQyk84PYQ6GyqKBFwY0b/hnO/4gcsUCNazsM13CZfAT6IEVibTgcZGftW38rP/eqBdDZPyIhaNDw==" + "@observerly/polaris": { + "version": "0.53.0", + "resolved": "https://npm.pkg.github.com/download/@observerly/polaris/0.53.0/7bfff59d87d51cfe2a229942b8d3b756831feede29f252d89d3eb69b9eb8f5a9", + "integrity": "sha512-QvtQ1O0XaoqciDvb4pGMDl2FPoF7SAJZ55Cm7n94RsF96HNRbxXsPlqyHnqKppHF96UrlDOhRITpMnCjbZxCVw==" }, "@rollup/plugin-typescript": { "version": "8.3.0", diff --git a/package.json b/package.json index e08c8ed..4681fcc 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "vue-tsc": "^0.30.1" }, "dependencies": { - "@observerly/celestia": "^0.19.3", + "@observerly/polaris": "^0.53.0", "@vueuse/core": "^7.4.1", "vue": "^3.2.26" } diff --git a/src/composables/useDegreeFormat/index.ts b/src/composables/useDegreeFormat/index.ts index 85b39de..2177ec7 100644 --- a/src/composables/useDegreeFormat/index.ts +++ b/src/composables/useDegreeFormat/index.ts @@ -4,9 +4,9 @@ import { } from 'vue' import { - parseDDToDMSHumanised, - parseDDToHMSHumanised -} from '@observerly/celestia' + parseDegreeToDMSHumanised, + parseDegreeToHMSHumanised +} from '@observerly/polaris' export interface UseDegreeFormatOptions { format: 'dms' | 'hms' @@ -24,11 +24,11 @@ export const useDegreeFormat = ( const applyFormat = (degree: number) => { if (format === 'dms') { - degreeFormat.value = parseDDToDMSHumanised(degree) + degreeFormat.value = parseDegreeToDMSHumanised(degree) } if (format === 'hms') { - degreeFormat.value = parseDDToHMSHumanised(degree) + degreeFormat.value = parseDegreeToHMSHumanised(degree) } } diff --git a/src/composables/useEquatorialCoordinate/index.ts b/src/composables/useEquatorialCoordinate/index.ts index 78e785f..214c993 100644 --- a/src/composables/useEquatorialCoordinate/index.ts +++ b/src/composables/useEquatorialCoordinate/index.ts @@ -11,13 +11,13 @@ import type { import { convertEquatorialToHorizontal, - stereoProjectHorizontalToCartesian2DCoordinate -} from '@observerly/celestia' + convertHorizontalToStereo +} from '@observerly/polaris' import type { - Cartesian2DCoordinate, + CartesianCoordinate, EquatorialCoordinate -} from '@observerly/celestia' +} from '@observerly/polaris' export interface UseEquatorialCoordinateOptions { /** @@ -49,7 +49,7 @@ export interface UseEquatorialCoordinateOptions { * Dimenions (Width & Height) of the Projection Surface: * */ - dimensions: ComputedRef + dimensions: ComputedRef /** * * @@ -149,7 +149,7 @@ export const useEquatorialCoordinate = ( const height = dimensions.value.y - const { x: X, y: Y } = stereoProjectHorizontalToCartesian2DCoordinate( + const { x: X, y: Y } = convertHorizontalToStereo( { alt: alt.value, az: az.value diff --git a/src/composables/useMount/index.ts b/src/composables/useMount/index.ts index 68498e7..a91e741 100644 --- a/src/composables/useMount/index.ts +++ b/src/composables/useMount/index.ts @@ -5,8 +5,8 @@ import { import { EquatorialCoordinate, HorizontalCoordinate, - convertDegreesToHours -} from '@observerly/celestia' + convertDegreeToHour +} from '@observerly/polaris' import { UseStatusResponse @@ -93,7 +93,7 @@ export const useMount = (options: UseMountOptions = defaultMountOptions): UseMou ): Promise => { const { ra, dec } = params - const ha = convertDegreesToHours(ra) + const ha = convertDegreeToHour(ra) const uri: URL = new URL(`${baseURL}/goto/coordinates/equatorial`) diff --git a/src/composables/useObserver/index.ts b/src/composables/useObserver/index.ts index 0d94129..54472f6 100644 --- a/src/composables/useObserver/index.ts +++ b/src/composables/useObserver/index.ts @@ -14,7 +14,7 @@ import { import type { HorizontalCoordinate -} from '@observerly/celestia' +} from '@observerly/polaris' // Ensuring any number meets validation for latitude: export const validateLatitude = (latitude: number): boolean => { From 75064cc47372cdcc98f5465b60b3f4db7e0db335 Mon Sep 17 00:00:00 2001 From: "Michael J. Roberts" Date: Tue, 29 Mar 2022 10:28:53 +0100 Subject: [PATCH 2/2] tests: Updated tests to follow the new @observerly/polaris format for DMS. tests: Updated tests to follow the new @observerly/polaris format for DMS. Includes ensuring correct import. --- src/composables/useDegreeFormat/index.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/composables/useDegreeFormat/index.test.ts b/src/composables/useDegreeFormat/index.test.ts index 18e179a..116e83d 100644 --- a/src/composables/useDegreeFormat/index.test.ts +++ b/src/composables/useDegreeFormat/index.test.ts @@ -13,7 +13,7 @@ import { import type { EquatorialCoordinate -} from '@observerly/celestia' +} from '@observerly/polaris' import { useSetup @@ -46,7 +46,7 @@ describe('useDegreeFormat', () => { format: 'dms' }) - expect(degreeFormat.value).toBe('7º 24\' 25.43"') + expect(degreeFormat.value).toBe('+07° 24\' 25.43"') }) }) }) \ No newline at end of file