Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 27 additions & 21 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"organizeImports": { "enabled": true },
"$schema": "https://biomejs.dev/schemas/2.4.12/schema.json",
"assist": { "actions": { "source": { "organizeImports": "on" } } },
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignore": ["dist", "node_modules", ".turbo", "coverage", "research", ".scratch"]
"includes": [
"**",
"!**/dist",
"!**/node_modules",
"!**/.turbo",
"!**/coverage",
"!**/research",
"!**/.scratch"
]
},
"linter": {
"enabled": true,
Expand All @@ -17,17 +25,7 @@
"useImportType": "error",
"useNodejsImportProtocol": "error",
"useConst": "error",
"noNonNullAssertion": "error"
},
"correctness": {
"noUnusedImports": "error",
"noUnusedVariables": "error"
},
"suspicious": {
"noConsoleLog": "error",
"noExplicitAny": "error"
},
"nursery": {
"noNonNullAssertion": "error",
"noRestrictedImports": {
"level": "error",
"options": {
Expand All @@ -41,7 +39,16 @@
}
}
}
}
},
"correctness": {
"noUnusedImports": "error",
"noUnusedVariables": "error"
},
"suspicious": {
"noExplicitAny": "error",
"noConsole": "error"
},
"nursery": {}
}
},
"formatter": {
Expand All @@ -60,17 +67,16 @@
},
"overrides": [
{
"include": ["**/test/**", "**/*.test.ts", "**/scripts/**", "examples/**"],
"includes": ["**/test/**", "**/*.test.ts", "**/scripts/**", "**/examples/**"],
"linter": {
"rules": {
"nursery": {
"noRestrictedImports": "off"
},
"nursery": {},
"suspicious": {
"noConsoleLog": "off"
"noConsole": "off"
},
"style": {
"noNonNullAssertion": "off"
"noNonNullAssertion": "off",
"noRestrictedImports": "off"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"release": "changeset publish"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@biomejs/biome": "^2.4.12",
"@changesets/cli": "^2.27.11",
"turbo": "^2.3.3",
"typescript": "^5.7.3"
Expand Down
6 changes: 5 additions & 1 deletion packages/passmint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
"default": "./dist/index.js"
}
},
"files": ["dist", "LICENSE", "README.md"],
"files": [
"dist",
"LICENSE",
"README.md"
],
"sideEffects": false,
"scripts": {
"build": "tsdown",
Expand Down
4 changes: 2 additions & 2 deletions packages/passmint/src/apple/render.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { PassmintRenderError } from '../errors'
import type { Barcode } from '../schema/barcodes'
import type { Field } from '../schema/fields'
import type { ImageSource, ImageTriple, Images } from '../schema/images'
import { defaultValue, translations } from '../schema/localization'
import type { ImageSource, Images, ImageTriple } from '../schema/images'
import type { LocalizedString } from '../schema/localization'
import { defaultValue, translations } from '../schema/localization'
import type { PassInput } from '../schema/pass'
import { encodeStringsFile } from './strings'

Expand Down
12 changes: 6 additions & 6 deletions packages/passmint/src/cms/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export { pemToDer } from './pem'
export type { PemDecodeOptions } from './pem'
export {
sortSetOfByBytes,
encodeLength,
buildSetOf,
encodeLength,
sortSetOfByBytes,
toArrayBuffer,
} from './der'
export { SigningMaterial } from './material'
export type {
SigningMaterialFromPemInput,
SigningMaterialFromParsedInput,
SigningMaterialFromPemInput,
} from './material'
export { SigningMaterial } from './material'
export type { PemDecodeOptions } from './pem'
export { pemToDer } from './pem'
export { signManifest } from './sign'
12 changes: 6 additions & 6 deletions packages/passmint/src/cms/sign.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import {
Attribute,
CMSVersion,
CertificateChoices,
CertificateSet,
CMSVersion,
ContentInfo,
DigestAlgorithmIdentifier,
DigestAlgorithmIdentifiers,
EncapsulatedContentInfo,
IssuerAndSerialNumber,
SignatureAlgorithmIdentifier,
SignedData,
SignerIdentifier,
SignerInfo,
SignerInfos,
id_contentType,
id_data,
id_messageDigest,
id_signedData,
id_signingTime,
SignatureAlgorithmIdentifier,
SignedData,
SignerIdentifier,
SignerInfo,
SignerInfos,
} from '@peculiar/asn1-cms'
import {
AsnConvert,
Expand Down
10 changes: 5 additions & 5 deletions packages/passmint/src/google/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export { GoogleSigningMaterial } from './material'
export type { GoogleSaveJwtClaims, GoogleSavePayload } from './jwt'
export { base64url, base64urlJson, signSaveJwt } from './jwt'
export type {
GoogleSigningMaterialFromServiceAccountInput,
GoogleSigningMaterialFromParsedInput,
GoogleSigningMaterialFromServiceAccountInput,
} from './material'
export { signSaveJwt, base64url, base64urlJson } from './jwt'
export type { GoogleSaveJwtClaims, GoogleSavePayload } from './jwt'
export { renderGooglePayload } from './render'
export { GoogleSigningMaterial } from './material'
export type { GoogleRenderOptions } from './render'
export { renderGooglePayload } from './render'
export { buildSaveLink } from './save-link'
2 changes: 1 addition & 1 deletion packages/passmint/src/google/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { PassmintGoogleError, PassmintRenderError } from '../errors'
import type { Barcode } from '../schema/barcodes'
import type { Field } from '../schema/fields'
import type { ImageSource } from '../schema/images'
import { defaultValue, translations } from '../schema/localization'
import type { LocalizedString } from '../schema/localization'
import { defaultValue, translations } from '../schema/localization'
import type { Location } from '../schema/locations'
import type { PassInput } from '../schema/pass'
import type { GoogleSavePayload } from './jwt'
Expand Down
117 changes: 56 additions & 61 deletions packages/passmint/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,85 +1,80 @@
export const VERSION: string = '0.0.0'

export type { ManifestResult } from './apple/manifest'
export { buildManifest } from './apple/manifest'
// --- Low-level Apple pipeline (for advanced use cases) ---
export { assemblePkpass } from './apple/pkpass'
export type { AppleRenderedPass } from './apple/render'
export { renderApplePass } from './apple/render'
export { encodeStringsFile, encodeUtf16BeWithBom } from './apple/strings'
export type {
SigningMaterialFromParsedInput,
SigningMaterialFromPemInput,
} from './cms'
// --- CMS signing (Apple .pkpass) ---
export { SigningMaterial, signManifest } from './cms'
export { MAX_PEM_LENGTH } from './cms/pem'
export type {
GoogleErrorCode,
PackagingErrorCode,
RenderErrorCode,
SchemaErrorCode,
SigningErrorCode,
} from './errors'
// --- Errors ---
export {
PassmintError,
PassmintSchemaError,
PassmintGoogleError,
PassmintPackagingError,
PassmintRenderError,
PassmintSchemaError,
PassmintSigningError,
PassmintPackagingError,
PassmintGoogleError,
} from './errors'
export type {
SchemaErrorCode,
RenderErrorCode,
SigningErrorCode,
PackagingErrorCode,
GoogleErrorCode,
} from './errors'

// --- The main facade ---
export { Pass, PassBuilder, SignedPass, DEFAULT_GOOGLE_JWT_EXPIRY_SECONDS } from './pass'
export type { GoogleSaveOptions } from './pass'

GoogleRenderOptions,
GoogleSaveJwtClaims,
GoogleSavePayload,
GoogleSigningMaterialFromParsedInput,
GoogleSigningMaterialFromServiceAccountInput,
} from './google'
// --- Google Wallet (JWT save-link) ---
export {
GoogleSigningMaterial,
signSaveJwt,
renderGooglePayload,
buildSaveLink,
base64url,
base64urlJson,
buildSaveLink,
GoogleSigningMaterial,
renderGooglePayload,
signSaveJwt,
} from './google'
export type {
GoogleSigningMaterialFromServiceAccountInput,
GoogleSigningMaterialFromParsedInput,
GoogleSaveJwtClaims,
GoogleSavePayload,
GoogleRenderOptions,
} from './google'

// --- CMS signing (Apple .pkpass) ---
export { SigningMaterial, signManifest } from './cms'
export type {
SigningMaterialFromPemInput,
SigningMaterialFromParsedInput,
} from './cms'
export { MAX_PEM_LENGTH } from './cms/pem'

// --- Low-level Apple pipeline (for advanced use cases) ---
export { assemblePkpass } from './apple/pkpass'
export { renderApplePass } from './apple/render'
export type { AppleRenderedPass } from './apple/render'
export { buildManifest } from './apple/manifest'
export type { ManifestResult } from './apple/manifest'
export { encodeStringsFile, encodeUtf16BeWithBom } from './apple/strings'
export { ZipAssembler } from './zip/assembler'

// --- Schema + validation ---
export { parsePassInput, PassInputSchema } from './schema/index'
export type { GoogleSaveOptions } from './pass'
// --- The main facade ---
export { DEFAULT_GOOGLE_JWT_EXPIRY_SECONDS, Pass, PassBuilder, SignedPass } from './pass'
export { MAX_IMAGE_BYTE_LENGTH } from './schema/images'
export type {
PassInput,
PassStyle,
Barcode,
BarcodeFormat,
Beacon,
BoardingPassInput,
EventTicketInput,
StoreCardInput,
Color,
CouponInput,
DataDetector,
DateTimeStyle,
EventTicketInput,
Field,
FieldValue,
GenericPassInput,
LocalizedString,
Color,
ImageSource,
ImageTriple,
Images,
Barcode,
BarcodeFormat,
Field,
FieldValue,
TextAlignment,
DateTimeStyle,
NumberStyle,
DataDetector,
ImageTriple,
LocalizedString,
Location,
Beacon,
NumberStyle,
PassInput,
PassStyle,
SemanticTags,
StoreCardInput,
TextAlignment,
} from './schema/index'
// --- Schema + validation ---
export { PassInputSchema, parsePassInput } from './schema/index'
export { ZipAssembler } from './zip/assembler'
35 changes: 17 additions & 18 deletions packages/passmint/src/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,29 @@ import * as v from 'valibot'
import { PassmintSchemaError } from '../errors'
import { type PassInput, PassInputSchema } from './pass'

export { PassInputSchema } from './pass'
export type {
PassInput,
PassStyle,
BoardingPassInput,
EventTicketInput,
StoreCardInput,
CouponInput,
GenericPassInput,
} from './pass'

export type { LocalizedString } from './localization'
export type { Color } from './colors'
export type { ImageSource, ImageTriple, Images } from './images'
export type { Barcode, BarcodeFormat } from './barcodes'
export type { Color } from './colors'
export type {
DataDetector,
DateTimeStyle,
Field,
FieldValue,
TextAlignment,
DateTimeStyle,
NumberStyle,
DataDetector,
TextAlignment,
} from './fields'
export type { Location, Beacon } from './locations'
export type { ImageSource, Images, ImageTriple } from './images'
export type { LocalizedString } from './localization'
export type { Beacon, Location } from './locations'
export type {
BoardingPassInput,
CouponInput,
EventTicketInput,
GenericPassInput,
PassInput,
PassStyle,
StoreCardInput,
} from './pass'
export { PassInputSchema } from './pass'
export type { SemanticTags } from './semantic-tags'

/**
Expand Down
Loading