@loaders.gl/textures 3.1.0 → 3.1.1

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,6 +1,34 @@
1
1
  (() => {
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
9
+ var __commonJS = (cb, mod) => function __require() {
10
+ return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
+ };
12
+ var __reExport = (target, module, desc) => {
13
+ if (module && typeof module === "object" || typeof module === "function") {
14
+ for (let key of __getOwnPropNames(module))
15
+ if (!__hasOwnProp.call(target, key) && key !== "default")
16
+ __defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toModule = (module) => {
21
+ return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
22
+ };
23
+
24
+ // (disabled):../worker-utils/src/lib/node/require-utils.node
25
+ var require_require_utils = __commonJS({
26
+ "(disabled):../worker-utils/src/lib/node/require-utils.node"() {
27
+ }
28
+ });
29
+
2
30
  // ../worker-utils/src/lib/env-utils/version.ts
3
- var DEFAULT_VERSION = "beta";
31
+ var DEFAULT_VERSION = "latest";
4
32
  var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : DEFAULT_VERSION;
5
33
  if (typeof __VERSION__ === "undefined") {
6
34
  console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
@@ -109,7 +137,8 @@
109
137
  }
110
138
 
111
139
  // ../worker-utils/src/lib/library-utils/library-utils.ts
112
- var LATEST = "beta";
140
+ var node = __toModule(require_require_utils());
141
+ var LATEST = "latest";
113
142
  var VERSION2 = typeof VERSION !== "undefined" ? VERSION : LATEST;
114
143
  var loadLibraryPromises = {};
115
144
  async function loadLibrary(libraryUrl, moduleName = null, options = {}) {
@@ -145,7 +174,11 @@
145
174
  return await response2.arrayBuffer();
146
175
  }
147
176
  if (!isBrowser) {
148
- return node.requireFromFile && await node.requireFromFile(libraryUrl);
177
+ try {
178
+ return node && node.requireFromFile && await node.requireFromFile(libraryUrl);
179
+ } catch {
180
+ return null;
181
+ }
149
182
  }
150
183
  if (isWorker) {
151
184
  return importScripts(libraryUrl);
@@ -248,7 +281,7 @@
248
281
  }
249
282
 
250
283
  // src/lib/utils/version.ts
251
- var VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
284
+ var VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
252
285
 
253
286
  // src/lib/parsers/basis-module-loader.ts
254
287
  var VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
package/dist/bundle.js CHANGED
@@ -1,5 +1,10 @@
1
1
  (() => {
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
3
8
  var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
4
9
  var __esm = (fn, res) => function __init() {
5
10
  return fn && (res = (0, fn[Object.keys(fn)[0]])(fn = 0)), res;
@@ -12,12 +17,23 @@
12
17
  for (var name in all)
13
18
  __defProp(target, name, { get: all[name], enumerable: true });
14
19
  };
20
+ var __reExport = (target, module, desc) => {
21
+ if (module && typeof module === "object" || typeof module === "function") {
22
+ for (let key of __getOwnPropNames(module))
23
+ if (!__hasOwnProp.call(target, key) && key !== "default")
24
+ __defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
25
+ }
26
+ return target;
27
+ };
28
+ var __toModule = (module) => {
29
+ return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
30
+ };
15
31
 
16
32
  // src/lib/utils/version.ts
17
33
  var VERSION;
18
34
  var init_version = __esm({
19
35
  "src/lib/utils/version.ts"() {
20
- VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
36
+ VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
21
37
  }
22
38
  });
23
39
 
@@ -25,7 +41,7 @@
25
41
  var DEFAULT_VERSION, VERSION2;
26
42
  var init_version2 = __esm({
27
43
  "../worker-utils/src/lib/env-utils/version.ts"() {
28
- DEFAULT_VERSION = "beta";
44
+ DEFAULT_VERSION = "latest";
29
45
  VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : DEFAULT_VERSION;
30
46
  if (typeof __VERSION__ === "undefined") {
31
47
  console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
@@ -67,7 +83,7 @@
67
83
  });
68
84
 
69
85
  // (disabled):../worker-utils/src/lib/node/require-utils.node
70
- var init_require_utils = __esm({
86
+ var require_require_utils = __commonJS({
71
87
  "(disabled):../worker-utils/src/lib/node/require-utils.node"() {
72
88
  }
73
89
  });
@@ -106,7 +122,11 @@
106
122
  return await response2.arrayBuffer();
107
123
  }
108
124
  if (!isBrowser) {
109
- return node.requireFromFile && await node.requireFromFile(libraryUrl);
125
+ try {
126
+ return node && node.requireFromFile && await node.requireFromFile(libraryUrl);
127
+ } catch {
128
+ return null;
129
+ }
110
130
  }
111
131
  if (isWorker) {
112
132
  return importScripts(libraryUrl);
@@ -133,14 +153,14 @@
133
153
  document.body.appendChild(script);
134
154
  return null;
135
155
  }
136
- var LATEST, VERSION3, loadLibraryPromises;
156
+ var node, LATEST, VERSION3, loadLibraryPromises;
137
157
  var init_library_utils = __esm({
138
158
  "../worker-utils/src/lib/library-utils/library-utils.ts"() {
139
159
  init_globals();
140
- init_require_utils();
160
+ node = __toModule(require_require_utils());
141
161
  init_assert();
142
162
  init_version2();
143
- LATEST = "beta";
163
+ LATEST = "latest";
144
164
  VERSION3 = typeof VERSION2 !== "undefined" ? VERSION2 : LATEST;
145
165
  loadLibraryPromises = {};
146
166
  }
@@ -1355,7 +1375,7 @@
1355
1375
  });
1356
1376
 
1357
1377
  // src/lib/encoders/encode-texture.ts
1358
- async function encodeImageURLToCompressedTextureURL(inputUrl, outputUrl) {
1378
+ async function encodeImageURLToCompressedTextureURL(inputUrl, outputUrl, options) {
1359
1379
  const args = [
1360
1380
  "texture-compressor",
1361
1381
  "--type",
@@ -1373,17 +1393,13 @@
1373
1393
  await childProcess.start({
1374
1394
  command: "npx",
1375
1395
  arguments: args,
1376
- spawn: {
1377
- cwd: MODULE_ROOT
1378
- }
1396
+ spawn: options
1379
1397
  });
1380
1398
  return outputUrl;
1381
1399
  }
1382
- var MODULE_ROOT;
1383
1400
  var init_encode_texture = __esm({
1384
1401
  "src/lib/encoders/encode-texture.ts"() {
1385
1402
  init_src();
1386
- MODULE_ROOT = `${__dirname}/../../..`;
1387
1403
  }
1388
1404
  });
1389
1405
 
@@ -1,4 +1,32 @@
1
1
  (() => {
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
9
+ var __commonJS = (cb, mod) => function __require() {
10
+ return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
+ };
12
+ var __reExport = (target, module, desc) => {
13
+ if (module && typeof module === "object" || typeof module === "function") {
14
+ for (let key of __getOwnPropNames(module))
15
+ if (!__hasOwnProp.call(target, key) && key !== "default")
16
+ __defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toModule = (module) => {
21
+ return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
22
+ };
23
+
24
+ // (disabled):../worker-utils/src/lib/node/require-utils.node
25
+ var require_require_utils = __commonJS({
26
+ "(disabled):../worker-utils/src/lib/node/require-utils.node"() {
27
+ }
28
+ });
29
+
2
30
  // ../loader-utils/src/lib/env-utils/assert.ts
3
31
  function assert(condition, message) {
4
32
  if (!condition) {
@@ -7,7 +35,7 @@
7
35
  }
8
36
 
9
37
  // ../worker-utils/src/lib/env-utils/version.ts
10
- var DEFAULT_VERSION = "beta";
38
+ var DEFAULT_VERSION = "latest";
11
39
  var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : DEFAULT_VERSION;
12
40
  if (typeof __VERSION__ === "undefined") {
13
41
  console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
@@ -116,7 +144,8 @@
116
144
  }
117
145
 
118
146
  // ../worker-utils/src/lib/library-utils/library-utils.ts
119
- var LATEST = "beta";
147
+ var node = __toModule(require_require_utils());
148
+ var LATEST = "latest";
120
149
  var VERSION2 = typeof VERSION !== "undefined" ? VERSION : LATEST;
121
150
  var loadLibraryPromises = {};
122
151
  async function loadLibrary(libraryUrl, moduleName = null, options = {}) {
@@ -152,7 +181,11 @@
152
181
  return await response2.arrayBuffer();
153
182
  }
154
183
  if (!isBrowser) {
155
- return node.requireFromFile && await node.requireFromFile(libraryUrl);
184
+ try {
185
+ return node && node.requireFromFile && await node.requireFromFile(libraryUrl);
186
+ } catch {
187
+ return null;
188
+ }
156
189
  }
157
190
  if (isWorker) {
158
191
  return importScripts(libraryUrl);
@@ -255,7 +288,7 @@
255
288
  }
256
289
 
257
290
  // src/lib/utils/version.ts
258
- var VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
291
+ var VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
259
292
 
260
293
  // ../../node_modules/ktx-parse/dist/ktx-parse.modern.js
261
294
  var t = new Uint8Array([0]);
@@ -1,4 +1,32 @@
1
1
  (() => {
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
9
+ var __commonJS = (cb, mod) => function __require() {
10
+ return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
+ };
12
+ var __reExport = (target, module, desc) => {
13
+ if (module && typeof module === "object" || typeof module === "function") {
14
+ for (let key of __getOwnPropNames(module))
15
+ if (!__hasOwnProp.call(target, key) && key !== "default")
16
+ __defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toModule = (module) => {
21
+ return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
22
+ };
23
+
24
+ // (disabled):../worker-utils/src/lib/node/require-utils.node
25
+ var require_require_utils = __commonJS({
26
+ "(disabled):../worker-utils/src/lib/node/require-utils.node"() {
27
+ }
28
+ });
29
+
2
30
  // ../loader-utils/src/lib/env-utils/assert.ts
3
31
  function assert(condition, message) {
4
32
  if (!condition) {
@@ -7,7 +35,7 @@
7
35
  }
8
36
 
9
37
  // ../worker-utils/src/lib/env-utils/version.ts
10
- var DEFAULT_VERSION = "beta";
38
+ var DEFAULT_VERSION = "latest";
11
39
  var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : DEFAULT_VERSION;
12
40
  if (typeof __VERSION__ === "undefined") {
13
41
  console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
@@ -116,7 +144,8 @@
116
144
  }
117
145
 
118
146
  // ../worker-utils/src/lib/library-utils/library-utils.ts
119
- var LATEST = "beta";
147
+ var node = __toModule(require_require_utils());
148
+ var LATEST = "latest";
120
149
  var VERSION2 = typeof VERSION !== "undefined" ? VERSION : LATEST;
121
150
  var loadLibraryPromises = {};
122
151
  async function loadLibrary(libraryUrl, moduleName = null, options = {}) {
@@ -152,7 +181,11 @@
152
181
  return await response2.arrayBuffer();
153
182
  }
154
183
  if (!isBrowser) {
155
- return node.requireFromFile && await node.requireFromFile(libraryUrl);
184
+ try {
185
+ return node && node.requireFromFile && await node.requireFromFile(libraryUrl);
186
+ } catch {
187
+ return null;
188
+ }
156
189
  }
157
190
  if (isWorker) {
158
191
  return importScripts(libraryUrl);
@@ -255,7 +288,7 @@
255
288
  }
256
289
 
257
290
  // src/lib/utils/version.ts
258
- var VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
291
+ var VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
259
292
 
260
293
  // src/crunch-loader.ts
261
294
  var CrunchLoader = {
@@ -13,14 +13,12 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
13
13
 
14
14
  var _workerUtils = require("@loaders.gl/worker-utils");
15
15
 
16
- var MODULE_ROOT = "".concat(__dirname, "/../../..");
17
-
18
- function encodeImageURLToCompressedTextureURL(_x, _x2) {
16
+ function encodeImageURLToCompressedTextureURL(_x, _x2, _x3) {
19
17
  return _encodeImageURLToCompressedTextureURL.apply(this, arguments);
20
18
  }
21
19
 
22
20
  function _encodeImageURLToCompressedTextureURL() {
23
- _encodeImageURLToCompressedTextureURL = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(inputUrl, outputUrl) {
21
+ _encodeImageURLToCompressedTextureURL = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(inputUrl, outputUrl, options) {
24
22
  var args, childProcess;
25
23
  return _regenerator.default.wrap(function _callee$(_context) {
26
24
  while (1) {
@@ -32,9 +30,7 @@ function _encodeImageURLToCompressedTextureURL() {
32
30
  return childProcess.start({
33
31
  command: 'npx',
34
32
  arguments: args,
35
- spawn: {
36
- cwd: MODULE_ROOT
37
- }
33
+ spawn: options
38
34
  });
39
35
 
40
36
  case 4:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/encoders/encode-texture.ts"],"names":["MODULE_ROOT","__dirname","encodeImageURLToCompressedTextureURL","inputUrl","outputUrl","args","childProcess","ChildProcessProxy","start","command","arguments","spawn","cwd"],"mappings":";;;;;;;;;;;;;AAAA;;AAEA,IAAMA,WAAW,aAAMC,SAAN,cAAjB;;SAKsBC,oC;;;;;oGAAf,iBAAoDC,QAApD,EAA8DC,SAA9D;AAAA;AAAA;AAAA;AAAA;AAAA;AAECC,YAAAA,IAFD,GAEQ,CAEX,oBAFW,EAGX,QAHW,EAGD,MAHC,EAIX,eAJW,EAIM,MAJN,EAKX,WALW,EAKE,QALF,EAMX,SANW,EAMAF,QANA,EAOX,UAPW,EAOCC,SAPD,CAFR;AAWCE,YAAAA,YAXD,GAWgB,IAAIC,8BAAJ,EAXhB;AAAA;AAAA,mBAYCD,YAAY,CAACE,KAAb,CAAmB;AACvBC,cAAAA,OAAO,EAAE,KADc;AAEvBC,cAAAA,SAAS,EAAEL,IAFY;AAGvBM,cAAAA,KAAK,EAAE;AACLC,gBAAAA,GAAG,EAAEZ;AADA;AAHgB,aAAnB,CAZD;;AAAA;AAAA,6CAmBEI,SAnBF;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G","sourcesContent":["import {ChildProcessProxy} from '@loaders.gl/worker-utils';\n\nconst MODULE_ROOT = `${__dirname}/../../..`;\n\n/*\n * @see https://github.com/TimvanScherpenzeel/texture-compressor\n */\nexport async function encodeImageURLToCompressedTextureURL(inputUrl, outputUrl) {\n // prettier-ignore\n const args = [\n // Note: our actual executable is `npx`, so `texture-compressor` is an argument\n 'texture-compressor',\n '--type', 's3tc',\n '--compression', 'DXT1',\n '--quality', 'normal',\n '--input', inputUrl,\n '--output', outputUrl\n ];\n const childProcess = new ChildProcessProxy();\n await childProcess.start({\n command: 'npx',\n arguments: args,\n spawn: {\n cwd: MODULE_ROOT\n }\n });\n return outputUrl;\n}\n"],"file":"encode-texture.js"}
1
+ {"version":3,"sources":["../../../../src/lib/encoders/encode-texture.ts"],"names":["encodeImageURLToCompressedTextureURL","inputUrl","outputUrl","options","args","childProcess","ChildProcessProxy","start","command","arguments","spawn"],"mappings":";;;;;;;;;;;;;AAAA;;SAKsBA,oC;;;;;oGAAf,iBACLC,QADK,EAELC,SAFK,EAGLC,OAHK;AAAA;AAAA;AAAA;AAAA;AAAA;AAMCC,YAAAA,IAND,GAMQ,CAEX,oBAFW,EAGX,QAHW,EAGD,MAHC,EAIX,eAJW,EAIM,MAJN,EAKX,WALW,EAKE,QALF,EAMX,SANW,EAMAH,QANA,EAOX,UAPW,EAOCC,SAPD,CANR;AAeCG,YAAAA,YAfD,GAegB,IAAIC,8BAAJ,EAfhB;AAAA;AAAA,mBAgBCD,YAAY,CAACE,KAAb,CAAmB;AACvBC,cAAAA,OAAO,EAAE,KADc;AAEvBC,cAAAA,SAAS,EAAEL,IAFY;AAGvBM,cAAAA,KAAK,EAAEP;AAHgB,aAAnB,CAhBD;;AAAA;AAAA,6CAqBED,SArBF;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G","sourcesContent":["import {ChildProcessProxy} from '@loaders.gl/worker-utils';\n\n/*\n * @see https://github.com/TimvanScherpenzeel/texture-compressor\n */\nexport async function encodeImageURLToCompressedTextureURL(\n inputUrl: string,\n outputUrl: string,\n options?: {cwd?: string}\n): Promise<string> {\n // prettier-ignore\n const args = [\n // Note: our actual executable is `npx`, so `texture-compressor` is an argument\n 'texture-compressor',\n '--type', 's3tc',\n '--compression', 'DXT1',\n '--quality', 'normal',\n '--input', inputUrl,\n '--output', outputUrl\n ];\n const childProcess = new ChildProcessProxy();\n await childProcess.start({\n command: 'npx',\n arguments: args,\n spawn: options\n });\n return outputUrl;\n}\n"],"file":"encode-texture.js"}
@@ -16,7 +16,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
16
16
 
17
17
  var _workerUtils = require("@loaders.gl/worker-utils");
18
18
 
19
- var VERSION = typeof "3.1.0" !== 'undefined' ? "3.1.0" : 'beta';
19
+ var VERSION = typeof "3.1.1" !== 'undefined' ? "3.1.1" : 'beta';
20
20
  var BASIS_CDN_ENCODER_WASM = "https://unpkg.com/@loaders.gl/textures@".concat(VERSION, "/dist/libs/basis_encoder.wasm");
21
21
  var BASIS_CDN_ENCODER_JS = "https://unpkg.com/@loaders.gl/textures@".concat(VERSION, "/dist/libs/basis_encoder.js");
22
22
  var loadBasisTranscoderPromise;
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.VERSION = void 0;
7
- var VERSION = typeof "3.1.0" !== 'undefined' ? "3.1.0" : 'beta';
7
+ var VERSION = typeof "3.1.1" !== 'undefined' ? "3.1.1" : 'latest';
8
8
  exports.VERSION = VERSION;
9
9
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/utils/version.ts"],"names":["VERSION"],"mappings":";;;;;;AAIO,IAAMA,OAAO,GAAG,mBAAuB,WAAvB,aAAmD,MAAnE","sourcesContent":["// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// TODO: use 'latest' instead of 'beta' when 3.0.0 version is released as 'latest'\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';\n"],"file":"version.js"}
1
+ {"version":3,"sources":["../../../../src/lib/utils/version.ts"],"names":["VERSION"],"mappings":";;;;;;AAGO,IAAMA,OAAO,GAAG,mBAAuB,WAAvB,aAAmD,QAAnE","sourcesContent":["// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n"],"file":"version.js"}
@@ -1,14 +1,11 @@
1
1
  import { ChildProcessProxy } from '@loaders.gl/worker-utils';
2
- const MODULE_ROOT = "".concat(__dirname, "/../../..");
3
- export async function encodeImageURLToCompressedTextureURL(inputUrl, outputUrl) {
2
+ export async function encodeImageURLToCompressedTextureURL(inputUrl, outputUrl, options) {
4
3
  const args = ['texture-compressor', '--type', 's3tc', '--compression', 'DXT1', '--quality', 'normal', '--input', inputUrl, '--output', outputUrl];
5
4
  const childProcess = new ChildProcessProxy();
6
5
  await childProcess.start({
7
6
  command: 'npx',
8
7
  arguments: args,
9
- spawn: {
10
- cwd: MODULE_ROOT
11
- }
8
+ spawn: options
12
9
  });
13
10
  return outputUrl;
14
11
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/encoders/encode-texture.ts"],"names":["ChildProcessProxy","MODULE_ROOT","__dirname","encodeImageURLToCompressedTextureURL","inputUrl","outputUrl","args","childProcess","start","command","arguments","spawn","cwd"],"mappings":"AAAA,SAAQA,iBAAR,QAAgC,0BAAhC;AAEA,MAAMC,WAAW,aAAMC,SAAN,cAAjB;AAKA,OAAO,eAAeC,oCAAf,CAAoDC,QAApD,EAA8DC,SAA9D,EAAyE;AAE9E,QAAMC,IAAI,GAAG,CAEX,oBAFW,EAGX,QAHW,EAGD,MAHC,EAIX,eAJW,EAIM,MAJN,EAKX,WALW,EAKE,QALF,EAMX,SANW,EAMAF,QANA,EAOX,UAPW,EAOCC,SAPD,CAAb;AASA,QAAME,YAAY,GAAG,IAAIP,iBAAJ,EAArB;AACA,QAAMO,YAAY,CAACC,KAAb,CAAmB;AACvBC,IAAAA,OAAO,EAAE,KADc;AAEvBC,IAAAA,SAAS,EAAEJ,IAFY;AAGvBK,IAAAA,KAAK,EAAE;AACLC,MAAAA,GAAG,EAAEX;AADA;AAHgB,GAAnB,CAAN;AAOA,SAAOI,SAAP;AACD","sourcesContent":["import {ChildProcessProxy} from '@loaders.gl/worker-utils';\n\nconst MODULE_ROOT = `${__dirname}/../../..`;\n\n/*\n * @see https://github.com/TimvanScherpenzeel/texture-compressor\n */\nexport async function encodeImageURLToCompressedTextureURL(inputUrl, outputUrl) {\n // prettier-ignore\n const args = [\n // Note: our actual executable is `npx`, so `texture-compressor` is an argument\n 'texture-compressor',\n '--type', 's3tc',\n '--compression', 'DXT1',\n '--quality', 'normal',\n '--input', inputUrl,\n '--output', outputUrl\n ];\n const childProcess = new ChildProcessProxy();\n await childProcess.start({\n command: 'npx',\n arguments: args,\n spawn: {\n cwd: MODULE_ROOT\n }\n });\n return outputUrl;\n}\n"],"file":"encode-texture.js"}
1
+ {"version":3,"sources":["../../../../src/lib/encoders/encode-texture.ts"],"names":["ChildProcessProxy","encodeImageURLToCompressedTextureURL","inputUrl","outputUrl","options","args","childProcess","start","command","arguments","spawn"],"mappings":"AAAA,SAAQA,iBAAR,QAAgC,0BAAhC;AAKA,OAAO,eAAeC,oCAAf,CACLC,QADK,EAELC,SAFK,EAGLC,OAHK,EAIY;AAEjB,QAAMC,IAAI,GAAG,CAEX,oBAFW,EAGX,QAHW,EAGD,MAHC,EAIX,eAJW,EAIM,MAJN,EAKX,WALW,EAKE,QALF,EAMX,SANW,EAMAH,QANA,EAOX,UAPW,EAOCC,SAPD,CAAb;AASA,QAAMG,YAAY,GAAG,IAAIN,iBAAJ,EAArB;AACA,QAAMM,YAAY,CAACC,KAAb,CAAmB;AACvBC,IAAAA,OAAO,EAAE,KADc;AAEvBC,IAAAA,SAAS,EAAEJ,IAFY;AAGvBK,IAAAA,KAAK,EAAEN;AAHgB,GAAnB,CAAN;AAKA,SAAOD,SAAP;AACD","sourcesContent":["import {ChildProcessProxy} from '@loaders.gl/worker-utils';\n\n/*\n * @see https://github.com/TimvanScherpenzeel/texture-compressor\n */\nexport async function encodeImageURLToCompressedTextureURL(\n inputUrl: string,\n outputUrl: string,\n options?: {cwd?: string}\n): Promise<string> {\n // prettier-ignore\n const args = [\n // Note: our actual executable is `npx`, so `texture-compressor` is an argument\n 'texture-compressor',\n '--type', 's3tc',\n '--compression', 'DXT1',\n '--quality', 'normal',\n '--input', inputUrl,\n '--output', outputUrl\n ];\n const childProcess = new ChildProcessProxy();\n await childProcess.start({\n command: 'npx',\n arguments: args,\n spawn: options\n });\n return outputUrl;\n}\n"],"file":"encode-texture.js"}
@@ -1,4 +1,4 @@
1
- const VERSION = typeof "3.1.0" !== 'undefined' ? "3.1.0" : 'beta';
1
+ const VERSION = typeof "3.1.1" !== 'undefined' ? "3.1.1" : 'beta';
2
2
  import { loadLibrary } from '@loaders.gl/worker-utils';
3
3
  const BASIS_CDN_ENCODER_WASM = "https://unpkg.com/@loaders.gl/textures@".concat(VERSION, "/dist/libs/basis_encoder.wasm");
4
4
  const BASIS_CDN_ENCODER_JS = "https://unpkg.com/@loaders.gl/textures@".concat(VERSION, "/dist/libs/basis_encoder.js");
@@ -1,2 +1,2 @@
1
- export const VERSION = typeof "3.1.0" !== 'undefined' ? "3.1.0" : 'beta';
1
+ export const VERSION = typeof "3.1.1" !== 'undefined' ? "3.1.1" : 'latest';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/utils/version.ts"],"names":["VERSION"],"mappings":"AAIA,OAAO,MAAMA,OAAO,GAAG,mBAAuB,WAAvB,aAAmD,MAAnE","sourcesContent":["// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// TODO: use 'latest' instead of 'beta' when 3.0.0 version is released as 'latest'\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';\n"],"file":"version.js"}
1
+ {"version":3,"sources":["../../../../src/lib/utils/version.ts"],"names":["VERSION"],"mappings":"AAGA,OAAO,MAAMA,OAAO,GAAG,mBAAuB,WAAvB,aAAmD,QAAnE","sourcesContent":["// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n"],"file":"version.js"}
@@ -1,2 +1,4 @@
1
- export declare function encodeImageURLToCompressedTextureURL(inputUrl: any, outputUrl: any): Promise<any>;
1
+ export declare function encodeImageURLToCompressedTextureURL(inputUrl: string, outputUrl: string, options?: {
2
+ cwd?: string;
3
+ }): Promise<string>;
2
4
  //# sourceMappingURL=encode-texture.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"encode-texture.d.ts","sourceRoot":"","sources":["../../../src/lib/encoders/encode-texture.ts"],"names":[],"mappings":"AAOA,wBAAsB,oCAAoC,CAAC,QAAQ,KAAA,EAAE,SAAS,KAAA,gBAoB7E"}
1
+ {"version":3,"file":"encode-texture.d.ts","sourceRoot":"","sources":["../../../src/lib/encoders/encode-texture.ts"],"names":[],"mappings":"AAKA,wBAAsB,oCAAoC,CACxD,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAC,GACvB,OAAO,CAAC,MAAM,CAAC,CAkBjB"}
@@ -2,11 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.encodeImageURLToCompressedTextureURL = void 0;
4
4
  const worker_utils_1 = require("@loaders.gl/worker-utils");
5
- const MODULE_ROOT = `${__dirname}/../../..`;
6
5
  /*
7
6
  * @see https://github.com/TimvanScherpenzeel/texture-compressor
8
7
  */
9
- async function encodeImageURLToCompressedTextureURL(inputUrl, outputUrl) {
8
+ async function encodeImageURLToCompressedTextureURL(inputUrl, outputUrl, options) {
10
9
  // prettier-ignore
11
10
  const args = [
12
11
  // Note: our actual executable is `npx`, so `texture-compressor` is an argument
@@ -21,9 +20,7 @@ async function encodeImageURLToCompressedTextureURL(inputUrl, outputUrl) {
21
20
  await childProcess.start({
22
21
  command: 'npx',
23
22
  arguments: args,
24
- spawn: {
25
- cwd: MODULE_ROOT
26
- }
23
+ spawn: options
27
24
  });
28
25
  return outputUrl;
29
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/version.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,KAA4D,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/version.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,KAA8D,CAAC"}
@@ -3,6 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // Version constant cannot be imported, it needs to correspond to the build version of **this** module.
5
5
  // __VERSION__ is injected by babel-plugin-version-inline
6
- // TODO: use 'latest' instead of 'beta' when 3.0.0 version is released as 'latest'
7
6
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
8
- exports.VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';
7
+ exports.VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
@@ -1,6 +1,6 @@
1
1
  (() => {
2
2
  // src/lib/utils/version.ts
3
- var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
3
+ var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
4
4
 
5
5
  // src/lib/parsers/parse-npy.ts
6
6
  function systemIsLittleEndian() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/textures",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Framework-independent loaders for compressed and super compressed (basis) textures ",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -42,11 +42,11 @@
42
42
  "build-crunch-worker": "esbuild src/workers/crunch-worker.ts --bundle --outfile=dist/crunch-worker.js"
43
43
  },
44
44
  "dependencies": {
45
- "@loaders.gl/images": "3.1.0",
46
- "@loaders.gl/loader-utils": "3.1.0",
47
- "@loaders.gl/worker-utils": "3.1.0",
45
+ "@loaders.gl/images": "3.1.1",
46
+ "@loaders.gl/loader-utils": "3.1.1",
47
+ "@loaders.gl/worker-utils": "3.1.1",
48
48
  "ktx-parse": "^0.0.4",
49
49
  "texture-compressor": "^1.0.2"
50
50
  },
51
- "gitHead": "b02a011b5a6d6aa6c5870819045c70db168cb930"
51
+ "gitHead": "ed3c238bcb68ab5a2d4ddc64319f6f4c02a20df7"
52
52
  }
@@ -1,11 +1,13 @@
1
1
  import {ChildProcessProxy} from '@loaders.gl/worker-utils';
2
2
 
3
- const MODULE_ROOT = `${__dirname}/../../..`;
4
-
5
3
  /*
6
4
  * @see https://github.com/TimvanScherpenzeel/texture-compressor
7
5
  */
8
- export async function encodeImageURLToCompressedTextureURL(inputUrl, outputUrl) {
6
+ export async function encodeImageURLToCompressedTextureURL(
7
+ inputUrl: string,
8
+ outputUrl: string,
9
+ options?: {cwd?: string}
10
+ ): Promise<string> {
9
11
  // prettier-ignore
10
12
  const args = [
11
13
  // Note: our actual executable is `npx`, so `texture-compressor` is an argument
@@ -20,9 +22,7 @@ export async function encodeImageURLToCompressedTextureURL(inputUrl, outputUrl)
20
22
  await childProcess.start({
21
23
  command: 'npx',
22
24
  arguments: args,
23
- spawn: {
24
- cwd: MODULE_ROOT
25
- }
25
+ spawn: options
26
26
  });
27
27
  return outputUrl;
28
28
  }
@@ -1,5 +1,4 @@
1
1
  // Version constant cannot be imported, it needs to correspond to the build version of **this** module.
2
2
  // __VERSION__ is injected by babel-plugin-version-inline
3
- // TODO: use 'latest' instead of 'beta' when 3.0.0 version is released as 'latest'
4
3
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
5
- export const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';
4
+ export const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';