diff --git a/src/Bundle.ts b/src/Bundle.ts index b6dc33f..ec5ecca 100644 --- a/src/Bundle.ts +++ b/src/Bundle.ts @@ -1,7 +1,7 @@ import { Readable, Stream } from "node:stream"; -import * as Messages from "./messages"; -import { toArray as zipToArray } from "do-not-zip"; import { Buffer } from "node:buffer"; +import { toArray as zipToArray } from "do-not-zip"; +import * as Messages from "./messages.js"; export const filesSymbol = Symbol("bundleFiles"); export const freezeSymbol = Symbol("bundleFreeze"); diff --git a/src/FieldsArray.ts b/src/FieldsArray.ts index c4c635c..84f169d 100644 --- a/src/FieldsArray.ts +++ b/src/FieldsArray.ts @@ -1,7 +1,7 @@ -import type PKPass from "./PKPass"; -import * as Schemas from "./schemas"; -import * as Utils from "./utils"; -import * as Messages from "./messages"; +import type PKPass from "./PKPass.js"; +import * as Schemas from "./schemas/index.js"; +import * as Utils from "./utils.js"; +import * as Messages from "./messages.js"; /** * Class to represent lower-level keys pass fields diff --git a/src/PKPass.ts b/src/PKPass.ts index 9a7e57a..3e5e1b5 100644 --- a/src/PKPass.ts +++ b/src/PKPass.ts @@ -1,14 +1,14 @@ import { Stream } from "node:stream"; import { Buffer } from "node:buffer"; import path from "node:path"; -import FieldsArray from "./FieldsArray"; -import Bundle, { filesSymbol } from "./Bundle"; -import getModelFolderContents from "./getModelFolderContents"; -import * as Schemas from "./schemas"; -import * as Signature from "./Signature"; -import * as Strings from "./StringsUtils"; -import * as Utils from "./utils"; -import * as Messages from "./messages"; +import FieldsArray from "./FieldsArray.js"; +import Bundle, { filesSymbol } from "./Bundle.js"; +import getModelFolderContents from "./getModelFolderContents.js"; +import * as Schemas from "./schemas/index.js"; +import * as Signature from "./Signature.js"; +import * as Strings from "./StringsUtils.js"; +import * as Utils from "./utils.js"; +import * as Messages from "./messages.js"; const propsSymbol = Symbol("props"); const localizationSymbol = Symbol("pass.l10n"); diff --git a/src/Signature.ts b/src/Signature.ts index 7d17cf6..3f3d703 100644 --- a/src/Signature.ts +++ b/src/Signature.ts @@ -1,5 +1,5 @@ import forge from "node-forge"; -import type * as Schemas from "./schemas"; +import type * as Schemas from "./schemas/index.js"; import { Buffer } from "node:buffer"; /** diff --git a/src/getModelFolderContents.ts b/src/getModelFolderContents.ts index 1867a51..8c45c05 100644 --- a/src/getModelFolderContents.ts +++ b/src/getModelFolderContents.ts @@ -1,8 +1,8 @@ import * as path from "node:path"; -import * as Utils from "./utils"; -import * as Messages from "./messages"; import { promises as fs } from "node:fs"; import type { Buffer } from "node:buffer"; +import * as Utils from "./utils.js"; +import * as Messages from "./messages.js"; /** * Reads the model folder contents diff --git a/src/index.ts b/src/index.ts index 2eaee24..7f62b66 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -export { default as PKPass } from "./PKPass"; +export { default as PKPass } from "./PKPass.js"; // ***************************************** // // *** Exporting only schemas interfaces *** // @@ -15,4 +15,4 @@ export type { TransitType, Personalize, OverridablePassProps, -} from "./schemas"; +} from "./schemas/index.js"; diff --git a/src/schemas/Field.ts b/src/schemas/Field.ts index 28a9bf2..3387a90 100644 --- a/src/schemas/Field.ts +++ b/src/schemas/Field.ts @@ -1,5 +1,5 @@ import Joi from "joi"; -import { Semantics } from "./Semantics"; +import { Semantics } from "./Semantics.js"; export type PKDataDetectorType = | "PKDataDetectorTypePhoneNumber" diff --git a/src/schemas/PassFields.ts b/src/schemas/PassFields.ts index a148e4c..331441c 100644 --- a/src/schemas/PassFields.ts +++ b/src/schemas/PassFields.ts @@ -1,5 +1,5 @@ import Joi from "joi"; -import { Field, FieldWithRow } from "./Field"; +import { Field, FieldWithRow } from "./Field.js"; export type TransitType = | "PKTransitTypeAir" diff --git a/src/schemas/SemanticTagType.ts b/src/schemas/SemanticTagType.ts index 0eda385..60050a2 100644 --- a/src/schemas/SemanticTagType.ts +++ b/src/schemas/SemanticTagType.ts @@ -1,5 +1,5 @@ import Joi from "joi"; -import { RGB_HEX_COLOR_REGEX } from "./regexps"; +import { RGB_HEX_COLOR_REGEX } from "./regexps.js"; /** * These couple of structures are organized alphabetically, diff --git a/src/schemas/Semantics.ts b/src/schemas/Semantics.ts index 458f96b..a30d592 100644 --- a/src/schemas/Semantics.ts +++ b/src/schemas/Semantics.ts @@ -1,5 +1,5 @@ import Joi from "joi"; -import * as SemanticTagType from "./SemanticTagType"; +import * as SemanticTagType from "./SemanticTagType.js"; /** * For a better description of every single field, diff --git a/src/schemas/index.ts b/src/schemas/index.ts index 90320ee..4b21743 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -1,26 +1,26 @@ -export * from "./Barcode"; -export * from "./Beacon"; -export * from "./Location"; -export * from "./Field"; -export * from "./NFC"; -export * from "./Semantics"; -export * from "./PassFields"; -export * from "./Personalize"; -export * from "./Certificates"; +export * from "./Barcode.js"; +export * from "./Beacon.js"; +export * from "./Location.js"; +export * from "./Field.js"; +export * from "./NFC.js"; +export * from "./Semantics.js"; +export * from "./PassFields.js"; +export * from "./Personalize.js"; +export * from "./Certificates.js"; import Joi from "joi"; import type { Buffer } from "node:buffer"; -import { Barcode } from "./Barcode"; -import { Location } from "./Location"; -import { Beacon } from "./Beacon"; -import { NFC } from "./NFC"; -import { PassFields, TransitType } from "./PassFields"; -import { Semantics } from "./Semantics"; -import { CertificatesSchema } from "./Certificates"; +import { Barcode } from "./Barcode.js"; +import { Location } from "./Location.js"; +import { Beacon } from "./Beacon.js"; +import { NFC } from "./NFC.js"; +import { PassFields, TransitType } from "./PassFields.js"; +import { Semantics } from "./Semantics.js"; +import { CertificatesSchema } from "./Certificates.js"; -import * as Messages from "../messages"; -import { RGB_HEX_COLOR_REGEX, URL_REGEX } from "./regexps"; +import * as Messages from "../messages.js"; +import { RGB_HEX_COLOR_REGEX, URL_REGEX } from "./regexps.js"; export type PreferredStyleSchemes = ("posterEventTicket" | "eventTicket")[]; diff --git a/src/utils.ts b/src/utils.ts index 25aae57..f7ba228 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,5 @@ -import * as Messages from "./messages"; -import type Bundle from "./Bundle"; +import * as Messages from "./messages.js"; +import type Bundle from "./Bundle.js"; /** * Converts a date to W3C / UTC string