From d03154de3176e0764e40df5fa71e77416b6cd7a6 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Wed, 22 Feb 2023 16:33:41 +0100 Subject: [PATCH] Fix type definitions for moduleResolution nodenext (#827) When importing this library in a project using moduleResolution nodenext, the types would give errors because the import paths were missing the file extension which is required for moduleResolution nodenext. Therefore we have to add .js to all imports of local files. See https://github.com/developit/microbundle/issues/1019#issuecomment-1384721680 and the issues that comment links to for some more detailed explanation of this. I also changed moduleResolution to nodenext in the tsconfig because when it's set to node, typescript won't give errors for missing file extensions which means they are easy to forget. With it set to nodenext, you will get an error if an import is missing the file extension. As far as I can see, changing this doesn't change the build output. Depends on https://github.com/donmccurdy/property-graph/pull/70 and https://github.com/donmccurdy/KTX-Parse/pull/55 Fixes #824 --- packages/cli/src/cli.ts | 16 ++-- packages/cli/src/config.ts | 2 +- packages/cli/src/inspect.ts | 2 +- packages/cli/src/session.ts | 2 +- packages/cli/src/transforms/index.ts | 8 +- packages/cli/src/transforms/ktxfix.ts | 2 +- packages/cli/src/transforms/toktx.ts | 2 +- packages/cli/src/transforms/xmp.ts | 2 +- packages/cli/src/validate.ts | 2 +- packages/core/src/core.ts | 16 ++-- packages/core/src/document.ts | 8 +- packages/core/src/extension.ts | 8 +- packages/core/src/io/deno-io.ts | 2 +- packages/core/src/io/index.ts | 16 ++-- packages/core/src/io/node-io.ts | 10 +-- packages/core/src/io/platform-io.ts | 16 ++-- packages/core/src/io/reader-context.ts | 6 +- packages/core/src/io/reader.ts | 16 ++-- packages/core/src/io/web-io.ts | 6 +- packages/core/src/io/writer-context.ts | 14 ++-- packages/core/src/io/writer.ts | 16 ++-- packages/core/src/json-document.ts | 2 +- packages/core/src/properties/accessor.ts | 12 +-- .../core/src/properties/animation-channel.ts | 10 +-- .../core/src/properties/animation-sampler.ts | 8 +- packages/core/src/properties/animation.ts | 8 +- packages/core/src/properties/buffer.ts | 4 +- packages/core/src/properties/camera.ts | 6 +- .../src/properties/extensible-property.ts | 6 +- .../core/src/properties/extension-property.ts | 4 +- packages/core/src/properties/index.ts | 38 ++++----- packages/core/src/properties/material.ts | 12 +-- packages/core/src/properties/mesh.ts | 6 +- packages/core/src/properties/node.ts | 14 ++-- .../core/src/properties/primitive-target.ts | 8 +- packages/core/src/properties/primitive.ts | 12 +-- packages/core/src/properties/property.ts | 6 +- packages/core/src/properties/root.ts | 30 +++---- packages/core/src/properties/scene.ts | 8 +- packages/core/src/properties/skin.ts | 8 +- packages/core/src/properties/texture-info.ts | 6 +- packages/core/src/properties/texture.ts | 6 +- packages/core/src/utils/buffer-utils.ts | 2 +- packages/core/src/utils/color-utils.ts | 2 +- packages/core/src/utils/file-utils.ts | 2 +- packages/core/src/utils/get-bounds.ts | 4 +- packages/core/src/utils/http-utils.ts | 2 +- packages/core/src/utils/image-utils.ts | 4 +- packages/core/src/utils/index.ts | 22 ++--- packages/core/src/utils/math-utils.ts | 4 +- packages/core/src/utils/property-utils.ts | 6 +- packages/core/src/utils/ref-utils.ts | 2 +- .../src/ext-mesh-gpu-instancing/index.ts | 4 +- .../ext-mesh-gpu-instancing/instanced-mesh.ts | 2 +- .../mesh-gpu-instancing.ts | 4 +- .../src/ext-meshopt-compression/decoder.ts | 4 +- .../src/ext-meshopt-compression/encoder.ts | 2 +- .../src/ext-meshopt-compression/index.ts | 2 +- .../meshopt-compression.ts | 8 +- .../extensions/src/ext-texture-avif/index.ts | 2 +- .../src/ext-texture-avif/texture-avif.ts | 2 +- .../extensions/src/ext-texture-webp/index.ts | 2 +- .../src/ext-texture-webp/texture-webp.ts | 2 +- packages/extensions/src/extensions.ts | 84 +++++++++---------- .../src/khr-draco-mesh-compression/decoder.ts | 2 +- .../draco-mesh-compression.ts | 6 +- .../src/khr-draco-mesh-compression/index.ts | 2 +- .../src/khr-lights-punctual/index.ts | 4 +- .../src/khr-lights-punctual/light.ts | 2 +- .../khr-lights-punctual/lights-punctual.ts | 4 +- .../src/khr-materials-clearcoat/clearcoat.ts | 2 +- .../src/khr-materials-clearcoat/index.ts | 4 +- .../materials-clearcoat.ts | 4 +- .../emissive-strength.ts | 2 +- .../khr-materials-emissive-strength/index.ts | 4 +- .../materials-emissive-strength.ts | 4 +- .../extensions/src/khr-materials-ior/index.ts | 4 +- .../extensions/src/khr-materials-ior/ior.ts | 2 +- .../src/khr-materials-ior/materials-ior.ts | 4 +- .../src/khr-materials-iridescence/index.ts | 4 +- .../khr-materials-iridescence/iridescence.ts | 2 +- .../materials-iridescence.ts | 4 +- .../index.ts | 4 +- .../materials-pbr-specular-glossiness.ts | 4 +- .../pbr-specular-glossiness.ts | 2 +- .../src/khr-materials-sheen/index.ts | 4 +- .../khr-materials-sheen/materials-sheen.ts | 4 +- .../src/khr-materials-sheen/sheen.ts | 2 +- .../src/khr-materials-specular/index.ts | 4 +- .../materials-specular.ts | 4 +- .../src/khr-materials-specular/specular.ts | 2 +- .../src/khr-materials-transmission/index.ts | 4 +- .../materials-transmission.ts | 4 +- .../transmission.ts | 2 +- .../src/khr-materials-unlit/index.ts | 4 +- .../khr-materials-unlit/materials-unlit.ts | 4 +- .../src/khr-materials-unlit/unlit.ts | 2 +- .../src/khr-materials-variants/index.ts | 8 +- .../khr-materials-variants/mapping-list.ts | 4 +- .../src/khr-materials-variants/mapping.ts | 4 +- .../materials-variants.ts | 8 +- .../src/khr-materials-variants/variant.ts | 2 +- .../src/khr-materials-volume/index.ts | 4 +- .../khr-materials-volume/materials-volume.ts | 4 +- .../src/khr-materials-volume/volume.ts | 2 +- .../src/khr-mesh-quantization/index.ts | 2 +- .../mesh-quantization.ts | 2 +- .../src/khr-texture-basisu/index.ts | 2 +- .../src/khr-texture-basisu/texture-basisu.ts | 2 +- .../src/khr-texture-transform/index.ts | 4 +- .../texture-transform.ts | 4 +- .../src/khr-texture-transform/transform.ts | 2 +- .../extensions/src/khr-xmp-json-ld/index.ts | 4 +- .../extensions/src/khr-xmp-json-ld/packet.ts | 2 +- .../extensions/src/khr-xmp-json-ld/xmp.ts | 4 +- packages/functions/package.json | 2 +- packages/functions/src/center.ts | 2 +- packages/functions/src/clear-node-parent.ts | 2 +- .../functions/src/clear-node-transform.ts | 2 +- packages/functions/src/colorspace.ts | 2 +- packages/functions/src/dedup.ts | 2 +- packages/functions/src/dequantize.ts | 2 +- packages/functions/src/draco.ts | 2 +- packages/functions/src/flatten.ts | 6 +- packages/functions/src/index.ts | 76 ++++++++--------- packages/functions/src/inspect.ts | 2 +- packages/functions/src/instance.ts | 2 +- packages/functions/src/join-primitives.ts | 2 +- packages/functions/src/join.ts | 8 +- packages/functions/src/meshopt.ts | 6 +- packages/functions/src/metal-rough.ts | 2 +- packages/functions/src/normals.ts | 4 +- packages/functions/src/partition.ts | 4 +- packages/functions/src/prune.ts | 2 +- packages/functions/src/quantize.ts | 8 +- packages/functions/src/reorder.ts | 4 +- packages/functions/src/resample.ts | 4 +- packages/functions/src/sequence.ts | 2 +- packages/functions/src/simplify.ts | 6 +- packages/functions/src/sparse.ts | 2 +- packages/functions/src/tangents.ts | 2 +- packages/functions/src/texture-compress.ts | 8 +- packages/functions/src/texture-resize.ts | 4 +- packages/functions/src/transform-mesh.ts | 4 +- packages/functions/src/transform-primitive.ts | 2 +- packages/functions/src/unpartition.ts | 2 +- packages/functions/src/unweld.ts | 2 +- packages/functions/src/weld.ts | 4 +- tsconfig.json | 2 +- 149 files changed, 457 insertions(+), 457 deletions(-) diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index 54ffa3b88..4a178238f 100755 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -9,12 +9,12 @@ import sharp from 'sharp'; import { MeshoptEncoder, MeshoptSimplifier } from 'meshoptimizer'; import { Logger, NodeIO, PropertyType, VertexLayout, vec2 } from '@gltf-transform/core'; import { CenterOptions, InstanceOptions, PartitionOptions, PruneOptions, QUANTIZE_DEFAULTS, ResampleOptions, SequenceOptions, TEXTURE_RESIZE_DEFAULTS, TextureResizeFilter, UnweldOptions, WeldOptions, center, dedup, instance, metalRough, partition, prune, quantize, resample, sequence, tangents, unweld, weld, reorder, dequantize, unlit, meshopt, DRACO_DEFAULTS, draco, DracoOptions, simplify, SIMPLIFY_DEFAULTS, WELD_DEFAULTS, textureCompress, FlattenOptions, flatten, JOIN_DEFAULTS, join, JoinOptions, sparse, SparseOptions } from '@gltf-transform/functions'; -import { inspect } from './inspect'; -import { ETC1S_DEFAULTS, Filter, Mode, UASTC_DEFAULTS, ktxfix, merge, toktx, XMPOptions, xmp } from './transforms'; -import { formatBytes, MICROMATCH_OPTIONS, underline, TableFormat } from './util'; -import { Session } from './session'; -import { ValidateOptions, validate } from './validate'; -import { getConfig, loadConfig } from './config'; +import { inspect } from './inspect.js'; +import { ETC1S_DEFAULTS, Filter, Mode, UASTC_DEFAULTS, ktxfix, merge, toktx, XMPOptions, xmp } from './transforms/index.js'; +import { formatBytes, MICROMATCH_OPTIONS, underline, TableFormat } from './util.js'; +import { Session } from './session.js'; +import { ValidateOptions, validate } from './validate.js'; +import { getConfig, loadConfig } from './config.js'; const program = caporal.program; @@ -1460,5 +1460,5 @@ program.disableGlobalOption('--quiet'); program.disableGlobalOption('--no-color'); export { program, programReady }; -export * from './util'; -export * from './transforms'; +export * from './util.js'; +export * from './transforms/index.js'; diff --git a/packages/cli/src/config.ts b/packages/cli/src/config.ts index 3a7600d0a..24007ced0 100644 --- a/packages/cli/src/config.ts +++ b/packages/cli/src/config.ts @@ -4,7 +4,7 @@ import { ALL_EXTENSIONS } from '@gltf-transform/extensions'; import { resolve } from 'path'; import draco3d from 'draco3dgltf'; import { MeshoptEncoder, MeshoptDecoder } from 'meshoptimizer'; -import type { Session } from './session'; +import type { Session } from './session.js'; interface Config { extensions: (typeof Extension)[]; diff --git a/packages/cli/src/inspect.ts b/packages/cli/src/inspect.ts index 71bca65d2..a7bd95d9f 100644 --- a/packages/cli/src/inspect.ts +++ b/packages/cli/src/inspect.ts @@ -8,7 +8,7 @@ import { InspectTextureReport, inspect as inspectDoc, } from '@gltf-transform/functions'; -import { formatBytes, formatHeader, formatLong, formatParagraph, formatTable, formatXMP, TableFormat } from './util'; +import { formatBytes, formatHeader, formatLong, formatParagraph, formatTable, formatXMP, TableFormat } from './util.js'; import type { Packet } from '@gltf-transform/extensions'; type AnyPropertyReport = diff --git a/packages/cli/src/session.ts b/packages/cli/src/session.ts index b8103e867..30e0c6dd9 100644 --- a/packages/cli/src/session.ts +++ b/packages/cli/src/session.ts @@ -2,7 +2,7 @@ import { Document, NodeIO, Logger, FileUtils, Transform, Format, ILogger } from import type { Packet, KHRXMP } from '@gltf-transform/extensions'; import { unpartition } from '@gltf-transform/functions'; import { Listr, ListrTask } from 'listr2'; -import { dim, formatBytes, formatLong, XMPContext } from './util'; +import { dim, formatBytes, formatLong, XMPContext } from './util.js'; import type caporal from '@caporal/core'; /** Helper class for managing a CLI command session. */ diff --git a/packages/cli/src/transforms/index.ts b/packages/cli/src/transforms/index.ts index fe77ffd07..058c6f128 100644 --- a/packages/cli/src/transforms/index.ts +++ b/packages/cli/src/transforms/index.ts @@ -1,4 +1,4 @@ -export * from './ktxfix'; -export * from './merge'; -export * from './toktx'; -export * from './xmp'; +export * from './ktxfix.js'; +export * from './merge.js'; +export * from './toktx.js'; +export * from './xmp.js'; diff --git a/packages/cli/src/transforms/ktxfix.ts b/packages/cli/src/transforms/ktxfix.ts index 37c1151ad..58d24d7b7 100644 --- a/packages/cli/src/transforms/ktxfix.ts +++ b/packages/cli/src/transforms/ktxfix.ts @@ -1,6 +1,6 @@ import { KHR_DF_PRIMARIES_BT709, KHR_DF_PRIMARIES_UNSPECIFIED, read, write } from 'ktx-parse'; import type { Document, Transform } from '@gltf-transform/core'; -import { MICROMATCH_OPTIONS } from '../util'; +import { MICROMATCH_OPTIONS } from '../util.js'; import { listTextureSlots } from '@gltf-transform/functions'; import micromatch from 'micromatch'; diff --git a/packages/cli/src/transforms/toktx.ts b/packages/cli/src/transforms/toktx.ts index fe9a58cd4..2b161d805 100644 --- a/packages/cli/src/transforms/toktx.ts +++ b/packages/cli/src/transforms/toktx.ts @@ -10,7 +10,7 @@ import pLimit from 'p-limit'; import { Document, FileUtils, ILogger, ImageUtils, TextureChannel, Transform, vec2, uuid } from '@gltf-transform/core'; import { KHRTextureBasisu } from '@gltf-transform/extensions'; import { createTransform, getTextureChannelMask, listTextureSlots } from '@gltf-transform/functions'; -import { spawn, commandExists, formatBytes, waitExit, MICROMATCH_OPTIONS } from '../util'; +import { spawn, commandExists, formatBytes, waitExit, MICROMATCH_OPTIONS } from '../util.js'; tmp.setGracefulCleanup(); diff --git a/packages/cli/src/transforms/xmp.ts b/packages/cli/src/transforms/xmp.ts index 7b2fd8fb9..223d6cc08 100644 --- a/packages/cli/src/transforms/xmp.ts +++ b/packages/cli/src/transforms/xmp.ts @@ -5,7 +5,7 @@ import languageTags from 'language-tags'; import validateSPDX from 'spdx-correct'; import fs from 'fs/promises'; import path from 'path'; -import { formatXMP, XMPContext } from '../util'; +import { formatXMP, XMPContext } from '../util.js'; const DEFAULT_LANG = 'en-US'; diff --git a/packages/cli/src/validate.ts b/packages/cli/src/validate.ts index 86e27f6e3..ad56a659b 100644 --- a/packages/cli/src/validate.ts +++ b/packages/cli/src/validate.ts @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import validator from 'gltf-validator'; import type { ILogger } from '@gltf-transform/core'; -import { formatHeader, formatTable, TableFormat } from './util'; +import { formatHeader, formatTable, TableFormat } from './util.js'; export interface ValidateOptions { limit: number; diff --git a/packages/core/src/core.ts b/packages/core/src/core.ts index 28e154cf3..b40733123 100644 --- a/packages/core/src/core.ts +++ b/packages/core/src/core.ts @@ -1,8 +1,8 @@ /** @module core */ -export { Document, Transform, TransformContext } from './document'; -export { JSONDocument } from './json-document'; -export { Extension } from './extension'; +export { Document, Transform, TransformContext } from './document.js'; +export { JSONDocument } from './json-document.js'; +export { Extension } from './extension.js'; export { Accessor, Animation, @@ -25,9 +25,9 @@ export { Texture, TextureInfo, COPY_IDENTITY, -} from './properties'; +} from './properties/index.js'; export { Graph, GraphEdge } from 'property-graph'; -export { DenoIO, PlatformIO, NodeIO, WebIO, ReaderContext, WriterContext } from './io'; +export { DenoIO, PlatformIO, NodeIO, WebIO, ReaderContext, WriterContext } from './io/index.js'; export { BufferUtils, ColorUtils, @@ -41,7 +41,7 @@ export { getBounds, bounds, uuid, -} from './utils'; +} from './utils/index.js'; export { TypedArray, TypedArrayConstructor, @@ -59,5 +59,5 @@ export { bbox, GLB_BUFFER, VERSION, -} from './constants'; -export { GLTF } from './types/gltf'; +} from './constants.js'; +export { GLTF } from './types/gltf.js'; diff --git a/packages/core/src/document.ts b/packages/core/src/document.ts index 4a61b87db..791d3853d 100644 --- a/packages/core/src/document.ts +++ b/packages/core/src/document.ts @@ -1,5 +1,5 @@ -import { PropertyType } from './constants'; -import type { Extension } from './extension'; +import { PropertyType } from './constants.js'; +import type { Extension } from './extension.js'; import { Graph } from 'property-graph'; import { Accessor, @@ -18,8 +18,8 @@ import { Scene, Skin, Texture, -} from './properties'; -import { ILogger, Logger } from './utils'; +} from './properties/index.js'; +import { ILogger, Logger } from './utils/index.js'; export interface TransformContext { stack: string[]; diff --git a/packages/core/src/extension.ts b/packages/core/src/extension.ts index 0019462a0..bdae66b3e 100644 --- a/packages/core/src/extension.ts +++ b/packages/core/src/extension.ts @@ -1,8 +1,8 @@ import type { GraphEdgeEvent, GraphEvent, GraphNodeEvent } from 'property-graph'; -import type { PropertyType } from './constants'; -import type { Document } from './document'; -import type { ReaderContext, WriterContext } from './io'; -import { ExtensionProperty } from './properties'; +import type { PropertyType } from './constants.js'; +import type { Document } from './document.js'; +import type { ReaderContext, WriterContext } from './io/index.js'; +import { ExtensionProperty } from './properties/index.js'; /** * # Extension diff --git a/packages/core/src/io/deno-io.ts b/packages/core/src/io/deno-io.ts index 7d307955f..27379c9a9 100644 --- a/packages/core/src/io/deno-io.ts +++ b/packages/core/src/io/deno-io.ts @@ -1,4 +1,4 @@ -import { PlatformIO } from './platform-io'; +import { PlatformIO } from './platform-io.js'; interface Path { resolve(base: string, path: string): string; diff --git a/packages/core/src/io/index.ts b/packages/core/src/io/index.ts index 5582efbfe..9661443dc 100644 --- a/packages/core/src/io/index.ts +++ b/packages/core/src/io/index.ts @@ -1,8 +1,8 @@ -export { NodeIO } from './node-io'; -export { DenoIO } from './deno-io'; -export { PlatformIO } from './platform-io'; -export { WebIO } from './web-io'; -export { ReaderOptions } from './reader'; -export { WriterOptions } from './writer'; -export { ReaderContext } from './reader-context'; -export { WriterContext } from './writer-context'; +export { NodeIO } from './node-io.js'; +export { DenoIO } from './deno-io.js'; +export { PlatformIO } from './platform-io.js'; +export { WebIO } from './web-io.js'; +export { ReaderOptions } from './reader.js'; +export { WriterOptions } from './writer.js'; +export { ReaderContext } from './reader-context.js'; +export { WriterContext } from './writer-context.js'; diff --git a/packages/core/src/io/node-io.ts b/packages/core/src/io/node-io.ts index 4cec1f507..d5034b88d 100644 --- a/packages/core/src/io/node-io.ts +++ b/packages/core/src/io/node-io.ts @@ -1,8 +1,8 @@ -import { Format } from '../constants'; -import type { Document } from '../document'; -import { FileUtils } from '../utils/'; -import { PlatformIO } from './platform-io'; -import { HTTPUtils } from '../utils'; +import { Format } from '../constants.js'; +import type { Document } from '../document.js'; +import { FileUtils } from '../utils/index.js'; +import { PlatformIO } from './platform-io.js'; +import { HTTPUtils } from '../utils/index.js'; /** * # NodeIO diff --git a/packages/core/src/io/platform-io.ts b/packages/core/src/io/platform-io.ts index c26569049..3edad7a28 100644 --- a/packages/core/src/io/platform-io.ts +++ b/packages/core/src/io/platform-io.ts @@ -1,11 +1,11 @@ -import { Format, GLB_BUFFER, VertexLayout } from '../constants'; -import type { Document } from '../document'; -import type { Extension } from '../extension'; -import type { JSONDocument } from '../json-document'; -import type { GLTF } from '../types/gltf'; -import { BufferUtils, FileUtils, HTTPUtils, ILogger, Logger, uuid } from '../utils/'; -import { GLTFReader } from './reader'; -import { GLTFWriter, WriterOptions } from './writer'; +import { Format, GLB_BUFFER, VertexLayout } from '../constants.js'; +import type { Document } from '../document.js'; +import type { Extension } from '../extension.js'; +import type { JSONDocument } from '../json-document.js'; +import type { GLTF } from '../types/gltf.js'; +import { BufferUtils, FileUtils, HTTPUtils, ILogger, Logger, uuid } from '../utils/index.js'; +import { GLTFReader } from './reader.js'; +import { GLTFWriter, WriterOptions } from './writer.js'; enum ChunkType { JSON = 0x4e4f534a, diff --git a/packages/core/src/io/reader-context.ts b/packages/core/src/io/reader-context.ts index 1a2939e07..4dc3657d0 100644 --- a/packages/core/src/io/reader-context.ts +++ b/packages/core/src/io/reader-context.ts @@ -1,4 +1,4 @@ -import type { JSONDocument } from '../json-document'; +import type { JSONDocument } from '../json-document.js'; import type { Accessor, Animation, @@ -11,8 +11,8 @@ import type { Skin, Texture, TextureInfo, -} from '../properties'; -import type { GLTF } from '../types/gltf'; +} from '../properties/index.js'; +import type { GLTF } from '../types/gltf.js'; /** * Model class providing glTF-Transform objects representing each definition in the glTF file, used diff --git a/packages/core/src/io/reader.ts b/packages/core/src/io/reader.ts index b8d4e0234..135cc45b6 100644 --- a/packages/core/src/io/reader.ts +++ b/packages/core/src/io/reader.ts @@ -1,11 +1,11 @@ -import { GLB_BUFFER, PropertyType, TypedArray, mat4, vec3, vec4, ComponentTypeToTypedArray } from '../constants'; -import { Document } from '../document'; -import type { Extension } from '../extension'; -import type { JSONDocument } from '../json-document'; -import { Accessor, AnimationSampler, Camera } from '../properties'; -import type { GLTF } from '../types/gltf'; -import { BufferUtils, FileUtils, ILogger, ImageUtils, Logger, MathUtils } from '../utils'; -import { ReaderContext } from './reader-context'; +import { GLB_BUFFER, PropertyType, TypedArray, mat4, vec3, vec4, ComponentTypeToTypedArray } from '../constants.js'; +import { Document } from '../document.js'; +import type { Extension } from '../extension.js'; +import type { JSONDocument } from '../json-document.js'; +import { Accessor, AnimationSampler, Camera } from '../properties/index.js'; +import type { GLTF } from '../types/gltf.js'; +import { BufferUtils, FileUtils, ILogger, ImageUtils, Logger, MathUtils } from '../utils/index.js'; +import { ReaderContext } from './reader-context.js'; export interface ReaderOptions { logger?: ILogger; diff --git a/packages/core/src/io/web-io.ts b/packages/core/src/io/web-io.ts index ab25954f7..0facb2ad0 100644 --- a/packages/core/src/io/web-io.ts +++ b/packages/core/src/io/web-io.ts @@ -1,6 +1,6 @@ -import { PlatformIO } from './platform-io'; -import { HTTPUtils } from '../utils'; -import { Format } from '../constants'; +import { PlatformIO } from './platform-io.js'; +import { HTTPUtils } from '../utils/index.js'; +import { Format } from '../constants.js'; /** * # WebIO diff --git a/packages/core/src/io/writer-context.ts b/packages/core/src/io/writer-context.ts index 6659b4841..856e9b86f 100644 --- a/packages/core/src/io/writer-context.ts +++ b/packages/core/src/io/writer-context.ts @@ -1,6 +1,6 @@ -import { BufferViewUsage, Format, PropertyType } from '../constants'; -import type { Document } from '../document'; -import type { JSONDocument } from '../json-document'; +import { BufferViewUsage, Format, PropertyType } from '../constants.js'; +import type { Document } from '../document.js'; +import type { JSONDocument } from '../json-document.js'; import type { Accessor, Animation, @@ -14,10 +14,10 @@ import type { Skin, Texture, TextureInfo, -} from '../properties'; -import type { GLTF } from '../types/gltf'; -import { ILogger, ImageUtils } from '../utils'; -import type { WriterOptions } from './writer'; +} from '../properties/index.js'; +import type { GLTF } from '../types/gltf.js'; +import { ILogger, ImageUtils } from '../utils/index.js'; +import type { WriterOptions } from './writer.js'; type PropertyDef = GLTF.IScene | GLTF.INode | GLTF.IMaterial | GLTF.ISkin | GLTF.ITexture; diff --git a/packages/core/src/io/writer.ts b/packages/core/src/io/writer.ts index 18f5d4c1e..c0dc94989 100644 --- a/packages/core/src/io/writer.ts +++ b/packages/core/src/io/writer.ts @@ -6,15 +6,15 @@ import { TypedArray, VERSION, VertexLayout, -} from '../constants'; -import type { Document } from '../document'; -import type { Extension } from '../extension'; +} from '../constants.js'; +import type { Document } from '../document.js'; +import type { Extension } from '../extension.js'; import type { GraphEdge } from 'property-graph'; -import type { JSONDocument } from '../json-document'; -import { Accessor, AnimationSampler, Camera, Material, Property } from '../properties'; -import type { GLTF } from '../types/gltf'; -import { BufferUtils, Logger, MathUtils } from '../utils'; -import { WriterContext } from './writer-context'; +import type { JSONDocument } from '../json-document.js'; +import { Accessor, AnimationSampler, Camera, Material, Property } from '../properties/index.js'; +import type { GLTF } from '../types/gltf.js'; +import { BufferUtils, Logger, MathUtils } from '../utils/index.js'; +import { WriterContext } from './writer-context.js'; const { BufferViewUsage } = WriterContext; const { UNSIGNED_INT, UNSIGNED_SHORT, UNSIGNED_BYTE } = Accessor.ComponentType; diff --git a/packages/core/src/json-document.ts b/packages/core/src/json-document.ts index c08ff13e9..53c182146 100644 --- a/packages/core/src/json-document.ts +++ b/packages/core/src/json-document.ts @@ -1,4 +1,4 @@ -import type { GLTF } from './types/gltf'; +import type { GLTF } from './types/gltf.js'; /** * # JSONDocument diff --git a/packages/core/src/properties/accessor.ts b/packages/core/src/properties/accessor.ts index 1b3e5d5c4..d8b777aad 100644 --- a/packages/core/src/properties/accessor.ts +++ b/packages/core/src/properties/accessor.ts @@ -1,9 +1,9 @@ -import { Nullable, PropertyType, TypedArray } from '../constants'; -import type { GLTF } from '../types/gltf'; -import { MathUtils } from '../utils'; -import type { Buffer } from './buffer'; -import { ExtensibleProperty, IExtensibleProperty } from './extensible-property'; -import { COPY_IDENTITY } from './property'; +import { Nullable, PropertyType, TypedArray } from '../constants.js'; +import type { GLTF } from '../types/gltf.js'; +import { MathUtils } from '../utils/index.js'; +import type { Buffer } from './buffer.js'; +import { ExtensibleProperty, IExtensibleProperty } from './extensible-property.js'; +import { COPY_IDENTITY } from './property.js'; interface IAccessor extends IExtensibleProperty { array: TypedArray | null; diff --git a/packages/core/src/properties/animation-channel.ts b/packages/core/src/properties/animation-channel.ts index ccce0999d..3ef72d7e1 100644 --- a/packages/core/src/properties/animation-channel.ts +++ b/packages/core/src/properties/animation-channel.ts @@ -1,8 +1,8 @@ -import { Nullable, PropertyType } from '../constants'; -import type { GLTF } from '../types/gltf'; -import type { AnimationSampler } from './animation-sampler'; -import { ExtensibleProperty, IExtensibleProperty } from './extensible-property'; -import type { Node } from './node'; +import { Nullable, PropertyType } from '../constants.js'; +import type { GLTF } from '../types/gltf.js'; +import type { AnimationSampler } from './animation-sampler.js'; +import { ExtensibleProperty, IExtensibleProperty } from './extensible-property.js'; +import type { Node } from './node.js'; interface IAnimationChannel extends IExtensibleProperty { targetPath: GLTF.AnimationChannelTargetPath | null; diff --git a/packages/core/src/properties/animation-sampler.ts b/packages/core/src/properties/animation-sampler.ts index 8b5cb5385..aa9f2e04e 100644 --- a/packages/core/src/properties/animation-sampler.ts +++ b/packages/core/src/properties/animation-sampler.ts @@ -1,7 +1,7 @@ -import { BufferViewUsage, Nullable, PropertyType } from '../constants'; -import type { GLTF } from '../types/gltf'; -import type { Accessor } from './accessor'; -import { ExtensibleProperty, IExtensibleProperty } from './extensible-property'; +import { BufferViewUsage, Nullable, PropertyType } from '../constants.js'; +import type { GLTF } from '../types/gltf.js'; +import type { Accessor } from './accessor.js'; +import { ExtensibleProperty, IExtensibleProperty } from './extensible-property.js'; interface IAnimationSampler extends IExtensibleProperty { interpolation: GLTF.AnimationSamplerInterpolation; diff --git a/packages/core/src/properties/animation.ts b/packages/core/src/properties/animation.ts index 520067a56..c72437ea8 100644 --- a/packages/core/src/properties/animation.ts +++ b/packages/core/src/properties/animation.ts @@ -1,7 +1,7 @@ -import { Nullable, PropertyType } from '../constants'; -import type { AnimationChannel } from './animation-channel'; -import type { AnimationSampler } from './animation-sampler'; -import { ExtensibleProperty, IExtensibleProperty } from './extensible-property'; +import { Nullable, PropertyType } from '../constants.js'; +import type { AnimationChannel } from './animation-channel.js'; +import type { AnimationSampler } from './animation-sampler.js'; +import { ExtensibleProperty, IExtensibleProperty } from './extensible-property.js'; interface IAnimation extends IExtensibleProperty { channels: AnimationChannel[]; diff --git a/packages/core/src/properties/buffer.ts b/packages/core/src/properties/buffer.ts index 5802a52b2..f184d8d6a 100644 --- a/packages/core/src/properties/buffer.ts +++ b/packages/core/src/properties/buffer.ts @@ -1,5 +1,5 @@ -import { Nullable, PropertyType } from '../constants'; -import { ExtensibleProperty, IExtensibleProperty } from './extensible-property'; +import { Nullable, PropertyType } from '../constants.js'; +import { ExtensibleProperty, IExtensibleProperty } from './extensible-property.js'; interface IBuffer extends IExtensibleProperty { uri: string; diff --git a/packages/core/src/properties/camera.ts b/packages/core/src/properties/camera.ts index 27d13f2e6..cb180b6f4 100644 --- a/packages/core/src/properties/camera.ts +++ b/packages/core/src/properties/camera.ts @@ -1,6 +1,6 @@ -import { Nullable, PropertyType } from '../constants'; -import type { GLTF } from '../types/gltf'; -import { ExtensibleProperty, IExtensibleProperty } from './extensible-property'; +import { Nullable, PropertyType } from '../constants.js'; +import type { GLTF } from '../types/gltf.js'; +import { ExtensibleProperty, IExtensibleProperty } from './extensible-property.js'; interface ICamera extends IExtensibleProperty { type: GLTF.CameraType; diff --git a/packages/core/src/properties/extensible-property.ts b/packages/core/src/properties/extensible-property.ts index 40668fa48..e9ad95bb4 100644 --- a/packages/core/src/properties/extensible-property.ts +++ b/packages/core/src/properties/extensible-property.ts @@ -1,6 +1,6 @@ -import type { Nullable } from '../constants'; -import type { ExtensionProperty } from './extension-property'; -import { Property, IProperty } from './property'; +import type { Nullable } from '../constants.js'; +import type { ExtensionProperty } from './extension-property.js'; +import { Property, IProperty } from './property.js'; export interface IExtensibleProperty extends IProperty { extensions: { [key: string]: ExtensionProperty }; diff --git a/packages/core/src/properties/extension-property.ts b/packages/core/src/properties/extension-property.ts index 6e02bc5ab..5b510df83 100644 --- a/packages/core/src/properties/extension-property.ts +++ b/packages/core/src/properties/extension-property.ts @@ -1,5 +1,5 @@ -import type { ExtensibleProperty } from './extensible-property'; -import { Property, IProperty } from './property'; +import type { ExtensibleProperty } from './extensible-property.js'; +import { Property, IProperty } from './property.js'; /** * # ExtensionProperty diff --git a/packages/core/src/properties/index.ts b/packages/core/src/properties/index.ts index 52b531cdc..61ec97806 100644 --- a/packages/core/src/properties/index.ts +++ b/packages/core/src/properties/index.ts @@ -1,19 +1,19 @@ -export * from './accessor'; -export * from './animation'; -export * from './animation-channel'; -export * from './animation-sampler'; -export * from './buffer'; -export * from './camera'; -export * from './extension-property'; -export * from './extensible-property'; -export * from './property'; -export * from './material'; -export * from './mesh'; -export * from './node'; -export * from './primitive'; -export * from './primitive-target'; -export * from './root'; -export * from './scene'; -export * from './skin'; -export * from './texture'; -export * from './texture-info'; +export * from './accessor.js'; +export * from './animation.js'; +export * from './animation-channel.js'; +export * from './animation-sampler.js'; +export * from './buffer.js'; +export * from './camera.js'; +export * from './extension-property.js'; +export * from './extensible-property.js'; +export * from './property.js'; +export * from './material.js'; +export * from './mesh.js'; +export * from './node.js'; +export * from './primitive.js'; +export * from './primitive-target.js'; +export * from './root.js'; +export * from './scene.js'; +export * from './skin.js'; +export * from './texture.js'; +export * from './texture-info.js'; diff --git a/packages/core/src/properties/material.ts b/packages/core/src/properties/material.ts index 4019bed85..1de627a24 100644 --- a/packages/core/src/properties/material.ts +++ b/packages/core/src/properties/material.ts @@ -1,9 +1,9 @@ -import { Nullable, PropertyType, TextureChannel, vec3, vec4 } from '../constants'; -import type { GLTF } from '../types/gltf'; -import { ColorUtils } from '../utils'; -import { ExtensibleProperty, IExtensibleProperty } from './extensible-property'; -import type { Texture } from './texture'; -import { TextureInfo } from './texture-info'; +import { Nullable, PropertyType, TextureChannel, vec3, vec4 } from '../constants.js'; +import type { GLTF } from '../types/gltf.js'; +import { ColorUtils } from '../utils/index.js'; +import { ExtensibleProperty, IExtensibleProperty } from './extensible-property.js'; +import type { Texture } from './texture.js'; +import { TextureInfo } from './texture-info.js'; const { R, G, B, A } = TextureChannel; diff --git a/packages/core/src/properties/mesh.ts b/packages/core/src/properties/mesh.ts index 331c74d2e..941ba4183 100644 --- a/packages/core/src/properties/mesh.ts +++ b/packages/core/src/properties/mesh.ts @@ -1,6 +1,6 @@ -import { Nullable, PropertyType } from '../constants'; -import { ExtensibleProperty, IExtensibleProperty } from './extensible-property'; -import type { Primitive } from './primitive'; +import { Nullable, PropertyType } from '../constants.js'; +import { ExtensibleProperty, IExtensibleProperty } from './extensible-property.js'; +import type { Primitive } from './primitive.js'; interface IMesh extends IExtensibleProperty { weights: number[]; diff --git a/packages/core/src/properties/node.ts b/packages/core/src/properties/node.ts index f9b58cb3f..a69dc7ae7 100644 --- a/packages/core/src/properties/node.ts +++ b/packages/core/src/properties/node.ts @@ -1,12 +1,12 @@ import { multiply } from 'gl-matrix/mat4'; -import { PropertyType, mat4, vec3, vec4, Nullable } from '../constants'; +import { PropertyType, mat4, vec3, vec4, Nullable } from '../constants.js'; import { $attributes } from 'property-graph'; -import { MathUtils } from '../utils'; -import type { Camera } from './camera'; -import { ExtensibleProperty, IExtensibleProperty } from './extensible-property'; -import type { Mesh } from './mesh'; -import { COPY_IDENTITY } from './property'; -import type { Skin } from './skin'; +import { MathUtils } from '../utils/index.js'; +import type { Camera } from './camera.js'; +import { ExtensibleProperty, IExtensibleProperty } from './extensible-property.js'; +import type { Mesh } from './mesh.js'; +import { COPY_IDENTITY } from './property.js'; +import type { Skin } from './skin.js'; interface INode extends IExtensibleProperty { translation: vec3; diff --git a/packages/core/src/properties/primitive-target.ts b/packages/core/src/properties/primitive-target.ts index 4f00f4a7c..62c0a876b 100644 --- a/packages/core/src/properties/primitive-target.ts +++ b/packages/core/src/properties/primitive-target.ts @@ -1,7 +1,7 @@ -import { BufferViewUsage, Nullable, PropertyType } from '../constants'; -import type { Accessor } from './accessor'; -import type { IExtensibleProperty } from './extensible-property'; -import { Property } from './property'; +import { BufferViewUsage, Nullable, PropertyType } from '../constants.js'; +import type { Accessor } from './accessor.js'; +import type { IExtensibleProperty } from './extensible-property.js'; +import { Property } from './property.js'; interface IPrimitiveTarget extends IExtensibleProperty { attributes: { [key: string]: Accessor }; diff --git a/packages/core/src/properties/primitive.ts b/packages/core/src/properties/primitive.ts index 804694b9e..74d7db3e4 100644 --- a/packages/core/src/properties/primitive.ts +++ b/packages/core/src/properties/primitive.ts @@ -1,9 +1,9 @@ -import { BufferViewUsage, Nullable, PropertyType } from '../constants'; -import type { GLTF } from '../types/gltf'; -import type { Accessor } from './accessor'; -import { ExtensibleProperty, IExtensibleProperty } from './extensible-property'; -import type { Material } from './material'; -import type { PrimitiveTarget } from './primitive-target'; +import { BufferViewUsage, Nullable, PropertyType } from '../constants.js'; +import type { GLTF } from '../types/gltf.js'; +import type { Accessor } from './accessor.js'; +import { ExtensibleProperty, IExtensibleProperty } from './extensible-property.js'; +import type { Material } from './material.js'; +import type { PrimitiveTarget } from './primitive-target.js'; interface IPrimitive extends IExtensibleProperty { mode: GLTF.MeshPrimitiveMode; diff --git a/packages/core/src/properties/property.ts b/packages/core/src/properties/property.ts index 5a6c3c5fd..190061a29 100644 --- a/packages/core/src/properties/property.ts +++ b/packages/core/src/properties/property.ts @@ -1,4 +1,4 @@ -import type { Nullable } from '../constants'; +import type { Nullable } from '../constants.js'; import { $attributes, $immutableKeys, @@ -10,8 +10,8 @@ import { isRefMap, LiteralKeys, } from 'property-graph'; -import { equalsArray, equalsObject, equalsRef, equalsRefList, equalsRefMap, isArray, isPlainObject } from '../utils'; -import type { Ref, RefMap, UnknownRef } from '../utils'; +import { equalsArray, equalsObject, equalsRef, equalsRefList, equalsRefMap, isArray, isPlainObject } from '../utils/index.js'; +import type { Ref, RefMap, UnknownRef } from '../utils/index.js'; export type PropertyResolver = (p: T) => T; export const COPY_IDENTITY = (t: T): T => t; diff --git a/packages/core/src/properties/root.ts b/packages/core/src/properties/root.ts index 98700b96d..022fea0b7 100644 --- a/packages/core/src/properties/root.ts +++ b/packages/core/src/properties/root.ts @@ -1,19 +1,19 @@ -import { Nullable, PropertyType, VERSION } from '../constants'; -import type { Extension } from '../extension'; +import { Nullable, PropertyType, VERSION } from '../constants.js'; +import type { Extension } from '../extension.js'; import type { Graph } from 'property-graph'; -import { Accessor } from './accessor'; -import { Animation } from './animation'; -import { Buffer } from './buffer'; -import { Camera } from './camera'; -import { Material } from './material'; -import { Mesh } from './mesh'; -import { Node } from './node'; -import { COPY_IDENTITY, Property } from './property'; -import { Scene } from './scene'; -import { Skin } from './skin'; -import { Texture } from './texture'; -import { ExtensibleProperty, IExtensibleProperty } from './extensible-property'; -import type { ExtensionProperty } from './extension-property'; +import { Accessor } from './accessor.js'; +import { Animation } from './animation.js'; +import { Buffer } from './buffer.js'; +import { Camera } from './camera.js'; +import { Material } from './material.js'; +import { Mesh } from './mesh.js'; +import { Node } from './node.js'; +import { COPY_IDENTITY, Property } from './property.js'; +import { Scene } from './scene.js'; +import { Skin } from './skin.js'; +import { Texture } from './texture.js'; +import { ExtensibleProperty, IExtensibleProperty } from './extensible-property.js'; +import type { ExtensionProperty } from './extension-property.js'; interface IAsset { version: string; diff --git a/packages/core/src/properties/scene.ts b/packages/core/src/properties/scene.ts index 90168749c..423209e05 100644 --- a/packages/core/src/properties/scene.ts +++ b/packages/core/src/properties/scene.ts @@ -1,8 +1,8 @@ -import { Nullable, PropertyType } from '../constants'; +import { Nullable, PropertyType } from '../constants.js'; import { $attributes } from 'property-graph'; -import { ExtensibleProperty, IExtensibleProperty } from './extensible-property'; -import type { Node } from './node'; -import { COPY_IDENTITY } from './property'; +import { ExtensibleProperty, IExtensibleProperty } from './extensible-property.js'; +import type { Node } from './node.js'; +import { COPY_IDENTITY } from './property.js'; interface IScene extends IExtensibleProperty { children: Node[]; diff --git a/packages/core/src/properties/skin.ts b/packages/core/src/properties/skin.ts index 2606f8c28..8b3bd3940 100644 --- a/packages/core/src/properties/skin.ts +++ b/packages/core/src/properties/skin.ts @@ -1,7 +1,7 @@ -import { BufferViewUsage, Nullable, PropertyType } from '../constants'; -import type { Accessor } from './accessor'; -import { ExtensibleProperty, IExtensibleProperty } from './extensible-property'; -import type { Node } from './node'; +import { BufferViewUsage, Nullable, PropertyType } from '../constants.js'; +import type { Accessor } from './accessor.js'; +import { ExtensibleProperty, IExtensibleProperty } from './extensible-property.js'; +import type { Node } from './node.js'; interface ISkin extends IExtensibleProperty { skeleton: Node; diff --git a/packages/core/src/properties/texture-info.ts b/packages/core/src/properties/texture-info.ts index 596761293..3496f4ab9 100644 --- a/packages/core/src/properties/texture-info.ts +++ b/packages/core/src/properties/texture-info.ts @@ -1,6 +1,6 @@ -import { Nullable, PropertyType } from '../constants'; -import type { GLTF } from '../types/gltf'; -import { ExtensibleProperty, IExtensibleProperty } from './extensible-property'; +import { Nullable, PropertyType } from '../constants.js'; +import type { GLTF } from '../types/gltf.js'; +import { ExtensibleProperty, IExtensibleProperty } from './extensible-property.js'; interface ITextureInfo extends IExtensibleProperty { texCoord: number; diff --git a/packages/core/src/properties/texture.ts b/packages/core/src/properties/texture.ts index 51ef43db6..e55182115 100644 --- a/packages/core/src/properties/texture.ts +++ b/packages/core/src/properties/texture.ts @@ -1,6 +1,6 @@ -import { Nullable, PropertyType, vec2 } from '../constants'; -import { BufferUtils, FileUtils, ImageUtils } from '../utils'; -import { ExtensibleProperty, IExtensibleProperty } from './extensible-property'; +import { Nullable, PropertyType, vec2 } from '../constants.js'; +import { BufferUtils, FileUtils, ImageUtils } from '../utils/index.js'; +import { ExtensibleProperty, IExtensibleProperty } from './extensible-property.js'; interface ITexture extends IExtensibleProperty { image: Uint8Array | null; diff --git a/packages/core/src/utils/buffer-utils.ts b/packages/core/src/utils/buffer-utils.ts index 5f70613d7..429cf3c9b 100644 --- a/packages/core/src/utils/buffer-utils.ts +++ b/packages/core/src/utils/buffer-utils.ts @@ -1,4 +1,4 @@ -import type { TypedArray } from '../constants'; +import type { TypedArray } from '../constants.js'; /** * # BufferUtils diff --git a/packages/core/src/utils/color-utils.ts b/packages/core/src/utils/color-utils.ts index 1cd363e2a..603801c6d 100644 --- a/packages/core/src/utils/color-utils.ts +++ b/packages/core/src/utils/color-utils.ts @@ -1,4 +1,4 @@ -import type { vec3, vec4 } from '../constants'; +import type { vec3, vec4 } from '../constants.js'; /** * # ColorUtils diff --git a/packages/core/src/utils/file-utils.ts b/packages/core/src/utils/file-utils.ts index 1b94c6473..11fc1504f 100644 --- a/packages/core/src/utils/file-utils.ts +++ b/packages/core/src/utils/file-utils.ts @@ -1,4 +1,4 @@ -import { ImageUtils } from './image-utils'; +import { ImageUtils } from './image-utils.js'; /** * # FileUtils diff --git a/packages/core/src/utils/get-bounds.ts b/packages/core/src/utils/get-bounds.ts index fd23fe000..75550571c 100644 --- a/packages/core/src/utils/get-bounds.ts +++ b/packages/core/src/utils/get-bounds.ts @@ -1,6 +1,6 @@ import { transformMat4 } from 'gl-matrix/vec3'; -import { PropertyType, bbox, mat4, vec3 } from '../constants'; -import type { Mesh, Node, Scene } from '../properties'; +import { PropertyType, bbox, mat4, vec3 } from '../constants.js'; +import type { Mesh, Node, Scene } from '../properties/index.js'; /** * Computes bounding box (AABB) in world space for the given {@link Node} or {@link Scene}. diff --git a/packages/core/src/utils/http-utils.ts b/packages/core/src/utils/http-utils.ts index eee26b68c..2b0d6bfd1 100644 --- a/packages/core/src/utils/http-utils.ts +++ b/packages/core/src/utils/http-utils.ts @@ -1,4 +1,4 @@ -import { FileUtils } from './file-utils'; +import { FileUtils } from './file-utils.js'; // Need a placeholder domain to construct a URL from a relative path. We only // access `url.pathname`, so the domain doesn't matter. diff --git a/packages/core/src/utils/image-utils.ts b/packages/core/src/utils/image-utils.ts index 35acf1db8..3cead3de1 100644 --- a/packages/core/src/utils/image-utils.ts +++ b/packages/core/src/utils/image-utils.ts @@ -1,5 +1,5 @@ -import type { vec2 } from '../constants'; -import { BufferUtils } from './buffer-utils'; +import type { vec2 } from '../constants.js'; +import { BufferUtils } from './buffer-utils.js'; /** Implements support for an image format in the {@link ImageUtils} class. */ export interface ImageUtilsFormat { diff --git a/packages/core/src/utils/index.ts b/packages/core/src/utils/index.ts index 1649de37f..5b6100b5c 100644 --- a/packages/core/src/utils/index.ts +++ b/packages/core/src/utils/index.ts @@ -1,11 +1,11 @@ -export * from './get-bounds'; -export * from './buffer-utils'; -export * from './color-utils'; -export * from './file-utils'; -export * from './image-utils'; -export * from './is-plain-object'; -export * from './logger'; -export * from './math-utils'; -export * from './property-utils'; -export * from './uuid'; -export * from './http-utils'; +export * from './get-bounds.js'; +export * from './buffer-utils.js'; +export * from './color-utils.js'; +export * from './file-utils.js'; +export * from './image-utils.js'; +export * from './is-plain-object.js'; +export * from './logger.js'; +export * from './math-utils.js'; +export * from './property-utils.js'; +export * from './uuid.js'; +export * from './http-utils.js'; diff --git a/packages/core/src/utils/math-utils.ts b/packages/core/src/utils/math-utils.ts index 6367a517b..da4895aee 100644 --- a/packages/core/src/utils/math-utils.ts +++ b/packages/core/src/utils/math-utils.ts @@ -1,7 +1,7 @@ import { determinant, getRotation } from 'gl-matrix/mat4'; import { length } from 'gl-matrix/vec3'; -import type { mat4, vec3, vec4 } from '../constants'; -import type { GLTF } from '../types/gltf'; +import type { mat4, vec3, vec4 } from '../constants.js'; +import type { GLTF } from '../types/gltf.js'; /** @hidden */ export class MathUtils { diff --git a/packages/core/src/utils/property-utils.ts b/packages/core/src/utils/property-utils.ts index 626c31318..15f23b4cd 100644 --- a/packages/core/src/utils/property-utils.ts +++ b/packages/core/src/utils/property-utils.ts @@ -1,7 +1,7 @@ import type { GraphEdge } from 'property-graph'; -import { isPlainObject } from './is-plain-object'; -import type { BufferViewUsage } from '../constants'; -import type { Property } from '../properties'; +import { isPlainObject } from './is-plain-object.js'; +import type { BufferViewUsage } from '../constants.js'; +import type { Property } from '../properties/index.js'; export type Ref = GraphEdge; export type RefMap = { [key: string]: Ref }; diff --git a/packages/core/src/utils/ref-utils.ts b/packages/core/src/utils/ref-utils.ts index ce2e86722..1d0b8be52 100644 --- a/packages/core/src/utils/ref-utils.ts +++ b/packages/core/src/utils/ref-utils.ts @@ -1,5 +1,5 @@ import { GraphEdge } from 'property-graph'; -import { isPlainObject } from './is-plain-object'; +import { isPlainObject } from './is-plain-object.js'; export function isRefList(value: unknown): boolean { return Array.isArray(value) && value[0] instanceof GraphEdge; diff --git a/packages/extensions/src/ext-mesh-gpu-instancing/index.ts b/packages/extensions/src/ext-mesh-gpu-instancing/index.ts index db06421f1..1ed6a91ca 100644 --- a/packages/extensions/src/ext-mesh-gpu-instancing/index.ts +++ b/packages/extensions/src/ext-mesh-gpu-instancing/index.ts @@ -1,2 +1,2 @@ -export * from './mesh-gpu-instancing'; -export * from './instanced-mesh'; +export * from './mesh-gpu-instancing.js'; +export * from './instanced-mesh.js'; diff --git a/packages/extensions/src/ext-mesh-gpu-instancing/instanced-mesh.ts b/packages/extensions/src/ext-mesh-gpu-instancing/instanced-mesh.ts index 47fe9c782..2ac967099 100644 --- a/packages/extensions/src/ext-mesh-gpu-instancing/instanced-mesh.ts +++ b/packages/extensions/src/ext-mesh-gpu-instancing/instanced-mesh.ts @@ -1,5 +1,5 @@ import { Accessor, ExtensionProperty, IProperty, Nullable, PropertyType } from '@gltf-transform/core'; -import { EXT_MESH_GPU_INSTANCING } from '../constants'; +import { EXT_MESH_GPU_INSTANCING } from '../constants.js'; interface IInstancedMesh extends IProperty { attributes: { [key: string]: Accessor }; diff --git a/packages/extensions/src/ext-mesh-gpu-instancing/mesh-gpu-instancing.ts b/packages/extensions/src/ext-mesh-gpu-instancing/mesh-gpu-instancing.ts index 4baba1860..4d8a4c76c 100644 --- a/packages/extensions/src/ext-mesh-gpu-instancing/mesh-gpu-instancing.ts +++ b/packages/extensions/src/ext-mesh-gpu-instancing/mesh-gpu-instancing.ts @@ -1,6 +1,6 @@ import { Extension, PropertyType, ReaderContext, WriterContext } from '@gltf-transform/core'; -import { EXT_MESH_GPU_INSTANCING } from '../constants'; -import { InstancedMesh, INSTANCE_ATTRIBUTE } from './instanced-mesh'; +import { EXT_MESH_GPU_INSTANCING } from '../constants.js'; +import { InstancedMesh, INSTANCE_ATTRIBUTE } from './instanced-mesh.js'; const NAME = EXT_MESH_GPU_INSTANCING; diff --git a/packages/extensions/src/ext-meshopt-compression/decoder.ts b/packages/extensions/src/ext-meshopt-compression/decoder.ts index a771bbc1e..6745ab445 100644 --- a/packages/extensions/src/ext-meshopt-compression/decoder.ts +++ b/packages/extensions/src/ext-meshopt-compression/decoder.ts @@ -1,6 +1,6 @@ -import { EXT_MESHOPT_COMPRESSION } from '../constants'; +import { EXT_MESHOPT_COMPRESSION } from '../constants.js'; import type { GLTF } from '@gltf-transform/core'; -import type { MeshoptBufferExtension } from './constants'; +import type { MeshoptBufferExtension } from './constants.js'; /** * Returns true for a fallback buffer, else false. diff --git a/packages/extensions/src/ext-meshopt-compression/encoder.ts b/packages/extensions/src/ext-meshopt-compression/encoder.ts index 212228ec5..038f6bc2d 100644 --- a/packages/extensions/src/ext-meshopt-compression/encoder.ts +++ b/packages/extensions/src/ext-meshopt-compression/encoder.ts @@ -1,4 +1,4 @@ -import { PreparedAccessor, MeshoptFilter, MeshoptMode } from './constants'; +import { PreparedAccessor, MeshoptFilter, MeshoptMode } from './constants.js'; import { Accessor, AnimationChannel, diff --git a/packages/extensions/src/ext-meshopt-compression/index.ts b/packages/extensions/src/ext-meshopt-compression/index.ts index 1eea8b4fc..8e720d6dd 100644 --- a/packages/extensions/src/ext-meshopt-compression/index.ts +++ b/packages/extensions/src/ext-meshopt-compression/index.ts @@ -1 +1 @@ -export * from './meshopt-compression'; +export * from './meshopt-compression.js'; diff --git a/packages/extensions/src/ext-meshopt-compression/meshopt-compression.ts b/packages/extensions/src/ext-meshopt-compression/meshopt-compression.ts index b0802d7ca..61d361d63 100644 --- a/packages/extensions/src/ext-meshopt-compression/meshopt-compression.ts +++ b/packages/extensions/src/ext-meshopt-compression/meshopt-compression.ts @@ -9,10 +9,10 @@ import { ReaderContext, WriterContext, } from '@gltf-transform/core'; -import { EncoderMethod, MeshoptBufferViewExtension, MeshoptFilter } from './constants'; -import { EXT_MESHOPT_COMPRESSION } from '../constants'; -import { getMeshoptFilter, getMeshoptMode, getTargetPath, prepareAccessor } from './encoder'; -import { isFallbackBuffer } from './decoder'; +import { EncoderMethod, MeshoptBufferViewExtension, MeshoptFilter } from './constants.js'; +import { EXT_MESHOPT_COMPRESSION } from '../constants.js'; +import { getMeshoptFilter, getMeshoptMode, getTargetPath, prepareAccessor } from './encoder.js'; +import { isFallbackBuffer } from './decoder.js'; import type { MeshoptEncoder, MeshoptDecoder } from 'meshoptimizer'; const NAME = EXT_MESHOPT_COMPRESSION; diff --git a/packages/extensions/src/ext-texture-avif/index.ts b/packages/extensions/src/ext-texture-avif/index.ts index 88ad7bee9..5ba5682d6 100644 --- a/packages/extensions/src/ext-texture-avif/index.ts +++ b/packages/extensions/src/ext-texture-avif/index.ts @@ -1 +1 @@ -export * from './texture-avif'; +export * from './texture-avif.js'; diff --git a/packages/extensions/src/ext-texture-avif/texture-avif.ts b/packages/extensions/src/ext-texture-avif/texture-avif.ts index 63e86f34c..f18022996 100644 --- a/packages/extensions/src/ext-texture-avif/texture-avif.ts +++ b/packages/extensions/src/ext-texture-avif/texture-avif.ts @@ -8,7 +8,7 @@ import { vec2, BufferUtils, } from '@gltf-transform/core'; -import { EXT_TEXTURE_AVIF } from '../constants'; +import { EXT_TEXTURE_AVIF } from '../constants.js'; const NAME = EXT_TEXTURE_AVIF; diff --git a/packages/extensions/src/ext-texture-webp/index.ts b/packages/extensions/src/ext-texture-webp/index.ts index 568bcf3e4..828905933 100644 --- a/packages/extensions/src/ext-texture-webp/index.ts +++ b/packages/extensions/src/ext-texture-webp/index.ts @@ -1 +1 @@ -export * from './texture-webp'; +export * from './texture-webp.js'; diff --git a/packages/extensions/src/ext-texture-webp/texture-webp.ts b/packages/extensions/src/ext-texture-webp/texture-webp.ts index 76714a736..1dcf1d3db 100644 --- a/packages/extensions/src/ext-texture-webp/texture-webp.ts +++ b/packages/extensions/src/ext-texture-webp/texture-webp.ts @@ -8,7 +8,7 @@ import { WriterContext, vec2, } from '@gltf-transform/core'; -import { EXT_TEXTURE_WEBP } from '../constants'; +import { EXT_TEXTURE_WEBP } from '../constants.js'; const NAME = EXT_TEXTURE_WEBP; diff --git a/packages/extensions/src/extensions.ts b/packages/extensions/src/extensions.ts index 2e8b63ced..e391c2944 100644 --- a/packages/extensions/src/extensions.ts +++ b/packages/extensions/src/extensions.ts @@ -1,26 +1,26 @@ /** @module extensions */ -import { EXTMeshGPUInstancing } from './ext-mesh-gpu-instancing'; -import { EXTMeshoptCompression } from './ext-meshopt-compression'; -import { EXTTextureAVIF } from './ext-texture-avif'; -import { EXTTextureWebP } from './ext-texture-webp'; -import { KHRDracoMeshCompression } from './khr-draco-mesh-compression'; -import { KHRLightsPunctual } from './khr-lights-punctual'; -import { KHRMaterialsClearcoat } from './khr-materials-clearcoat'; -import { KHRMaterialsEmissiveStrength } from './khr-materials-emissive-strength'; -import { KHRMaterialsIOR } from './khr-materials-ior'; -import { KHRMaterialsIridescence } from './khr-materials-iridescence'; -import { KHRMaterialsPBRSpecularGlossiness } from './khr-materials-pbr-specular-glossiness'; -import { KHRMaterialsSheen } from './khr-materials-sheen'; -import { KHRMaterialsSpecular } from './khr-materials-specular'; -import { KHRMaterialsTransmission } from './khr-materials-transmission'; -import { KHRMaterialsUnlit } from './khr-materials-unlit'; -import { KHRMaterialsVariants } from './khr-materials-variants'; -import { KHRMaterialsVolume } from './khr-materials-volume'; -import { KHRMeshQuantization } from './khr-mesh-quantization'; -import { KHRTextureBasisu } from './khr-texture-basisu'; -import { KHRTextureTransform } from './khr-texture-transform'; -import { KHRXMP } from './khr-xmp-json-ld'; +import { EXTMeshGPUInstancing } from './ext-mesh-gpu-instancing/index.js'; +import { EXTMeshoptCompression } from './ext-meshopt-compression/index.js'; +import { EXTTextureAVIF } from './ext-texture-avif/index.js'; +import { EXTTextureWebP } from './ext-texture-webp/index.js'; +import { KHRDracoMeshCompression } from './khr-draco-mesh-compression/index.js'; +import { KHRLightsPunctual } from './khr-lights-punctual/index.js'; +import { KHRMaterialsClearcoat } from './khr-materials-clearcoat/index.js'; +import { KHRMaterialsEmissiveStrength } from './khr-materials-emissive-strength/index.js'; +import { KHRMaterialsIOR } from './khr-materials-ior/index.js'; +import { KHRMaterialsIridescence } from './khr-materials-iridescence/index.js'; +import { KHRMaterialsPBRSpecularGlossiness } from './khr-materials-pbr-specular-glossiness/index.js'; +import { KHRMaterialsSheen } from './khr-materials-sheen/index.js'; +import { KHRMaterialsSpecular } from './khr-materials-specular/index.js'; +import { KHRMaterialsTransmission } from './khr-materials-transmission/index.js'; +import { KHRMaterialsUnlit } from './khr-materials-unlit/index.js'; +import { KHRMaterialsVariants } from './khr-materials-variants/index.js'; +import { KHRMaterialsVolume } from './khr-materials-volume/index.js'; +import { KHRMeshQuantization } from './khr-mesh-quantization/index.js'; +import { KHRTextureBasisu } from './khr-texture-basisu/index.js'; +import { KHRTextureTransform } from './khr-texture-transform/index.js'; +import { KHRXMP } from './khr-xmp-json-ld/index.js'; export const KHRONOS_EXTENSIONS = [ KHRDracoMeshCompression, @@ -50,24 +50,24 @@ export const ALL_EXTENSIONS = [ ...KHRONOS_EXTENSIONS, ]; -export * from './ext-mesh-gpu-instancing'; -export * from './ext-meshopt-compression'; -export * from './ext-texture-avif'; -export * from './ext-texture-webp'; -export * from './khr-draco-mesh-compression'; -export * from './khr-lights-punctual'; -export * from './khr-materials-clearcoat'; -export * from './khr-materials-emissive-strength'; -export * from './khr-materials-ior'; -export * from './khr-materials-iridescence'; -export * from './khr-materials-sheen'; -export * from './khr-materials-specular'; -export * from './khr-materials-pbr-specular-glossiness'; -export * from './khr-materials-transmission'; -export * from './khr-materials-unlit'; -export * from './khr-materials-variants'; -export * from './khr-materials-volume'; -export * from './khr-mesh-quantization'; -export * from './khr-texture-basisu'; -export * from './khr-texture-transform'; -export * from './khr-xmp-json-ld'; +export * from './ext-mesh-gpu-instancing/index.js'; +export * from './ext-meshopt-compression/index.js'; +export * from './ext-texture-avif/index.js'; +export * from './ext-texture-webp/index.js'; +export * from './khr-draco-mesh-compression/index.js'; +export * from './khr-lights-punctual/index.js'; +export * from './khr-materials-clearcoat/index.js'; +export * from './khr-materials-emissive-strength/index.js'; +export * from './khr-materials-ior/index.js'; +export * from './khr-materials-iridescence/index.js'; +export * from './khr-materials-sheen/index.js'; +export * from './khr-materials-specular/index.js'; +export * from './khr-materials-pbr-specular-glossiness/index.js'; +export * from './khr-materials-transmission/index.js'; +export * from './khr-materials-unlit/index.js'; +export * from './khr-materials-variants/index.js'; +export * from './khr-materials-volume/index.js'; +export * from './khr-mesh-quantization/index.js'; +export * from './khr-texture-basisu/index.js'; +export * from './khr-texture-transform/index.js'; +export * from './khr-xmp-json-ld/index.js'; diff --git a/packages/extensions/src/khr-draco-mesh-compression/decoder.ts b/packages/extensions/src/khr-draco-mesh-compression/decoder.ts index a93702c64..6ec614b97 100644 --- a/packages/extensions/src/khr-draco-mesh-compression/decoder.ts +++ b/packages/extensions/src/khr-draco-mesh-compression/decoder.ts @@ -1,5 +1,5 @@ import { Accessor, GLTF, TypedArray, TypedArrayConstructor } from '@gltf-transform/core'; -import { KHR_DRACO_MESH_COMPRESSION } from '../constants'; +import { KHR_DRACO_MESH_COMPRESSION } from '../constants.js'; import type { Attribute, DataType, Decoder, DecoderModule, Mesh } from 'draco3dgltf'; const NAME = KHR_DRACO_MESH_COMPRESSION; diff --git a/packages/extensions/src/khr-draco-mesh-compression/draco-mesh-compression.ts b/packages/extensions/src/khr-draco-mesh-compression/draco-mesh-compression.ts index 065645ba2..d73f6c0ca 100644 --- a/packages/extensions/src/khr-draco-mesh-compression/draco-mesh-compression.ts +++ b/packages/extensions/src/khr-draco-mesh-compression/draco-mesh-compression.ts @@ -11,7 +11,7 @@ import { ReaderContext, WriterContext, } from '@gltf-transform/core'; -import { decodeAttribute, decodeGeometry, decodeIndex, initDecoderModule } from './decoder'; +import { decodeAttribute, decodeGeometry, decodeIndex, initDecoderModule } from './decoder.js'; import { EncodedPrimitive, encodeGeometry, @@ -19,8 +19,8 @@ import { EncoderOptions, EncodingError, initEncoderModule, -} from './encoder'; -import { KHR_DRACO_MESH_COMPRESSION } from '../constants'; +} from './encoder.js'; +import { KHR_DRACO_MESH_COMPRESSION } from '../constants.js'; import type { Decoder, DecoderModule, EncoderModule, Mesh } from 'draco3dgltf'; const NAME = KHR_DRACO_MESH_COMPRESSION; diff --git a/packages/extensions/src/khr-draco-mesh-compression/index.ts b/packages/extensions/src/khr-draco-mesh-compression/index.ts index a8923a9e4..840a7c2f3 100644 --- a/packages/extensions/src/khr-draco-mesh-compression/index.ts +++ b/packages/extensions/src/khr-draco-mesh-compression/index.ts @@ -1 +1 @@ -export * from './draco-mesh-compression'; +export * from './draco-mesh-compression.js'; diff --git a/packages/extensions/src/khr-lights-punctual/index.ts b/packages/extensions/src/khr-lights-punctual/index.ts index d12c20535..46394c59f 100644 --- a/packages/extensions/src/khr-lights-punctual/index.ts +++ b/packages/extensions/src/khr-lights-punctual/index.ts @@ -1,2 +1,2 @@ -export * from './lights-punctual'; -export * from './light'; +export * from './lights-punctual.js'; +export * from './light.js'; diff --git a/packages/extensions/src/khr-lights-punctual/light.ts b/packages/extensions/src/khr-lights-punctual/light.ts index 1972be327..f34fd8beb 100644 --- a/packages/extensions/src/khr-lights-punctual/light.ts +++ b/packages/extensions/src/khr-lights-punctual/light.ts @@ -1,6 +1,6 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType, vec3 } from '@gltf-transform/core'; import { ColorUtils } from '@gltf-transform/core'; -import { KHR_LIGHTS_PUNCTUAL } from '../constants'; +import { KHR_LIGHTS_PUNCTUAL } from '../constants.js'; interface ILight extends IProperty { color: vec3; diff --git a/packages/extensions/src/khr-lights-punctual/lights-punctual.ts b/packages/extensions/src/khr-lights-punctual/lights-punctual.ts index 9cd01b019..469b5f6d5 100644 --- a/packages/extensions/src/khr-lights-punctual/lights-punctual.ts +++ b/packages/extensions/src/khr-lights-punctual/lights-punctual.ts @@ -1,6 +1,6 @@ import { Extension, MathUtils, ReaderContext, WriterContext, vec3 } from '@gltf-transform/core'; -import { KHR_LIGHTS_PUNCTUAL } from '../constants'; -import { Light } from './light'; +import { KHR_LIGHTS_PUNCTUAL } from '../constants.js'; +import { Light } from './light.js'; const NAME = KHR_LIGHTS_PUNCTUAL; diff --git a/packages/extensions/src/khr-materials-clearcoat/clearcoat.ts b/packages/extensions/src/khr-materials-clearcoat/clearcoat.ts index 56c720226..f47183436 100644 --- a/packages/extensions/src/khr-materials-clearcoat/clearcoat.ts +++ b/packages/extensions/src/khr-materials-clearcoat/clearcoat.ts @@ -7,7 +7,7 @@ import { TextureChannel, TextureInfo, } from '@gltf-transform/core'; -import { KHR_MATERIALS_CLEARCOAT } from '../constants'; +import { KHR_MATERIALS_CLEARCOAT } from '../constants.js'; interface IClearcoat extends IProperty { clearcoatFactor: number; diff --git a/packages/extensions/src/khr-materials-clearcoat/index.ts b/packages/extensions/src/khr-materials-clearcoat/index.ts index abab90ea7..83ea5a688 100644 --- a/packages/extensions/src/khr-materials-clearcoat/index.ts +++ b/packages/extensions/src/khr-materials-clearcoat/index.ts @@ -1,2 +1,2 @@ -export * from './materials-clearcoat'; -export * from './clearcoat'; +export * from './materials-clearcoat.js'; +export * from './clearcoat.js'; diff --git a/packages/extensions/src/khr-materials-clearcoat/materials-clearcoat.ts b/packages/extensions/src/khr-materials-clearcoat/materials-clearcoat.ts index 230342d99..206c55618 100644 --- a/packages/extensions/src/khr-materials-clearcoat/materials-clearcoat.ts +++ b/packages/extensions/src/khr-materials-clearcoat/materials-clearcoat.ts @@ -1,6 +1,6 @@ import { Extension, GLTF, ReaderContext, WriterContext } from '@gltf-transform/core'; -import { KHR_MATERIALS_CLEARCOAT } from '../constants'; -import { Clearcoat } from './clearcoat'; +import { KHR_MATERIALS_CLEARCOAT } from '../constants.js'; +import { Clearcoat } from './clearcoat.js'; const NAME = KHR_MATERIALS_CLEARCOAT; diff --git a/packages/extensions/src/khr-materials-emissive-strength/emissive-strength.ts b/packages/extensions/src/khr-materials-emissive-strength/emissive-strength.ts index f0f083aa3..12f91d778 100644 --- a/packages/extensions/src/khr-materials-emissive-strength/emissive-strength.ts +++ b/packages/extensions/src/khr-materials-emissive-strength/emissive-strength.ts @@ -1,5 +1,5 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType } from '@gltf-transform/core'; -import { KHR_MATERIALS_EMISSIVE_STRENGTH } from '../constants'; +import { KHR_MATERIALS_EMISSIVE_STRENGTH } from '../constants.js'; interface IEmissiveStrength extends IProperty { emissiveStrength: number; diff --git a/packages/extensions/src/khr-materials-emissive-strength/index.ts b/packages/extensions/src/khr-materials-emissive-strength/index.ts index d3a937bfb..1dabae98e 100644 --- a/packages/extensions/src/khr-materials-emissive-strength/index.ts +++ b/packages/extensions/src/khr-materials-emissive-strength/index.ts @@ -1,2 +1,2 @@ -export * from './materials-emissive-strength'; -export * from './emissive-strength'; +export * from './materials-emissive-strength.js'; +export * from './emissive-strength.js'; diff --git a/packages/extensions/src/khr-materials-emissive-strength/materials-emissive-strength.ts b/packages/extensions/src/khr-materials-emissive-strength/materials-emissive-strength.ts index e3c0e012d..538c66111 100644 --- a/packages/extensions/src/khr-materials-emissive-strength/materials-emissive-strength.ts +++ b/packages/extensions/src/khr-materials-emissive-strength/materials-emissive-strength.ts @@ -1,6 +1,6 @@ import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core'; -import { KHR_MATERIALS_EMISSIVE_STRENGTH } from '../constants'; -import { EmissiveStrength } from './emissive-strength'; +import { KHR_MATERIALS_EMISSIVE_STRENGTH } from '../constants.js'; +import { EmissiveStrength } from './emissive-strength.js'; const NAME = KHR_MATERIALS_EMISSIVE_STRENGTH; diff --git a/packages/extensions/src/khr-materials-ior/index.ts b/packages/extensions/src/khr-materials-ior/index.ts index cf391a059..d8fa99a49 100644 --- a/packages/extensions/src/khr-materials-ior/index.ts +++ b/packages/extensions/src/khr-materials-ior/index.ts @@ -1,2 +1,2 @@ -export * from './materials-ior'; -export * from './ior'; +export * from './materials-ior.js'; +export * from './ior.js'; diff --git a/packages/extensions/src/khr-materials-ior/ior.ts b/packages/extensions/src/khr-materials-ior/ior.ts index d14d39e20..5052026d0 100644 --- a/packages/extensions/src/khr-materials-ior/ior.ts +++ b/packages/extensions/src/khr-materials-ior/ior.ts @@ -1,5 +1,5 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType } from '@gltf-transform/core'; -import { KHR_MATERIALS_IOR } from '../constants'; +import { KHR_MATERIALS_IOR } from '../constants.js'; interface IIOR extends IProperty { ior: number; diff --git a/packages/extensions/src/khr-materials-ior/materials-ior.ts b/packages/extensions/src/khr-materials-ior/materials-ior.ts index 4233b3fc0..903e659bc 100644 --- a/packages/extensions/src/khr-materials-ior/materials-ior.ts +++ b/packages/extensions/src/khr-materials-ior/materials-ior.ts @@ -1,6 +1,6 @@ import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core'; -import { KHR_MATERIALS_IOR } from '../constants'; -import { IOR } from './ior'; +import { KHR_MATERIALS_IOR } from '../constants.js'; +import { IOR } from './ior.js'; const NAME = KHR_MATERIALS_IOR; diff --git a/packages/extensions/src/khr-materials-iridescence/index.ts b/packages/extensions/src/khr-materials-iridescence/index.ts index 2995b2548..5ab19a97f 100644 --- a/packages/extensions/src/khr-materials-iridescence/index.ts +++ b/packages/extensions/src/khr-materials-iridescence/index.ts @@ -1,2 +1,2 @@ -export * from './materials-iridescence'; -export * from './iridescence'; +export * from './materials-iridescence.js'; +export * from './iridescence.js'; diff --git a/packages/extensions/src/khr-materials-iridescence/iridescence.ts b/packages/extensions/src/khr-materials-iridescence/iridescence.ts index 38ee173d4..348d1fc03 100644 --- a/packages/extensions/src/khr-materials-iridescence/iridescence.ts +++ b/packages/extensions/src/khr-materials-iridescence/iridescence.ts @@ -7,7 +7,7 @@ import { TextureChannel, TextureInfo, } from '@gltf-transform/core'; -import { KHR_MATERIALS_IRIDESCENCE } from '../constants'; +import { KHR_MATERIALS_IRIDESCENCE } from '../constants.js'; interface IIridescence extends IProperty { iridescenceFactor: number; diff --git a/packages/extensions/src/khr-materials-iridescence/materials-iridescence.ts b/packages/extensions/src/khr-materials-iridescence/materials-iridescence.ts index e91bfcf6b..f01fb2bee 100644 --- a/packages/extensions/src/khr-materials-iridescence/materials-iridescence.ts +++ b/packages/extensions/src/khr-materials-iridescence/materials-iridescence.ts @@ -1,6 +1,6 @@ import { Extension, GLTF, ReaderContext, WriterContext } from '@gltf-transform/core'; -import { KHR_MATERIALS_IRIDESCENCE } from '../constants'; -import { Iridescence } from './iridescence'; +import { KHR_MATERIALS_IRIDESCENCE } from '../constants.js'; +import { Iridescence } from './iridescence.js'; const NAME = KHR_MATERIALS_IRIDESCENCE; diff --git a/packages/extensions/src/khr-materials-pbr-specular-glossiness/index.ts b/packages/extensions/src/khr-materials-pbr-specular-glossiness/index.ts index 7d6d61208..1ec129750 100644 --- a/packages/extensions/src/khr-materials-pbr-specular-glossiness/index.ts +++ b/packages/extensions/src/khr-materials-pbr-specular-glossiness/index.ts @@ -1,2 +1,2 @@ -export * from './materials-pbr-specular-glossiness'; -export * from './pbr-specular-glossiness'; +export * from './materials-pbr-specular-glossiness.js'; +export * from './pbr-specular-glossiness.js'; diff --git a/packages/extensions/src/khr-materials-pbr-specular-glossiness/materials-pbr-specular-glossiness.ts b/packages/extensions/src/khr-materials-pbr-specular-glossiness/materials-pbr-specular-glossiness.ts index 9c4bafc71..49c573086 100644 --- a/packages/extensions/src/khr-materials-pbr-specular-glossiness/materials-pbr-specular-glossiness.ts +++ b/packages/extensions/src/khr-materials-pbr-specular-glossiness/materials-pbr-specular-glossiness.ts @@ -1,6 +1,6 @@ import { Extension, GLTF, ReaderContext, WriterContext, vec3, vec4 } from '@gltf-transform/core'; -import { KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS } from '../constants'; -import { PBRSpecularGlossiness } from './pbr-specular-glossiness'; +import { KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS } from '../constants.js'; +import { PBRSpecularGlossiness } from './pbr-specular-glossiness.js'; const NAME = KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS; diff --git a/packages/extensions/src/khr-materials-pbr-specular-glossiness/pbr-specular-glossiness.ts b/packages/extensions/src/khr-materials-pbr-specular-glossiness/pbr-specular-glossiness.ts index 802cc2948..762d36dcc 100644 --- a/packages/extensions/src/khr-materials-pbr-specular-glossiness/pbr-specular-glossiness.ts +++ b/packages/extensions/src/khr-materials-pbr-specular-glossiness/pbr-specular-glossiness.ts @@ -10,7 +10,7 @@ import { vec3, vec4, } from '@gltf-transform/core'; -import { KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS } from '../constants'; +import { KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS } from '../constants.js'; interface IPBRSpecularGlossiness extends IProperty { diffuseFactor: vec4; diff --git a/packages/extensions/src/khr-materials-sheen/index.ts b/packages/extensions/src/khr-materials-sheen/index.ts index 7841acc91..87e85fa30 100644 --- a/packages/extensions/src/khr-materials-sheen/index.ts +++ b/packages/extensions/src/khr-materials-sheen/index.ts @@ -1,2 +1,2 @@ -export * from './materials-sheen'; -export * from './sheen'; +export * from './materials-sheen.js'; +export * from './sheen.js'; diff --git a/packages/extensions/src/khr-materials-sheen/materials-sheen.ts b/packages/extensions/src/khr-materials-sheen/materials-sheen.ts index f7604b8fd..701ce3cde 100644 --- a/packages/extensions/src/khr-materials-sheen/materials-sheen.ts +++ b/packages/extensions/src/khr-materials-sheen/materials-sheen.ts @@ -1,6 +1,6 @@ import { Extension, GLTF, ReaderContext, WriterContext, vec3 } from '@gltf-transform/core'; -import { KHR_MATERIALS_SHEEN } from '../constants'; -import { Sheen } from './sheen'; +import { KHR_MATERIALS_SHEEN } from '../constants.js'; +import { Sheen } from './sheen.js'; const NAME = KHR_MATERIALS_SHEEN; diff --git a/packages/extensions/src/khr-materials-sheen/sheen.ts b/packages/extensions/src/khr-materials-sheen/sheen.ts index 197d34087..a2eed2131 100644 --- a/packages/extensions/src/khr-materials-sheen/sheen.ts +++ b/packages/extensions/src/khr-materials-sheen/sheen.ts @@ -9,7 +9,7 @@ import { TextureInfo, vec3, } from '@gltf-transform/core'; -import { KHR_MATERIALS_SHEEN } from '../constants'; +import { KHR_MATERIALS_SHEEN } from '../constants.js'; interface ISheen extends IProperty { sheenColorFactor: vec3; diff --git a/packages/extensions/src/khr-materials-specular/index.ts b/packages/extensions/src/khr-materials-specular/index.ts index f2b25371a..ba7a63460 100644 --- a/packages/extensions/src/khr-materials-specular/index.ts +++ b/packages/extensions/src/khr-materials-specular/index.ts @@ -1,2 +1,2 @@ -export * from './materials-specular'; -export * from './specular'; +export * from './materials-specular.js'; +export * from './specular.js'; diff --git a/packages/extensions/src/khr-materials-specular/materials-specular.ts b/packages/extensions/src/khr-materials-specular/materials-specular.ts index a65c85e89..5a16dac95 100644 --- a/packages/extensions/src/khr-materials-specular/materials-specular.ts +++ b/packages/extensions/src/khr-materials-specular/materials-specular.ts @@ -1,6 +1,6 @@ import { Extension, GLTF, ReaderContext, WriterContext, vec3, MathUtils } from '@gltf-transform/core'; -import { KHR_MATERIALS_SPECULAR } from '../constants'; -import { Specular } from './specular'; +import { KHR_MATERIALS_SPECULAR } from '../constants.js'; +import { Specular } from './specular.js'; const NAME = KHR_MATERIALS_SPECULAR; diff --git a/packages/extensions/src/khr-materials-specular/specular.ts b/packages/extensions/src/khr-materials-specular/specular.ts index 11129d572..1f2a4265f 100644 --- a/packages/extensions/src/khr-materials-specular/specular.ts +++ b/packages/extensions/src/khr-materials-specular/specular.ts @@ -9,7 +9,7 @@ import { TextureInfo, vec3, } from '@gltf-transform/core'; -import { KHR_MATERIALS_SPECULAR } from '../constants'; +import { KHR_MATERIALS_SPECULAR } from '../constants.js'; interface ISpecular extends IProperty { specularFactor: number; diff --git a/packages/extensions/src/khr-materials-transmission/index.ts b/packages/extensions/src/khr-materials-transmission/index.ts index 37f41baab..13f2d991a 100644 --- a/packages/extensions/src/khr-materials-transmission/index.ts +++ b/packages/extensions/src/khr-materials-transmission/index.ts @@ -1,2 +1,2 @@ -export * from './materials-transmission'; -export * from './transmission'; +export * from './materials-transmission.js'; +export * from './transmission.js'; diff --git a/packages/extensions/src/khr-materials-transmission/materials-transmission.ts b/packages/extensions/src/khr-materials-transmission/materials-transmission.ts index 257a4274a..f572ec30e 100644 --- a/packages/extensions/src/khr-materials-transmission/materials-transmission.ts +++ b/packages/extensions/src/khr-materials-transmission/materials-transmission.ts @@ -1,6 +1,6 @@ import { Extension, GLTF, ReaderContext, WriterContext } from '@gltf-transform/core'; -import { KHR_MATERIALS_TRANSMISSION } from '../constants'; -import { Transmission } from './transmission'; +import { KHR_MATERIALS_TRANSMISSION } from '../constants.js'; +import { Transmission } from './transmission.js'; const NAME = KHR_MATERIALS_TRANSMISSION; diff --git a/packages/extensions/src/khr-materials-transmission/transmission.ts b/packages/extensions/src/khr-materials-transmission/transmission.ts index 6849180e8..07864e756 100644 --- a/packages/extensions/src/khr-materials-transmission/transmission.ts +++ b/packages/extensions/src/khr-materials-transmission/transmission.ts @@ -7,7 +7,7 @@ import { TextureChannel, TextureInfo, } from '@gltf-transform/core'; -import { KHR_MATERIALS_TRANSMISSION } from '../constants'; +import { KHR_MATERIALS_TRANSMISSION } from '../constants.js'; interface ITransmission extends IProperty { transmissionFactor: number; diff --git a/packages/extensions/src/khr-materials-unlit/index.ts b/packages/extensions/src/khr-materials-unlit/index.ts index 5754747d0..124bbc381 100644 --- a/packages/extensions/src/khr-materials-unlit/index.ts +++ b/packages/extensions/src/khr-materials-unlit/index.ts @@ -1,2 +1,2 @@ -export * from './materials-unlit'; -export * from './unlit'; +export * from './materials-unlit.js'; +export * from './unlit.js'; diff --git a/packages/extensions/src/khr-materials-unlit/materials-unlit.ts b/packages/extensions/src/khr-materials-unlit/materials-unlit.ts index edfd0ec9c..cf8dda623 100644 --- a/packages/extensions/src/khr-materials-unlit/materials-unlit.ts +++ b/packages/extensions/src/khr-materials-unlit/materials-unlit.ts @@ -1,6 +1,6 @@ import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core'; -import { KHR_MATERIALS_UNLIT } from '../constants'; -import { Unlit } from './unlit'; +import { KHR_MATERIALS_UNLIT } from '../constants.js'; +import { Unlit } from './unlit.js'; const NAME = KHR_MATERIALS_UNLIT; diff --git a/packages/extensions/src/khr-materials-unlit/unlit.ts b/packages/extensions/src/khr-materials-unlit/unlit.ts index b4d4ccdae..871e19203 100644 --- a/packages/extensions/src/khr-materials-unlit/unlit.ts +++ b/packages/extensions/src/khr-materials-unlit/unlit.ts @@ -1,6 +1,6 @@ import { ExtensionProperty } from '@gltf-transform/core'; import { PropertyType } from '@gltf-transform/core'; -import { KHR_MATERIALS_UNLIT } from '../constants'; +import { KHR_MATERIALS_UNLIT } from '../constants.js'; /** * # Unlit diff --git a/packages/extensions/src/khr-materials-variants/index.ts b/packages/extensions/src/khr-materials-variants/index.ts index e27db4f05..151a1c684 100644 --- a/packages/extensions/src/khr-materials-variants/index.ts +++ b/packages/extensions/src/khr-materials-variants/index.ts @@ -1,4 +1,4 @@ -export * from './materials-variants'; -export * from './variant'; -export * from './mapping'; -export * from './mapping-list'; +export * from './materials-variants.js'; +export * from './variant.js'; +export * from './mapping.js'; +export * from './mapping-list.js'; diff --git a/packages/extensions/src/khr-materials-variants/mapping-list.ts b/packages/extensions/src/khr-materials-variants/mapping-list.ts index 6ce9650e8..d3fb76d6d 100644 --- a/packages/extensions/src/khr-materials-variants/mapping-list.ts +++ b/packages/extensions/src/khr-materials-variants/mapping-list.ts @@ -1,6 +1,6 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType } from '@gltf-transform/core'; -import { KHR_MATERIALS_VARIANTS } from '../constants'; -import type { Mapping } from './mapping'; +import { KHR_MATERIALS_VARIANTS } from '../constants.js'; +import type { Mapping } from './mapping.js'; interface IMappingList extends IProperty { mappings: Mapping[]; diff --git a/packages/extensions/src/khr-materials-variants/mapping.ts b/packages/extensions/src/khr-materials-variants/mapping.ts index 595738820..3ad114113 100644 --- a/packages/extensions/src/khr-materials-variants/mapping.ts +++ b/packages/extensions/src/khr-materials-variants/mapping.ts @@ -1,6 +1,6 @@ import { ExtensionProperty, IProperty, Material, Nullable } from '@gltf-transform/core'; -import { KHR_MATERIALS_VARIANTS } from '../constants'; -import type { Variant } from './variant'; +import { KHR_MATERIALS_VARIANTS } from '../constants.js'; +import type { Variant } from './variant.js'; interface IMapping extends IProperty { material: Material; diff --git a/packages/extensions/src/khr-materials-variants/materials-variants.ts b/packages/extensions/src/khr-materials-variants/materials-variants.ts index d869a61ba..f6f24bfb4 100644 --- a/packages/extensions/src/khr-materials-variants/materials-variants.ts +++ b/packages/extensions/src/khr-materials-variants/materials-variants.ts @@ -1,8 +1,8 @@ import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core'; -import { KHR_MATERIALS_VARIANTS } from '../constants'; -import { Mapping } from './mapping'; -import { MappingList } from './mapping-list'; -import { Variant } from './variant'; +import { KHR_MATERIALS_VARIANTS } from '../constants.js'; +import { Mapping } from './mapping.js'; +import { MappingList } from './mapping-list.js'; +import { Variant } from './variant.js'; const NAME = KHR_MATERIALS_VARIANTS; diff --git a/packages/extensions/src/khr-materials-variants/variant.ts b/packages/extensions/src/khr-materials-variants/variant.ts index f46271a87..e3c390894 100644 --- a/packages/extensions/src/khr-materials-variants/variant.ts +++ b/packages/extensions/src/khr-materials-variants/variant.ts @@ -1,5 +1,5 @@ import { ExtensionProperty } from '@gltf-transform/core'; -import { KHR_MATERIALS_VARIANTS } from '../constants'; +import { KHR_MATERIALS_VARIANTS } from '../constants.js'; /** * # Variant diff --git a/packages/extensions/src/khr-materials-volume/index.ts b/packages/extensions/src/khr-materials-volume/index.ts index 508ef6213..a85fc69e1 100644 --- a/packages/extensions/src/khr-materials-volume/index.ts +++ b/packages/extensions/src/khr-materials-volume/index.ts @@ -1,2 +1,2 @@ -export * from './materials-volume'; -export * from './volume'; +export * from './materials-volume.js'; +export * from './volume.js'; diff --git a/packages/extensions/src/khr-materials-volume/materials-volume.ts b/packages/extensions/src/khr-materials-volume/materials-volume.ts index e9fcb25d5..971fa95f5 100644 --- a/packages/extensions/src/khr-materials-volume/materials-volume.ts +++ b/packages/extensions/src/khr-materials-volume/materials-volume.ts @@ -1,6 +1,6 @@ import { Extension, GLTF, ReaderContext, WriterContext, vec3, MathUtils } from '@gltf-transform/core'; -import { KHR_MATERIALS_VOLUME } from '../constants'; -import { Volume } from './volume'; +import { KHR_MATERIALS_VOLUME } from '../constants.js'; +import { Volume } from './volume.js'; const NAME = KHR_MATERIALS_VOLUME; diff --git a/packages/extensions/src/khr-materials-volume/volume.ts b/packages/extensions/src/khr-materials-volume/volume.ts index f747c1343..9157fb525 100644 --- a/packages/extensions/src/khr-materials-volume/volume.ts +++ b/packages/extensions/src/khr-materials-volume/volume.ts @@ -9,7 +9,7 @@ import { TextureInfo, vec3, } from '@gltf-transform/core'; -import { KHR_MATERIALS_VOLUME } from '../constants'; +import { KHR_MATERIALS_VOLUME } from '../constants.js'; interface IVolume extends IProperty { thicknessFactor: number; diff --git a/packages/extensions/src/khr-mesh-quantization/index.ts b/packages/extensions/src/khr-mesh-quantization/index.ts index 4a18aed04..a8b9ad62d 100644 --- a/packages/extensions/src/khr-mesh-quantization/index.ts +++ b/packages/extensions/src/khr-mesh-quantization/index.ts @@ -1 +1 @@ -export * from './mesh-quantization'; +export * from './mesh-quantization.js'; diff --git a/packages/extensions/src/khr-mesh-quantization/mesh-quantization.ts b/packages/extensions/src/khr-mesh-quantization/mesh-quantization.ts index 3b944331a..efb777d53 100644 --- a/packages/extensions/src/khr-mesh-quantization/mesh-quantization.ts +++ b/packages/extensions/src/khr-mesh-quantization/mesh-quantization.ts @@ -1,5 +1,5 @@ import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core'; -import { KHR_MESH_QUANTIZATION } from '../constants'; +import { KHR_MESH_QUANTIZATION } from '../constants.js'; const NAME = KHR_MESH_QUANTIZATION; diff --git a/packages/extensions/src/khr-texture-basisu/index.ts b/packages/extensions/src/khr-texture-basisu/index.ts index 11ffff2e9..31b44595a 100644 --- a/packages/extensions/src/khr-texture-basisu/index.ts +++ b/packages/extensions/src/khr-texture-basisu/index.ts @@ -1 +1 @@ -export * from './texture-basisu'; +export * from './texture-basisu.js'; diff --git a/packages/extensions/src/khr-texture-basisu/texture-basisu.ts b/packages/extensions/src/khr-texture-basisu/texture-basisu.ts index df9cf3ccc..3fcd80309 100644 --- a/packages/extensions/src/khr-texture-basisu/texture-basisu.ts +++ b/packages/extensions/src/khr-texture-basisu/texture-basisu.ts @@ -8,7 +8,7 @@ import { WriterContext, vec2, } from '@gltf-transform/core'; -import { KHR_TEXTURE_BASISU } from '../constants'; +import { KHR_TEXTURE_BASISU } from '../constants.js'; const NAME = KHR_TEXTURE_BASISU; diff --git a/packages/extensions/src/khr-texture-transform/index.ts b/packages/extensions/src/khr-texture-transform/index.ts index 229d6fae9..c9eede15e 100644 --- a/packages/extensions/src/khr-texture-transform/index.ts +++ b/packages/extensions/src/khr-texture-transform/index.ts @@ -1,2 +1,2 @@ -export * from './texture-transform'; -export * from './transform'; +export * from './texture-transform.js'; +export * from './transform.js'; diff --git a/packages/extensions/src/khr-texture-transform/texture-transform.ts b/packages/extensions/src/khr-texture-transform/texture-transform.ts index 12f34dfc6..e473558b6 100644 --- a/packages/extensions/src/khr-texture-transform/texture-transform.ts +++ b/packages/extensions/src/khr-texture-transform/texture-transform.ts @@ -1,6 +1,6 @@ import { Extension, MathUtils, ReaderContext, WriterContext, vec2 } from '@gltf-transform/core'; -import { KHR_TEXTURE_TRANSFORM } from '../constants'; -import { Transform } from './transform'; +import { KHR_TEXTURE_TRANSFORM } from '../constants.js'; +import { Transform } from './transform.js'; const NAME = KHR_TEXTURE_TRANSFORM; diff --git a/packages/extensions/src/khr-texture-transform/transform.ts b/packages/extensions/src/khr-texture-transform/transform.ts index 0c7d01cd9..f7ece3f86 100644 --- a/packages/extensions/src/khr-texture-transform/transform.ts +++ b/packages/extensions/src/khr-texture-transform/transform.ts @@ -1,6 +1,6 @@ import { ExtensionProperty, IProperty, Nullable, vec2 } from '@gltf-transform/core'; import { PropertyType } from '@gltf-transform/core'; -import { KHR_TEXTURE_TRANSFORM } from '../constants'; +import { KHR_TEXTURE_TRANSFORM } from '../constants.js'; interface ITransform extends IProperty { offset: vec2; diff --git a/packages/extensions/src/khr-xmp-json-ld/index.ts b/packages/extensions/src/khr-xmp-json-ld/index.ts index d55342e72..c2830a046 100644 --- a/packages/extensions/src/khr-xmp-json-ld/index.ts +++ b/packages/extensions/src/khr-xmp-json-ld/index.ts @@ -1,2 +1,2 @@ -export * from './packet'; -export * from './xmp'; +export * from './packet.js'; +export * from './xmp.js'; diff --git a/packages/extensions/src/khr-xmp-json-ld/packet.ts b/packages/extensions/src/khr-xmp-json-ld/packet.ts index 4cdec1df4..449c0a0c4 100644 --- a/packages/extensions/src/khr-xmp-json-ld/packet.ts +++ b/packages/extensions/src/khr-xmp-json-ld/packet.ts @@ -1,5 +1,5 @@ import { Nullable, PropertyType, ExtensionProperty, IProperty } from '@gltf-transform/core'; -import { KHR_XMP_JSON_LD } from '../constants'; +import { KHR_XMP_JSON_LD } from '../constants.js'; type Term = string; type TermDefinition = string | Record; diff --git a/packages/extensions/src/khr-xmp-json-ld/xmp.ts b/packages/extensions/src/khr-xmp-json-ld/xmp.ts index 9b57ca24a..5bbd06801 100644 --- a/packages/extensions/src/khr-xmp-json-ld/xmp.ts +++ b/packages/extensions/src/khr-xmp-json-ld/xmp.ts @@ -11,8 +11,8 @@ import { Texture, WriterContext, } from '@gltf-transform/core'; -import { KHR_XMP_JSON_LD } from '../constants'; -import { Packet } from './packet'; +import { KHR_XMP_JSON_LD } from '../constants.js'; +import { Packet } from './packet.js'; const NAME = KHR_XMP_JSON_LD; diff --git a/packages/functions/package.json b/packages/functions/package.json index d9260fd6f..5427828aa 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -9,7 +9,7 @@ "type": "module", "sideEffects": false, "exports": { - "types": "./dist/functions.d.ts", + "types": "./dist/index.d.ts", "require": "./dist/functions.cjs", "default": "./dist/functions.modern.js" }, diff --git a/packages/functions/src/center.ts b/packages/functions/src/center.ts index 4d5862333..6d3e83971 100644 --- a/packages/functions/src/center.ts +++ b/packages/functions/src/center.ts @@ -1,6 +1,6 @@ import type { Document, Transform, vec3 } from '@gltf-transform/core'; import { getBounds } from '@gltf-transform/core'; -import { createTransform } from './utils'; +import { createTransform } from './utils.js'; const NAME = 'center'; diff --git a/packages/functions/src/clear-node-parent.ts b/packages/functions/src/clear-node-parent.ts index 3a2a4beeb..24406d52f 100644 --- a/packages/functions/src/clear-node-parent.ts +++ b/packages/functions/src/clear-node-parent.ts @@ -1,5 +1,5 @@ import { Node, Scene } from '@gltf-transform/core'; -import { getNodeScene } from './get-node-scene'; +import { getNodeScene } from './get-node-scene.js'; /** * Clears the parent of the given {@link Node}, leaving it attached diff --git a/packages/functions/src/clear-node-transform.ts b/packages/functions/src/clear-node-transform.ts index 832ae3ffe..7ea7bd2d7 100644 --- a/packages/functions/src/clear-node-transform.ts +++ b/packages/functions/src/clear-node-transform.ts @@ -1,6 +1,6 @@ import { mat4, MathUtils, Node } from '@gltf-transform/core'; import { multiply as multiplyMat4 } from 'gl-matrix/mat4'; -import { transformMesh } from './transform-mesh'; +import { transformMesh } from './transform-mesh.js'; // prettier-ignore const IDENTITY: mat4 = [ diff --git a/packages/functions/src/colorspace.ts b/packages/functions/src/colorspace.ts index 57c6bfb99..368e39dc3 100644 --- a/packages/functions/src/colorspace.ts +++ b/packages/functions/src/colorspace.ts @@ -1,5 +1,5 @@ import type { Accessor, Document, Primitive, Transform, vec3 } from '@gltf-transform/core'; -import { createTransform } from './utils'; +import { createTransform } from './utils.js'; const NAME = 'colorspace'; diff --git a/packages/functions/src/dedup.ts b/packages/functions/src/dedup.ts index 6c5f3bee9..021ff872f 100755 --- a/packages/functions/src/dedup.ts +++ b/packages/functions/src/dedup.ts @@ -12,7 +12,7 @@ import { Texture, Transform, } from '@gltf-transform/core'; -import { createTransform } from './utils'; +import { createTransform } from './utils.js'; const NAME = 'dedup'; diff --git a/packages/functions/src/dequantize.ts b/packages/functions/src/dequantize.ts index 1702966bc..e4466443e 100644 --- a/packages/functions/src/dequantize.ts +++ b/packages/functions/src/dequantize.ts @@ -1,6 +1,6 @@ import type { Accessor, Document, Primitive, Transform } from '@gltf-transform/core'; import { KHRMeshQuantization } from '@gltf-transform/extensions'; -import { createTransform } from './utils'; +import { createTransform } from './utils.js'; const NAME = 'dequantize'; diff --git a/packages/functions/src/draco.ts b/packages/functions/src/draco.ts index 9a869f060..c04443fff 100644 --- a/packages/functions/src/draco.ts +++ b/packages/functions/src/draco.ts @@ -1,6 +1,6 @@ import type { Document, Transform } from '@gltf-transform/core'; import { KHRDracoMeshCompression } from '@gltf-transform/extensions'; -import { createTransform } from './utils'; +import { createTransform } from './utils.js'; const NAME = 'draco'; diff --git a/packages/functions/src/flatten.ts b/packages/functions/src/flatten.ts index 0067392e8..07e6e25c2 100644 --- a/packages/functions/src/flatten.ts +++ b/packages/functions/src/flatten.ts @@ -1,7 +1,7 @@ import { Document, Node, PropertyType, Transform } from '@gltf-transform/core'; -import { clearNodeParent } from './clear-node-parent'; -import { prune } from './prune'; -import { createTransform } from './utils'; +import { clearNodeParent } from './clear-node-parent.js'; +import { prune } from './prune.js'; +import { createTransform } from './utils.js'; const NAME = 'flatten'; diff --git a/packages/functions/src/index.ts b/packages/functions/src/index.ts index ad1eaf479..d4554df7a 100644 --- a/packages/functions/src/index.ts +++ b/packages/functions/src/index.ts @@ -50,41 +50,41 @@ * @module functions */ -export * from './center'; -export * from './clear-node-parent'; -export * from './clear-node-transform'; -export * from './colorspace'; -export * from './dedup'; -export * from './dequantize'; -export * from './draco'; -export * from './flatten'; -export * from './get-node-scene'; -export * from './inspect'; -export * from './instance'; -export * from './join-primitives'; -export * from './join'; -export * from './meshopt'; -export * from './metal-rough'; -export * from './normals'; -export * from './partition'; -export * from './prune'; -export * from './quantize'; -export * from './resample'; -export * from './reorder'; -export * from './sequence'; -export * from './simplify'; -export * from './sort-primitive-weights'; -export * from './sparse'; -export * from './texture-compress'; -export * from './tangents'; -export * from './texture-resize'; -export * from './transform-mesh'; -export * from './transform-primitive'; -export * from './unlit'; -export * from './unpartition'; -export { getGLPrimitiveCount, isTransformPending, createTransform } from './utils'; -export * from './unweld'; -export * from './weld'; -export * from './list-texture-channels'; -export * from './list-texture-info'; -export * from './list-texture-slots'; +export * from './center.js'; +export * from './clear-node-parent.js'; +export * from './clear-node-transform.js'; +export * from './colorspace.js'; +export * from './dedup.js'; +export * from './dequantize.js'; +export * from './draco.js'; +export * from './flatten.js'; +export * from './get-node-scene.js'; +export * from './inspect.js'; +export * from './instance.js'; +export * from './join-primitives.js'; +export * from './join.js'; +export * from './meshopt.js'; +export * from './metal-rough.js'; +export * from './normals.js'; +export * from './partition.js'; +export * from './prune.js'; +export * from './quantize.js'; +export * from './resample.js'; +export * from './reorder.js'; +export * from './sequence.js'; +export * from './simplify.js'; +export * from './sort-primitive-weights.js'; +export * from './sparse.js'; +export * from './texture-compress.js'; +export * from './tangents.js'; +export * from './texture-resize.js'; +export * from './transform-mesh.js'; +export * from './transform-primitive.js'; +export * from './unlit.js'; +export * from './unpartition.js'; +export { getGLPrimitiveCount, isTransformPending, createTransform } from './utils.js'; +export * from './unweld.js'; +export * from './weld.js'; +export * from './list-texture-channels.js'; +export * from './list-texture-info.js'; +export * from './list-texture-slots.js'; diff --git a/packages/functions/src/inspect.ts b/packages/functions/src/inspect.ts index e9f947e40..ce4bd888b 100644 --- a/packages/functions/src/inspect.ts +++ b/packages/functions/src/inspect.ts @@ -8,7 +8,7 @@ import { getBounds, PropertyType, } from '@gltf-transform/core'; -import { getGLPrimitiveCount } from './utils'; +import { getGLPrimitiveCount } from './utils.js'; import { KHR_DF_MODEL_ETC1S, KHR_DF_MODEL_UASTC, read as readKTX } from 'ktx-parse'; /** Inspects the contents of a glTF file and returns a JSON report. */ diff --git a/packages/functions/src/instance.ts b/packages/functions/src/instance.ts index 0318250ba..40c94d5ec 100644 --- a/packages/functions/src/instance.ts +++ b/packages/functions/src/instance.ts @@ -1,6 +1,6 @@ import { Document, ILogger, MathUtils, Mesh, Node, Transform, vec3, vec4 } from '@gltf-transform/core'; import { InstancedMesh, EXTMeshGPUInstancing } from '@gltf-transform/extensions'; -import { createTransform } from './utils'; +import { createTransform } from './utils.js'; const NAME = 'instance'; diff --git a/packages/functions/src/join-primitives.ts b/packages/functions/src/join-primitives.ts index afb90079a..08603c080 100644 --- a/packages/functions/src/join-primitives.ts +++ b/packages/functions/src/join-primitives.ts @@ -1,5 +1,5 @@ import { Document, Primitive, ComponentTypeToTypedArray } from '@gltf-transform/core'; -import { createIndices, createPrimGroupKey } from './utils'; +import { createIndices, createPrimGroupKey } from './utils.js'; interface JoinPrimitiveOptions { skipValidation?: boolean; diff --git a/packages/functions/src/join.ts b/packages/functions/src/join.ts index 9597110e4..ae3840f0c 100644 --- a/packages/functions/src/join.ts +++ b/packages/functions/src/join.ts @@ -10,10 +10,10 @@ import { Transform, } from '@gltf-transform/core'; import { invert, multiply } from 'gl-matrix/mat4'; -import { joinPrimitives } from './join-primitives'; -import { prune } from './prune'; -import { transformPrimitive } from './transform-primitive'; -import { createPrimGroupKey, createTransform, formatLong, isUsed } from './utils'; +import { joinPrimitives } from './join-primitives.js'; +import { prune } from './prune.js'; +import { transformPrimitive } from './transform-primitive.js'; +import { createPrimGroupKey, createTransform, formatLong, isUsed } from './utils.js'; const NAME = 'join'; diff --git a/packages/functions/src/meshopt.ts b/packages/functions/src/meshopt.ts index b8b9bda91..f672c98fc 100644 --- a/packages/functions/src/meshopt.ts +++ b/packages/functions/src/meshopt.ts @@ -1,9 +1,9 @@ import type { Document, Transform } from '@gltf-transform/core'; import { EXTMeshoptCompression } from '@gltf-transform/extensions'; import type { MeshoptEncoder } from 'meshoptimizer'; -import { reorder } from './reorder'; -import { quantize } from './quantize'; -import { createTransform } from './utils'; +import { reorder } from './reorder.js'; +import { quantize } from './quantize.js'; +import { createTransform } from './utils.js'; export interface MeshoptOptions { encoder: unknown; diff --git a/packages/functions/src/metal-rough.ts b/packages/functions/src/metal-rough.ts index cf4e26523..c500a0d4c 100644 --- a/packages/functions/src/metal-rough.ts +++ b/packages/functions/src/metal-rough.ts @@ -5,7 +5,7 @@ import { KHRMaterialsSpecular, PBRSpecularGlossiness, } from '@gltf-transform/extensions'; -import { createTransform, rewriteTexture } from './utils'; +import { createTransform, rewriteTexture } from './utils.js'; const NAME = 'metalRough'; diff --git a/packages/functions/src/normals.ts b/packages/functions/src/normals.ts index 6e669b664..0342f1e15 100644 --- a/packages/functions/src/normals.ts +++ b/packages/functions/src/normals.ts @@ -1,6 +1,6 @@ import type { Document, Transform, vec3 } from '@gltf-transform/core'; -import { unweld } from './unweld'; -import { createTransform } from './utils'; +import { unweld } from './unweld.js'; +import { createTransform } from './utils.js'; import { normalize } from 'gl-matrix/vec3'; const NAME = 'normals'; diff --git a/packages/functions/src/partition.ts b/packages/functions/src/partition.ts index ee16108df..20340300a 100755 --- a/packages/functions/src/partition.ts +++ b/packages/functions/src/partition.ts @@ -1,6 +1,6 @@ import { Document, ILogger, PropertyType, Transform } from '@gltf-transform/core'; -import { prune } from './prune'; -import { createTransform } from './utils'; +import { prune } from './prune.js'; +import { createTransform } from './utils.js'; const NAME = 'partition'; diff --git a/packages/functions/src/prune.ts b/packages/functions/src/prune.ts index 5afb97d3e..1144f6d4b 100644 --- a/packages/functions/src/prune.ts +++ b/packages/functions/src/prune.ts @@ -15,7 +15,7 @@ import { Texture, TextureInfo, } from '@gltf-transform/core'; -import { createTransform } from './utils'; +import { createTransform } from './utils.js'; const NAME = 'prune'; diff --git a/packages/functions/src/quantize.ts b/packages/functions/src/quantize.ts index 0c27f76e1..0e7c33f9d 100644 --- a/packages/functions/src/quantize.ts +++ b/packages/functions/src/quantize.ts @@ -16,14 +16,14 @@ import { vec3, vec4, } from '@gltf-transform/core'; -import { dedup } from './dedup'; +import { dedup } from './dedup.js'; import { fromRotationTranslationScale, fromScaling, invert, multiply as multiplyMat4 } from 'gl-matrix/mat4'; import { max, min, scale, transformMat4 } from 'gl-matrix/vec3'; import { KHRMeshQuantization } from '@gltf-transform/extensions'; import type { Volume } from '@gltf-transform/extensions'; -import { prune } from './prune'; -import { createTransform } from './utils'; -import { sortPrimitiveWeights } from './sort-primitive-weights'; +import { prune } from './prune.js'; +import { createTransform } from './utils.js'; +import { sortPrimitiveWeights } from './sort-primitive-weights.js'; const NAME = 'quantize'; diff --git a/packages/functions/src/reorder.ts b/packages/functions/src/reorder.ts index e1e37e24a..ba8adb359 100644 --- a/packages/functions/src/reorder.ts +++ b/packages/functions/src/reorder.ts @@ -1,6 +1,6 @@ import { Accessor, Document, GLTF, Primitive, PropertyType, Transform } from '@gltf-transform/core'; -import { prune } from './prune'; -import { createTransform, deepListAttributes, remapAttribute, SetMap } from './utils'; +import { prune } from './prune.js'; +import { createTransform, deepListAttributes, remapAttribute, SetMap } from './utils.js'; import type { MeshoptEncoder } from 'meshoptimizer'; const NAME = 'reorder'; diff --git a/packages/functions/src/resample.ts b/packages/functions/src/resample.ts index 9e49efcee..962b33745 100644 --- a/packages/functions/src/resample.ts +++ b/packages/functions/src/resample.ts @@ -10,8 +10,8 @@ import { TransformContext, } from '@gltf-transform/core'; import quat, { getAngle, slerp } from 'gl-matrix/quat'; -import { dedup } from './dedup'; -import { createTransform, isTransformPending } from './utils'; +import { dedup } from './dedup.js'; +import { createTransform, isTransformPending } from './utils.js'; const NAME = 'resample'; diff --git a/packages/functions/src/sequence.ts b/packages/functions/src/sequence.ts index 2a653f344..358a38cff 100644 --- a/packages/functions/src/sequence.ts +++ b/packages/functions/src/sequence.ts @@ -1,5 +1,5 @@ import { Accessor, AnimationChannel, AnimationSampler, Document, Transform } from '@gltf-transform/core'; -import { createTransform } from './utils'; +import { createTransform } from './utils.js'; const NAME = 'sequence'; diff --git a/packages/functions/src/simplify.ts b/packages/functions/src/simplify.ts index 7e88cd6f4..ef5cf2f44 100644 --- a/packages/functions/src/simplify.ts +++ b/packages/functions/src/simplify.ts @@ -6,10 +6,10 @@ import { remapAttribute, deepSwapAttribute, isTransformPending, -} from './utils'; -import { weld } from './weld'; +} from './utils.js'; +import { weld } from './weld.js'; import type { MeshoptSimplifier } from 'meshoptimizer'; -import { dedup } from './dedup'; +import { dedup } from './dedup.js'; const NAME = 'simplify'; diff --git a/packages/functions/src/sparse.ts b/packages/functions/src/sparse.ts index fc14053d8..8848e5911 100644 --- a/packages/functions/src/sparse.ts +++ b/packages/functions/src/sparse.ts @@ -1,5 +1,5 @@ import { Document, MathUtils, Transform } from '@gltf-transform/core'; -import { createTransform } from './utils'; +import { createTransform } from './utils.js'; const NAME = 'sparse'; diff --git a/packages/functions/src/tangents.ts b/packages/functions/src/tangents.ts index 4d0aababa..48ba4b9b4 100644 --- a/packages/functions/src/tangents.ts +++ b/packages/functions/src/tangents.ts @@ -1,5 +1,5 @@ import { Accessor, Document, ILogger, Primitive, Transform, TypedArray, uuid } from '@gltf-transform/core'; -import { createTransform } from './utils'; +import { createTransform } from './utils.js'; const NAME = 'tangents'; diff --git a/packages/functions/src/texture-compress.ts b/packages/functions/src/texture-compress.ts index 7a9cb16df..4206e0429 100644 --- a/packages/functions/src/texture-compress.ts +++ b/packages/functions/src/texture-compress.ts @@ -1,10 +1,10 @@ import { BufferUtils, Document, ImageUtils, Texture, TextureChannel, Transform, vec2 } from '@gltf-transform/core'; import { EXTTextureAVIF, EXTTextureWebP } from '@gltf-transform/extensions'; -import { getTextureChannelMask } from './list-texture-channels'; -import { listTextureSlots } from './list-texture-slots'; +import { getTextureChannelMask } from './list-texture-channels.js'; +import { listTextureSlots } from './list-texture-slots.js'; import type sharp from 'sharp'; -import { createTransform, formatBytes } from './utils'; -import { TextureResizeFilter } from './texture-resize'; +import { createTransform, formatBytes } from './utils.js'; +import { TextureResizeFilter } from './texture-resize.js'; const NAME = 'textureCompress'; diff --git a/packages/functions/src/texture-resize.ts b/packages/functions/src/texture-resize.ts index 5f26d0b0a..ec1cf03c2 100644 --- a/packages/functions/src/texture-resize.ts +++ b/packages/functions/src/texture-resize.ts @@ -2,8 +2,8 @@ import ndarray from 'ndarray'; import { lanczos2, lanczos3 } from 'ndarray-lanczos'; import { getPixels, savePixels } from 'ndarray-pixels'; import type { Document, Transform, vec2 } from '@gltf-transform/core'; -import { listTextureSlots } from './list-texture-slots'; -import { createTransform } from './utils'; +import { listTextureSlots } from './list-texture-slots.js'; +import { createTransform } from './utils.js'; const NAME = 'textureResize'; diff --git a/packages/functions/src/transform-mesh.ts b/packages/functions/src/transform-mesh.ts index f8bc83fd0..1a3dc4dee 100644 --- a/packages/functions/src/transform-mesh.ts +++ b/packages/functions/src/transform-mesh.ts @@ -1,6 +1,6 @@ import { mat4, Accessor, Primitive, Mesh, PropertyType, PrimitiveTarget } from '@gltf-transform/core'; -import { transformPrimitive } from './transform-primitive'; -import { deepListAttributes } from './utils'; +import { transformPrimitive } from './transform-primitive.js'; +import { deepListAttributes } from './utils.js'; /** * Applies a transform matrix to every {@link Primitive} in the given {@link Mesh}. diff --git a/packages/functions/src/transform-primitive.ts b/packages/functions/src/transform-primitive.ts index 121fcaeb1..9cf92ec12 100644 --- a/packages/functions/src/transform-primitive.ts +++ b/packages/functions/src/transform-primitive.ts @@ -2,7 +2,7 @@ import type { vec3, vec4, mat4, Accessor, Primitive } from '@gltf-transform/core import { create as createMat3, fromMat4, invert, transpose } from 'gl-matrix/mat3'; import { create as createVec3, normalize as normalizeVec3, transformMat3, transformMat4 } from 'gl-matrix/vec3'; import { create as createVec4 } from 'gl-matrix/vec4'; -import { createIndices } from './utils'; +import { createIndices } from './utils.js'; /** * Applies a transform matrix to a {@link Primitive}. diff --git a/packages/functions/src/unpartition.ts b/packages/functions/src/unpartition.ts index 33bdeef1a..e727331db 100644 --- a/packages/functions/src/unpartition.ts +++ b/packages/functions/src/unpartition.ts @@ -1,5 +1,5 @@ import type { Document, Transform } from '@gltf-transform/core'; -import { createTransform } from './utils'; +import { createTransform } from './utils.js'; const NAME = 'unpartition'; diff --git a/packages/functions/src/unweld.ts b/packages/functions/src/unweld.ts index 5b4b6b91d..b332ee562 100644 --- a/packages/functions/src/unweld.ts +++ b/packages/functions/src/unweld.ts @@ -1,6 +1,6 @@ import type { Accessor, Document, ILogger, Transform, TypedArray } from '@gltf-transform/core'; -import { createTransform, formatDeltaOp } from './utils'; +import { createTransform, formatDeltaOp } from './utils.js'; const NAME = 'unweld'; diff --git a/packages/functions/src/weld.ts b/packages/functions/src/weld.ts index deac27764..3214c8890 100644 --- a/packages/functions/src/weld.ts +++ b/packages/functions/src/weld.ts @@ -9,8 +9,8 @@ import { TypedArray, vec3, } from '@gltf-transform/core'; -import { dedup } from './dedup'; -import { createIndices, createTransform, formatDeltaOp, isTransformPending } from './utils'; +import { dedup } from './dedup.js'; +import { createIndices, createTransform, formatDeltaOp, isTransformPending } from './utils.js'; const NAME = 'weld'; diff --git a/tsconfig.json b/tsconfig.json index 523f62cdd..321fb552b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,7 @@ "@gltf-transform/test-utils": ["./packages/test-utils/"] }, "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "nodenext", "lib": ["es2020", "dom"], "target": "es2020", "module": "ESNext",