@luma.gl/test-utils 9.0.0-alpha.4 → 9.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/create-test-context.ts"],"names":["createTestDevice","createTestContext","opts","device","gl"],"mappings":"AAAA,SAASA,gBAAT,QAAiC,sBAAjC;AAEA,OAAO,SAASC,iBAAT,CAA2BC,IAAyB,GAAG,EAAvD,EAAyF;AAC9F,QAAMC,MAAM,GAAGH,gBAAgB,CAACE,IAAD,CAA/B;AACA,SAAOC,MAAM,IAAIA,MAAM,CAACC,EAAxB;AACD","sourcesContent":["import { createTestDevice } from \"./create-test-device\";\n\nexport function createTestContext(opts: Record<string, any> = {}): WebGLRenderingContext | null {\n const device = createTestDevice(opts);\n return device && device.gl;\n}\n\n /*\nimport {isBrowser} from 'probe.gl/env';\nimport {createGLContext, instrumentGLContext} from '@luma.gl/gltools';\nimport {createHeadlessContext} from './create-headless-context';\n\nexport function createTestContext(opts: Record<string, any> = {}): WebGLRenderingContext | null {\n // try {\n if (!isBrowser()) {\n if (opts.webgl2 && !opts.webgl1) {\n return null;\n }\n const gl = createHeadlessContext(opts);\n return gl ? instrumentGLContext(gl) : null;\n }\n return createGLContext(opts);\n // } catch {\n // if (opts.webgl2) {\n // return null;\n // }\n // }\n}\n*/\n"],"file":"create-test-context.js"}
1
+ {"version":3,"sources":["../src/create-test-context.ts"],"names":["createTestDevice","createTestContext","opts","device","gl"],"mappings":"AAAA,SAASA,gBAAT,QAAiC,sBAAjC;AAEA,OAAO,SAASC,iBAAT,CAA2BC,IAAyB,GAAG,EAAvD,EAAyF;AAC9F,QAAMC,MAAM,GAAGH,gBAAgB,CAACE,IAAD,CAA/B;AACA,SAAOC,MAAM,IAAIA,MAAM,CAACC,EAAxB;AACD","sourcesContent":["import { createTestDevice } from \"./create-test-device\";\n\nexport function createTestContext(opts: Record<string, any> = {}): WebGLRenderingContext | null {\n const device = createTestDevice(opts);\n return device && device.gl;\n}\n\n /*\nimport {isBrowser} from '@probe.gl/env';\nimport {createGLContext, instrumentGLContext} from '@luma.gl/gltools';\nimport {createHeadlessContext} from './create-headless-context';\n\nexport function createTestContext(opts: Record<string, any> = {}): WebGLRenderingContext | null {\n // try {\n if (!isBrowser()) {\n if (opts.webgl2 && !opts.webgl1) {\n return null;\n }\n const gl = createHeadlessContext(opts);\n return gl ? instrumentGLContext(gl) : null;\n }\n return createGLContext(opts);\n // } catch {\n // if (opts.webgl2) {\n // return null;\n // }\n // }\n}\n*/\n"],"file":"create-test-context.js"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-test-device.d.ts","sourceRoot":"","sources":["../src/create-test-device.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,cAAc,CAAC;AAEtD,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAiB7C,wBAAgB,gBAAgB,CAAC,KAAK,GAAE,WAAgB,GAAG,WAAW,GAAG,IAAI,CAU5E;AAED,eAAO,MAAM,gBAAgB,EAAE,WAAuF,CAAC;AACvH,eAAO,MAAM,gBAAgB,EAAE,WAAuF,CAAC;AACvH,0DAA0D;AAC1D,eAAO,IAAI,gBAAgB,EAAE,YAAY,CAAC;AAI1C,yDAAyD;AACzD,wBAAgB,mBAAmB,IAAI,WAAW,EAAE,CAEnD;AAED,0CAA0C;AAC1C,wBAAsB,cAAc,IAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAUzD"}
1
+ {"version":3,"file":"create-test-device.d.ts","sourceRoot":"","sources":["../src/create-test-device.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,cAAc,CAAC;AAEtD,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAiB7C,wBAAgB,gBAAgB,CAAC,KAAK,GAAE,WAAgB,GAAG,WAAW,GAAG,IAAI,CAU5E;AAED,eAAO,MAAM,gBAAgB,EAAE,WAAuF,CAAC;AACvH,eAAO,MAAM,gBAAgB,EAAE,WAAuF,CAAC;AACvH,0DAA0D;AAC1D,eAAO,IAAI,gBAAgB,EAAE,YAAY,CAAC;AAI1C,yDAAyD;AACzD,wBAAgB,mBAAmB,IAAI,WAAW,EAAE,CAEnD;AAED,0CAA0C;AAC1C,wBAAsB,cAAc,IAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAUzD"}
@@ -1,4 +1,4 @@
1
- import { isBrowser } from 'probe.gl/env';
1
+ import { isBrowser } from '@probe.gl/env';
2
2
  import { luma } from '@luma.gl/api';
3
3
  import { WebGLDevice } from '@luma.gl/webgl';
4
4
  import { createHeadlessContext } from './create-headless-context';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/create-test-device.ts"],"names":["isBrowser","luma","WebGLDevice","createHeadlessContext","ERR_HEADLESSGL_FAILED","ERR_HEADLESSGL_LOAD","CONTEXT_DEFAULTS","width","height","debug","createTestDevice","props","gl","undefined","error","console","id","message","webgl1TestDevice","webgl1","webgl2","webgl2TestDevice","webgpuTestDevice","webgpuCreated","getWebGLTestDevices","filter","Boolean","getTestDevices","createDevice","type"],"mappings":"AAAA,SAAQA,SAAR,QAAwB,cAAxB;AAEA,SAAQC,IAAR,QAAmB,cAAnB;AACA,SAAQC,WAAR,QAA0B,gBAA1B;AAEA,SAAQC,qBAAR,QAAoC,2BAApC;AAEA,MAAMC,qBAAqB,GACzB,sEADF;AAGA,MAAMC,mBAAmB,gPAAzB;AAKA,MAAMC,gBAAsC,GAAG;AAC7CC,EAAAA,KAAK,EAAE,CADsC;AAE7CC,EAAAA,MAAM,EAAE,CAFqC;AAG7CC,EAAAA,KAAK,EAAE;AAHsC,CAA/C;AAMA,OAAO,SAASC,gBAAT,CAA0BC,KA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D,CAEE,MAAM,CAEP;AACF;;AACD,SAAO,CAACP,gBAAD,EAAmBD,gBAAnB,EAAqCH,gBAArC,EAAuDO,MAAvD,CAA8DC,OAA9D,CAAP;AACD","sourcesContent":["import {isBrowser} from 'probe.gl/env';\nimport type {Device, DeviceProps} from '@luma.gl/api';\nimport {luma} from '@luma.gl/api';\nimport {WebGLDevice} from '@luma.gl/webgl';\nimport {WebGPUDevice} from '@luma.gl/webgpu';\nimport {createHeadlessContext} from './create-headless-context';\n\nconst ERR_HEADLESSGL_FAILED =\n 'Failed to create WebGL context in Node.js, headless gl returned null';\n\nconst ERR_HEADLESSGL_LOAD = `\\\n luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL \\\n contexts can not be created. This may not be an error. For example, this is a \\\n typical configuration for isorender applications running on the server.`;\n\nconst CONTEXT_DEFAULTS: Partial<DeviceProps> = {\n width: 1,\n height: 1,\n debug: true\n};\n\nexport function createTestDevice(props: DeviceProps = {}): WebGLDevice | null {\n try {\n const gl = !isBrowser() ? createHeadlessContext(props) : undefined;\n props = {...CONTEXT_DEFAULTS, ...props, gl, debug: true};\n // We dont use luma.createDevice since this tests current expect this context to be created synchronously\n return new WebGLDevice(props);\n } catch (error) {\n console.error(`Failed to created device '${props.id}': ${error.message}`);\n return null;\n }\n}\n\nexport const webgl1TestDevice: WebGLDevice = createTestDevice({id: 'webgl1-test-device', webgl1: true, webgl2: false});\nexport const webgl2TestDevice: WebGLDevice = createTestDevice({id: 'webgl2-test-device', webgl1: false, webgl2: true});\n/** Only available after getTestDevices() has completed */\nexport let webgpuTestDevice: WebGPUDevice;\n\nlet webgpuCreated = false;\n\n/** Synchronously get test devices (only WebGLDevices) */\nexport function getWebGLTestDevices(): WebGLDevice[] {\n return [webgl2TestDevice, webgl1TestDevice].filter(Boolean);\n}\n\n/** Includes WebGPU device if available */\nexport async function getTestDevices() : Promise<Device[]> {\n if (!webgpuCreated) {\n webgpuCreated = true;\n try {\n webgpuTestDevice = await luma.createDevice({id: 'webgpu-test-device', type: 'webgpu'}) as WebGPUDevice;\n } catch {\n // ignore (assume WebGPU was not available)\n }\n }\n return [webgpuTestDevice, webgl2TestDevice, webgl1TestDevice].filter(Boolean);\n}\n"],"file":"create-test-device.js"}
1
+ {"version":3,"sources":["../src/create-test-device.ts"],"names":["isBrowser","luma","WebGLDevice","createHeadlessContext","ERR_HEADLESSGL_FAILED","ERR_HEADLESSGL_LOAD","CONTEXT_DEFAULTS","width","height","debug","createTestDevice","props","gl","undefined","error","console","id","message","webgl1TestDevice","webgl1","webgl2","webgl2TestDevice","webgpuTestDevice","webgpuCreated","getWebGLTestDevices","filter","Boolean","getTestDevices","createDevice","type"],"mappings":"AAEA,SAAQA,SAAR,QAAwB,eAAxB;AAEA,SAAQC,IAAR,QAAmB,cAAnB;AACA,SAAQC,WAAR,QAA0B,gBAA1B;AAEA,SAAQC,qBAAR,QAAoC,2BAApC;AAEA,MAAMC,qBAAqB,GACzB,sEADF;AAGA,MAAMC,mBAAmB,gPAAzB;AAKA,MAAMC,gBAAsC,GAAG;AAC7CC,EAAAA,KAAK,EAAE,CADsC;AAE7CC,EAAAA,MAAM,EAAE,CAFqC;AAG7CC,EAAAA,KAAK,EAAE;AAHsC,CAA/C;AAMA,OAAO,SAASC,gBAAT,CAA0BC,KAAkB,GAAG,EAA/C,EAAuE;AAC5E,MAAI;AACF,UAAMC,EAAE,GAAG,CAACZ,SAAS,EAAV,GAAeG,qBAAqB,CAACQ,KAAD,CAApC,GAA8CE,SAAzD;AACAF,IAAAA,KAAK,GAAG,EAAC,GAAGL,gBAAJ;AAAsB,SAAGK,KAAzB;AAAgCC,MAAAA,EAAhC;AAAoCH,MAAAA,KAAK,EAAE;AAA3C,KAAR;AAEA,WAAO,IAAIP,WAAJ,CAAgBS,KAAhB,CAAP;AACD,GALD,CAKE,OAAOG,KAAP,EAAc;AACdC,IAAAA,OAAO,CAACD,KAAR,qCAA2CH,KAAK,CAACK,EAAjD,gBAAyDF,KAAK,CAACG,OAA/D;AACA,WAAO,IAAP;AACD;AACF;AAED,OAAO,MAAMC,gBAA6B,GAAGR,gBAAgB,CAAC;AAACM,EAAAA,EAAE,EAAE,oBAAL;AAA2BG,EAAAA,MAAM,EAAE,IAAnC;AAAyCC,EAAAA,MAAM,EAAE;AAAjD,CAAD,CAAtD;AACP,OAAO,MAAMC,gBAA6B,GAAGX,gBAAgB,CAAC;AAACM,EAAAA,EAAE,EAAE,oBAAL;AAA2BG,EAAAA,MAAM,EAAE,KAAnC;AAA0CC,EAAAA,MAAM,EAAE;AAAlD,CAAD,CAAtD;AAEP,OAAO,IAAIE,gBAAJ;AAEP,IAAIC,aAAa,GAAG,KAApB;AAGA,OAAO,SAASC,mBAAT,GAA8C;AACnD,SAAO,CAACH,gBAAD,EAAmBH,gBAAnB,EAAqCO,MAArC,CAA4CC,OAA5C,CAAP;AACD;AAGD,OAAO,eAAeC,cAAf,GAAoD;AACzD,MAAI,CAACJ,aAAL,EAAoB;AAClBA,IAAAA,aAAa,GAAG,IAAhB;;AACA,QAAI;AACFD,MAAAA,gBAAgB,GAAG,MAAMrB,IAAI,CAAC2B,YAAL,CAAkB;AAACZ,QAAAA,EAAE,EAAE,oBAAL;AAA2Ba,QAAAA,IAAI,EAAE;AAAjC,OAAlB,CAAzB;AACD,KAFD,CAEE,MAAM,CAEP;AACF;;AACD,SAAO,CAACP,gBAAD,EAAmBD,gBAAnB,EAAqCH,gBAArC,EAAuDO,MAAvD,CAA8DC,OAA9D,CAAP;AACD","sourcesContent":["// luma.gl, MIT license\n\nimport {isBrowser} from '@probe.gl/env';\nimport type {Device, DeviceProps} from '@luma.gl/api';\nimport {luma} from '@luma.gl/api';\nimport {WebGLDevice} from '@luma.gl/webgl';\nimport {WebGPUDevice} from '@luma.gl/webgpu';\nimport {createHeadlessContext} from './create-headless-context';\n\nconst ERR_HEADLESSGL_FAILED =\n 'Failed to create WebGL context in Node.js, headless gl returned null';\n\nconst ERR_HEADLESSGL_LOAD = `\\\n luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL \\\n contexts can not be created. This may not be an error. For example, this is a \\\n typical configuration for isorender applications running on the server.`;\n\nconst CONTEXT_DEFAULTS: Partial<DeviceProps> = {\n width: 1,\n height: 1,\n debug: true\n};\n\nexport function createTestDevice(props: DeviceProps = {}): WebGLDevice | null {\n try {\n const gl = !isBrowser() ? createHeadlessContext(props) : undefined;\n props = {...CONTEXT_DEFAULTS, ...props, gl, debug: true};\n // We dont use luma.createDevice since this tests current expect this context to be created synchronously\n return new WebGLDevice(props);\n } catch (error) {\n console.error(`Failed to created device '${props.id}': ${error.message}`);\n return null;\n }\n}\n\nexport const webgl1TestDevice: WebGLDevice = createTestDevice({id: 'webgl1-test-device', webgl1: true, webgl2: false});\nexport const webgl2TestDevice: WebGLDevice = createTestDevice({id: 'webgl2-test-device', webgl1: false, webgl2: true});\n/** Only available after getTestDevices() has completed */\nexport let webgpuTestDevice: WebGPUDevice;\n\nlet webgpuCreated = false;\n\n/** Synchronously get test devices (only WebGLDevices) */\nexport function getWebGLTestDevices(): WebGLDevice[] {\n return [webgl2TestDevice, webgl1TestDevice].filter(Boolean);\n}\n\n/** Includes WebGPU device if available */\nexport async function getTestDevices() : Promise<Device[]> {\n if (!webgpuCreated) {\n webgpuCreated = true;\n try {\n webgpuTestDevice = await luma.createDevice({id: 'webgpu-test-device', type: 'webgpu'}) as WebGPUDevice;\n } catch {\n // ignore (assume WebGPU was not available)\n }\n }\n return [webgpuTestDevice, webgl2TestDevice, webgl1TestDevice].filter(Boolean);\n}\n"],"file":"create-test-device.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luma.gl/test-utils",
3
- "version": "9.0.0-alpha.4",
3
+ "version": "9.0.0-alpha.6",
4
4
  "description": "Automated WebGL testing utilities with Puppeteer and image diffing",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -34,9 +34,9 @@
34
34
  "@probe.gl/env": "^3.5.0"
35
35
  },
36
36
  "peerDependencies": {
37
- "@luma.gl/core": "8.6.0-alpha.1",
38
- "@luma.gl/webgl": "8.6.0-alpha.1",
37
+ "@luma.gl/core": "9.0.0-alpha.5",
38
+ "@luma.gl/webgl": "9.0.0-alpha.5",
39
39
  "@probe.gl/test-utils": "^3.5.0"
40
40
  },
41
- "gitHead": "c1bbfa21e6e2cce41378a284b305ebfac39e998b"
41
+ "gitHead": "d4a92477c1d76f6242ec0fe377e238669e0667c0"
42
42
  }
@@ -6,7 +6,7 @@ export function createTestContext(opts: Record<string, any> = {}): WebGLRenderin
6
6
  }
7
7
 
8
8
  /*
9
- import {isBrowser} from 'probe.gl/env';
9
+ import {isBrowser} from '@probe.gl/env';
10
10
  import {createGLContext, instrumentGLContext} from '@luma.gl/gltools';
11
11
  import {createHeadlessContext} from './create-headless-context';
12
12
 
@@ -1,4 +1,6 @@
1
- import {isBrowser} from 'probe.gl/env';
1
+ // luma.gl, MIT license
2
+
3
+ import {isBrowser} from '@probe.gl/env';
2
4
  import type {Device, DeviceProps} from '@luma.gl/api';
3
5
  import {luma} from '@luma.gl/api';
4
6
  import {WebGLDevice} from '@luma.gl/webgl';