From 39dafec2f404773ed5e66c6a675649525210fb3c Mon Sep 17 00:00:00 2001 From: Vladimir-Ayrikh Date: Tue, 29 Nov 2022 19:08:54 +0300 Subject: [PATCH 1/4] TILES-4804 Added RulerData type test --- package.json | 2 +- src/types.ts | 4 ---- test/screenshots/api.screen.ts | 19 ++++++++++--------- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index dbb0473..2221463 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "dist/*" ], "scripts": { - "build": "npm run clean && webpack --production && npm run build:docs && npm run build:typings", + "build": "npm run clean && npm run build:typings && webpack --production && npm run build:docs", "build-demo": "npm run clean && webpack --demo && npm run build:docs", "build:docs": "node build/documentalist", "build:typings": "tsc -p tsconfig.module.json --declaration --emitDeclarationOnly", diff --git a/src/types.ts b/src/types.ts index abd3bf2..3f5d04b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -40,10 +40,6 @@ export interface RulerEvent { data: RulerData; } -/** - * @hidden - * @internal - */ export interface BaseData { type: RulerMode; } diff --git a/test/screenshots/api.screen.ts b/test/screenshots/api.screen.ts index 50f226f..54c3d08 100644 --- a/test/screenshots/api.screen.ts +++ b/test/screenshots/api.screen.ts @@ -8,6 +8,7 @@ import { waitForReadiness, } from '../puppeteer/utils'; import { MAP_CENTER, PAGE_CENTER } from '../puppeteer/config'; +import { RulerData } from '../../dist/types/types'; let page: Page; @@ -354,7 +355,7 @@ describe('Ruler API', () => { await page.evaluate(() => { window.ruler = new window.Ruler(window.sdk.map, { mode: 'polyline' }); }); - const data = await page.evaluate(() => { + const data = await page.evaluate((): RulerData => { return window.ruler.getData(); }); expect(data).toEqual({ @@ -369,7 +370,7 @@ describe('Ruler API', () => { window.ruler = new window.Ruler(window.sdk.map, { mode: 'polyline' }); window.ruler.disable(); }); - const data = await page.evaluate(() => { + const data = await page.evaluate((): RulerData => { return window.ruler.getData(); }); expect(data).toEqual({ @@ -384,7 +385,7 @@ describe('Ruler API', () => { window.ruler = new window.Ruler(window.sdk.map, { mode: 'polyline' }); window.ruler.destroy(); }); - const data = await page.evaluate(() => { + const data = await page.evaluate((): RulerData => { return window.ruler.getData(); }); expect(data).toEqual({ @@ -403,7 +404,7 @@ describe('Ruler API', () => { window.ready = false; }, points); await waitForReadiness(page); - const data = await page.evaluate(() => { + const data = await page.evaluate((): RulerData => { return window.ruler.getData(); }); expect(data.type).toBe('polyline'); @@ -416,7 +417,7 @@ describe('Ruler API', () => { await page.evaluate(() => { window.ruler = new window.Ruler(window.sdk.map, { mode: 'polygon' }); }); - const data = await page.evaluate(() => { + const data = await page.evaluate((): RulerData => { return window.ruler.getData(); }); expect(data).toEqual({ @@ -432,7 +433,7 @@ describe('Ruler API', () => { window.ruler = new window.Ruler(window.sdk.map, { mode: 'polygon' }); window.ruler.disable(); }); - const data = await page.evaluate(() => { + const data = await page.evaluate((): RulerData => { return window.ruler.getData(); }); expect(data).toEqual({ @@ -448,7 +449,7 @@ describe('Ruler API', () => { window.ruler = new window.Ruler(window.sdk.map, { mode: 'polygon' }); window.ruler.destroy(); }); - const data = await page.evaluate(() => { + const data = await page.evaluate((): RulerData => { return window.ruler.getData(); }); expect(data).toEqual({ @@ -470,7 +471,7 @@ describe('Ruler API', () => { }, points); await waitForReadiness(page); - const data = await page.evaluate(() => { + const data = await page.evaluate((): RulerData => { return window.ruler.getData(); }); expect(data.type).toBe('polygon'); @@ -491,7 +492,7 @@ describe('Ruler API', () => { window.ready = false; }, points); - const data = await page.evaluate(() => { + const data = await page.evaluate((): RulerData => { return window.ruler.getData(); }); expect(data.type).toBe('polygon'); From 53dd7cac76107369511b8df34777e98a48353328 Mon Sep 17 00:00:00 2001 From: Vladimir-Ayrikh Date: Wed, 30 Nov 2022 11:23:57 +0300 Subject: [PATCH 2/4] Reverted building changes, types in tests --- package.json | 2 +- test/screenshots/api.screen.ts | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 2221463..dbb0473 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "dist/*" ], "scripts": { - "build": "npm run clean && npm run build:typings && webpack --production && npm run build:docs", + "build": "npm run clean && webpack --production && npm run build:docs && npm run build:typings", "build-demo": "npm run clean && webpack --demo && npm run build:docs", "build:docs": "node build/documentalist", "build:typings": "tsc -p tsconfig.module.json --declaration --emitDeclarationOnly", diff --git a/test/screenshots/api.screen.ts b/test/screenshots/api.screen.ts index 54c3d08..50f226f 100644 --- a/test/screenshots/api.screen.ts +++ b/test/screenshots/api.screen.ts @@ -8,7 +8,6 @@ import { waitForReadiness, } from '../puppeteer/utils'; import { MAP_CENTER, PAGE_CENTER } from '../puppeteer/config'; -import { RulerData } from '../../dist/types/types'; let page: Page; @@ -355,7 +354,7 @@ describe('Ruler API', () => { await page.evaluate(() => { window.ruler = new window.Ruler(window.sdk.map, { mode: 'polyline' }); }); - const data = await page.evaluate((): RulerData => { + const data = await page.evaluate(() => { return window.ruler.getData(); }); expect(data).toEqual({ @@ -370,7 +369,7 @@ describe('Ruler API', () => { window.ruler = new window.Ruler(window.sdk.map, { mode: 'polyline' }); window.ruler.disable(); }); - const data = await page.evaluate((): RulerData => { + const data = await page.evaluate(() => { return window.ruler.getData(); }); expect(data).toEqual({ @@ -385,7 +384,7 @@ describe('Ruler API', () => { window.ruler = new window.Ruler(window.sdk.map, { mode: 'polyline' }); window.ruler.destroy(); }); - const data = await page.evaluate((): RulerData => { + const data = await page.evaluate(() => { return window.ruler.getData(); }); expect(data).toEqual({ @@ -404,7 +403,7 @@ describe('Ruler API', () => { window.ready = false; }, points); await waitForReadiness(page); - const data = await page.evaluate((): RulerData => { + const data = await page.evaluate(() => { return window.ruler.getData(); }); expect(data.type).toBe('polyline'); @@ -417,7 +416,7 @@ describe('Ruler API', () => { await page.evaluate(() => { window.ruler = new window.Ruler(window.sdk.map, { mode: 'polygon' }); }); - const data = await page.evaluate((): RulerData => { + const data = await page.evaluate(() => { return window.ruler.getData(); }); expect(data).toEqual({ @@ -433,7 +432,7 @@ describe('Ruler API', () => { window.ruler = new window.Ruler(window.sdk.map, { mode: 'polygon' }); window.ruler.disable(); }); - const data = await page.evaluate((): RulerData => { + const data = await page.evaluate(() => { return window.ruler.getData(); }); expect(data).toEqual({ @@ -449,7 +448,7 @@ describe('Ruler API', () => { window.ruler = new window.Ruler(window.sdk.map, { mode: 'polygon' }); window.ruler.destroy(); }); - const data = await page.evaluate((): RulerData => { + const data = await page.evaluate(() => { return window.ruler.getData(); }); expect(data).toEqual({ @@ -471,7 +470,7 @@ describe('Ruler API', () => { }, points); await waitForReadiness(page); - const data = await page.evaluate((): RulerData => { + const data = await page.evaluate(() => { return window.ruler.getData(); }); expect(data.type).toBe('polygon'); @@ -492,7 +491,7 @@ describe('Ruler API', () => { window.ready = false; }, points); - const data = await page.evaluate((): RulerData => { + const data = await page.evaluate(() => { return window.ruler.getData(); }); expect(data.type).toBe('polygon'); From d14f396978a099153ccab12035de6c9465c28d84 Mon Sep 17 00:00:00 2001 From: Vladimir-Ayrikh Date: Thu, 1 Dec 2022 14:08:13 +0300 Subject: [PATCH 3/4] Bumped verison (v2.0.6) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dbb0473..1def816 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@2gis/mapgl-ruler", - "version": "2.0.5", + "version": "2.0.6", "description": "", "license": "BSD-2-Clause", "main": "dist/ruler.js", From 234a9a10b9ee1c3435858e50a059e826e07cee23 Mon Sep 17 00:00:00 2001 From: Vladimir-Ayrikh Date: Thu, 1 Dec 2022 15:27:10 +0300 Subject: [PATCH 4/4] Updated package-lock --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 92045b4..aba1db1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@2gis/mapgl-ruler", - "version": "2.0.5", + "version": "2.0.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@2gis/mapgl-ruler", - "version": "2.0.5", + "version": "2.0.6", "license": "BSD-2-Clause", "devDependencies": { "@2gis/mapgl": "^1.25.0",