@amazon/vinyl-transmux 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1150 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.js +1130 -0
- package/dist/index.js.map +7 -0
- package/dist/types/current/aac/adts.d.ts +38 -0
- package/dist/types/current/aac/adts.d.ts.map +1 -0
- package/dist/types/current/aac/adts.js +63 -0
- package/dist/types/current/index.d.ts +7 -0
- package/dist/types/current/index.d.ts.map +1 -0
- package/dist/types/current/index.js +6 -0
- package/dist/types/current/mp4/mp4.d.ts +70 -0
- package/dist/types/current/mp4/mp4.d.ts.map +1 -0
- package/dist/types/current/mp4/mp4.js +338 -0
- package/dist/types/current/mpegts/mpegts.d.ts +68 -0
- package/dist/types/current/mpegts/mpegts.d.ts.map +1 -0
- package/dist/types/current/mpegts/mpegts.js +202 -0
- package/dist/types/current/transmux/sampleEntry.d.ts +25 -0
- package/dist/types/current/transmux/sampleEntry.d.ts.map +1 -0
- package/dist/types/current/transmux/sampleEntry.js +114 -0
- package/dist/types/current/transmux/transmux.d.ts +17 -0
- package/dist/types/current/transmux/transmux.d.ts.map +1 -0
- package/dist/types/current/transmux/transmux.js +568 -0
- package/dist/types/current/tsconfig.tsbuildinfo +1 -0
- package/dist/types/ts3.7/aac/adts.d.ts +38 -0
- package/dist/types/ts3.7/index.d.ts +7 -0
- package/dist/types/ts3.7/mp4/mp4.d.ts +70 -0
- package/dist/types/ts3.7/mpegts/mpegts.d.ts +68 -0
- package/dist/types/ts3.7/transmux/sampleEntry.d.ts +25 -0
- package/dist/types/ts3.7/transmux/transmux.d.ts +17 -0
- package/dist/types/ts4.1/aac/adts.d.ts +38 -0
- package/dist/types/ts4.1/index.d.ts +7 -0
- package/dist/types/ts4.1/mp4/mp4.d.ts +70 -0
- package/dist/types/ts4.1/mpegts/mpegts.d.ts +68 -0
- package/dist/types/ts4.1/transmux/sampleEntry.d.ts +25 -0
- package/dist/types/ts4.1/transmux/transmux.d.ts +17 -0
- package/dist/types/ts4.7/aac/adts.d.ts +38 -0
- package/dist/types/ts4.7/index.d.ts +7 -0
- package/dist/types/ts4.7/mp4/mp4.d.ts +70 -0
- package/dist/types/ts4.7/mpegts/mpegts.d.ts +68 -0
- package/dist/types/ts4.7/transmux/sampleEntry.d.ts +25 -0
- package/dist/types/ts4.7/transmux/transmux.d.ts +17 -0
- package/docs/TRANSMUX.md +131 -0
- package/package.json +82 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADTS (Audio Data Transport Stream) frame parser for AAC.
|
|
3
|
+
*
|
|
4
|
+
* ADTS is the framing format used to carry AAC audio in MPEG-TS and raw .aac
|
|
5
|
+
* files. Each frame starts with a 7-byte (or 9-byte with CRC) sync header
|
|
6
|
+
* containing the audio object type, sample rate, and channel configuration
|
|
7
|
+
* needed to construct the MP4 AudioSpecificConfig.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
export interface AdtsFrame {
|
|
12
|
+
/** Offset of this frame within the source buffer. */
|
|
13
|
+
readonly offset: number;
|
|
14
|
+
/** Total frame size including header. */
|
|
15
|
+
readonly frameLength: number;
|
|
16
|
+
/** Size of the ADTS header (7 or 9 bytes). */
|
|
17
|
+
readonly headerSize: number;
|
|
18
|
+
/** AAC audio object type (1 = AAC-LC, 2 = HE-AAC, etc.). */
|
|
19
|
+
readonly audioObjectType: number;
|
|
20
|
+
/** Sampling frequency index (0-12). */
|
|
21
|
+
readonly samplingFrequencyIndex: number;
|
|
22
|
+
/** Channel configuration (1 = mono, 2 = stereo, etc.). */
|
|
23
|
+
readonly channelConfiguration: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns the sample rate in Hz for a given sampling frequency index.
|
|
27
|
+
*/
|
|
28
|
+
export declare function adtsSampleRate(index: number): number;
|
|
29
|
+
/**
|
|
30
|
+
* Parses all ADTS frames from a buffer of raw AAC data.
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseAdtsFrames(data: Uint8Array): AdtsFrame[];
|
|
33
|
+
/**
|
|
34
|
+
* Builds the AudioSpecificConfig (2 bytes) for an AAC-LC stream.
|
|
35
|
+
* This is required in the MP4 esds box.
|
|
36
|
+
*/
|
|
37
|
+
export declare function buildAudioSpecificConfig(frame: AdtsFrame): Uint8Array;
|
|
38
|
+
//# sourceMappingURL=adts.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** 90 kHz timescale from ISO 13818-1 (MPEG system clock). */
|
|
2
|
+
export declare const MPEG_TIMESCALE = 90000;
|
|
3
|
+
/**
|
|
4
|
+
* Writes a generic MP4 box (atom). The size field is automatically computed.
|
|
5
|
+
*/
|
|
6
|
+
export declare function box(type: string, ...payloads: Uint8Array[]): Uint8Array;
|
|
7
|
+
/**
|
|
8
|
+
* Writes a full box with version and flags.
|
|
9
|
+
*/
|
|
10
|
+
export declare function fullBox(type: string, version: number, flags: number, payload: Uint8Array): Uint8Array;
|
|
11
|
+
export interface FtypOptions {
|
|
12
|
+
readonly majorBrand?: string;
|
|
13
|
+
readonly minorVersion?: number;
|
|
14
|
+
readonly compatibleBrands?: readonly string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Generates the ftyp box.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ftyp(options?: FtypOptions): Uint8Array;
|
|
20
|
+
/**
|
|
21
|
+
* Generates a moov box from pre-built track boxes.
|
|
22
|
+
*/
|
|
23
|
+
export declare function moov(...traks: Uint8Array[]): Uint8Array;
|
|
24
|
+
export interface MvhdOptions {
|
|
25
|
+
readonly timescale?: number;
|
|
26
|
+
readonly duration?: number;
|
|
27
|
+
readonly rate?: number;
|
|
28
|
+
readonly volume?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface AudioTrackOptions {
|
|
31
|
+
readonly trackId: number;
|
|
32
|
+
readonly sampleRate: number;
|
|
33
|
+
readonly channelCount: number;
|
|
34
|
+
readonly sampleEntry: Uint8Array;
|
|
35
|
+
}
|
|
36
|
+
export interface VideoTrackOptions {
|
|
37
|
+
readonly trackId: number;
|
|
38
|
+
readonly width: number;
|
|
39
|
+
readonly height: number;
|
|
40
|
+
readonly timescale?: number;
|
|
41
|
+
readonly sampleEntry: Uint8Array;
|
|
42
|
+
}
|
|
43
|
+
export declare function audioTrak(options: AudioTrackOptions): Uint8Array;
|
|
44
|
+
export declare function videoTrak(options: VideoTrackOptions): Uint8Array;
|
|
45
|
+
export interface MoofOptions {
|
|
46
|
+
readonly sequenceNumber: number;
|
|
47
|
+
readonly trackId: number;
|
|
48
|
+
readonly baseDecodeTime: number;
|
|
49
|
+
readonly samples: readonly SampleEntry[];
|
|
50
|
+
}
|
|
51
|
+
export interface SampleEntry {
|
|
52
|
+
readonly duration: number;
|
|
53
|
+
readonly size: number;
|
|
54
|
+
readonly flags?: number;
|
|
55
|
+
readonly compositionTimeOffset?: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Generates a moof (movie fragment) box.
|
|
59
|
+
*/
|
|
60
|
+
export declare function moof(options: MoofOptions): Uint8Array;
|
|
61
|
+
/**
|
|
62
|
+
* Generates an mdat box wrapping raw media data.
|
|
63
|
+
*/
|
|
64
|
+
export declare function mdat(data: Uint8Array): Uint8Array;
|
|
65
|
+
/**
|
|
66
|
+
* Patches the trun data_offset field. The data_offset is the byte offset from
|
|
67
|
+
* the start of the moof to the first byte of the mdat payload.
|
|
68
|
+
*/
|
|
69
|
+
export declare function patchDataOffset(moofData: Uint8Array, moofSize: number): void;
|
|
70
|
+
//# sourceMappingURL=mp4.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MPEG-TS constants and packet-level parsing.
|
|
3
|
+
*
|
|
4
|
+
* An MPEG Transport Stream consists of fixed 188-byte packets. Each packet
|
|
5
|
+
* starts with a sync byte (0x47) and carries a 13-bit PID identifying the
|
|
6
|
+
* elementary stream. The PAT (PID 0) maps program numbers to PMT PIDs, and
|
|
7
|
+
* the PMT lists the elementary stream PIDs with their stream types.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
export declare const TS_PACKET_SIZE = 188;
|
|
12
|
+
export declare const TS_SYNC_BYTE = 71;
|
|
13
|
+
/** Well-known stream type identifiers from ISO/IEC 13818-1. */
|
|
14
|
+
export declare const STREAM_TYPE_AAC = 15;
|
|
15
|
+
export declare const STREAM_TYPE_H264 = 27;
|
|
16
|
+
export declare const STREAM_TYPE_H265 = 36;
|
|
17
|
+
export declare const STREAM_TYPE_ID3 = 21;
|
|
18
|
+
export interface TsPacketHeader {
|
|
19
|
+
readonly pid: number;
|
|
20
|
+
readonly payloadUnitStartIndicator: boolean;
|
|
21
|
+
readonly adaptationFieldControl: number;
|
|
22
|
+
readonly continuityCounter: number;
|
|
23
|
+
}
|
|
24
|
+
export interface PmtEntry {
|
|
25
|
+
readonly pid: number;
|
|
26
|
+
readonly streamType: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Parses a single 188-byte TS packet header.
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseTsPacketHeader(data: Uint8Array, offset: number): TsPacketHeader;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the offset of the payload within a TS packet.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getPayloadOffset(data: Uint8Array, offset: number, adaptationFieldControl: number): number;
|
|
36
|
+
/**
|
|
37
|
+
* Parses the PAT (Program Association Table) to find the PMT PID.
|
|
38
|
+
*/
|
|
39
|
+
export declare function parsePat(data: Uint8Array, offset: number): number;
|
|
40
|
+
/**
|
|
41
|
+
* Parses the PMT (Program Map Table) to extract elementary stream entries.
|
|
42
|
+
*/
|
|
43
|
+
export declare function parsePmt(data: Uint8Array, offset: number): PmtEntry[];
|
|
44
|
+
export interface DemuxedStream {
|
|
45
|
+
readonly streamType: number;
|
|
46
|
+
readonly pid: number;
|
|
47
|
+
readonly data: Uint8Array[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Demuxes a complete MPEG-TS segment into elementary streams.
|
|
51
|
+
* Reassembles PES packets from TS packets for each PID.
|
|
52
|
+
*/
|
|
53
|
+
export declare function demuxTsSegment(segment: Uint8Array): DemuxedStream[];
|
|
54
|
+
/**
|
|
55
|
+
* Concatenates an array of Uint8Arrays into a single Uint8Array.
|
|
56
|
+
*/
|
|
57
|
+
export declare function concatBuffers(buffers: Uint8Array[]): Uint8Array;
|
|
58
|
+
/**
|
|
59
|
+
* Strips the PES header from raw PES packet data, returning the elementary
|
|
60
|
+
* stream payload.
|
|
61
|
+
*/
|
|
62
|
+
export declare function stripPesHeader(pesData: Uint8Array): Uint8Array;
|
|
63
|
+
/**
|
|
64
|
+
* Extracts the PTS (Presentation Time Stamp) from a PES header.
|
|
65
|
+
* Returns the PTS in 90kHz clock ticks, or -1 if not present.
|
|
66
|
+
*/
|
|
67
|
+
export declare function parsePesPts(pesData: Uint8Array): number;
|
|
68
|
+
//# sourceMappingURL=mpegts.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface AudioTrackConfig {
|
|
2
|
+
readonly audioObjectType: number;
|
|
3
|
+
readonly samplingFrequencyIndex: number;
|
|
4
|
+
readonly channelConfiguration: number;
|
|
5
|
+
readonly sampleRate: number;
|
|
6
|
+
readonly audioSpecificConfig: Uint8Array;
|
|
7
|
+
}
|
|
8
|
+
export interface VideoTrackConfig {
|
|
9
|
+
readonly width: number;
|
|
10
|
+
readonly height: number;
|
|
11
|
+
readonly sps: Uint8Array;
|
|
12
|
+
readonly pps: Uint8Array;
|
|
13
|
+
readonly profileIdc: number;
|
|
14
|
+
readonly profileCompatibility: number;
|
|
15
|
+
readonly levelIdc: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Builds an mp4a sample entry box for AAC audio.
|
|
19
|
+
*/
|
|
20
|
+
export declare function mp4aSampleEntry(config: AudioTrackConfig): Uint8Array;
|
|
21
|
+
/**
|
|
22
|
+
* Builds an avc1 sample entry box for H.264 video.
|
|
23
|
+
*/
|
|
24
|
+
export declare function avc1SampleEntry(config: VideoTrackConfig): Uint8Array;
|
|
25
|
+
//# sourceMappingURL=sampleEntry.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface TransmuxResult {
|
|
2
|
+
/** The initialization segment (ftyp + moov). Always present. */
|
|
3
|
+
readonly initSegment: ArrayBuffer;
|
|
4
|
+
/** The media segment (moof + mdat). */
|
|
5
|
+
readonly mediaSegment: ArrayBuffer;
|
|
6
|
+
/** Duration of this segment in seconds. */
|
|
7
|
+
readonly duration: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates a stateful transmuxer instance. Call `transmux()` for each HLS
|
|
11
|
+
* segment in order. The init segment is always returned (cached after first
|
|
12
|
+
* call).
|
|
13
|
+
*/
|
|
14
|
+
export declare function createTransmuxer(): {
|
|
15
|
+
transmux: (data: ArrayBuffer) => TransmuxResult;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=transmux.d.ts.map
|
package/docs/TRANSMUX.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Transmux
|
|
2
|
+
|
|
3
|
+
Converts MPEG-TS and raw ADTS segments into fragmented MP4 (fMP4) for playback
|
|
4
|
+
via Media Source Extensions. Zero external dependencies.
|
|
5
|
+
|
|
6
|
+
## Architecture
|
|
7
|
+
|
|
8
|
+
The package is split into three layers:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
┌─────────────────────────────────────────────┐
|
|
12
|
+
│ transmux Stateful transmuxer │
|
|
13
|
+
│ (createTransmuxer) │
|
|
14
|
+
├─────────────────────────────────────────────┤
|
|
15
|
+
│ sampleEntry Codec-specific MP4 boxes │
|
|
16
|
+
│ (mp4a/esds, avc1/avcC) │
|
|
17
|
+
├──────────────────┬──────────────────────────┤
|
|
18
|
+
│ mp4 │ mpegts / adts │
|
|
19
|
+
│ Generic fMP4 │ Demux + parse │
|
|
20
|
+
│ box writer │ │
|
|
21
|
+
└──────────────────┴──────────────────────────┘
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- **mp4** — Generic ISO BMFF box writer. Produces `ftyp`, `moov`, `moof`,
|
|
25
|
+
`mdat`, and all structural sub-boxes. No codec knowledge. Configurable via
|
|
26
|
+
options with sensible defaults.
|
|
27
|
+
- **mpegts** — MPEG Transport Stream demuxer. Parses PAT/PMT, reassembles PES
|
|
28
|
+
packets, extracts PTS timestamps.
|
|
29
|
+
- **adts** — Audio Data Transport Stream parser. Extracts AAC frame boundaries,
|
|
30
|
+
sample rates, and channel configuration.
|
|
31
|
+
- **sampleEntry** — Codec-specific MP4 sample entry builders. Produces `mp4a` +
|
|
32
|
+
`esds` for AAC and `avc1` + `avcC` for H.264. This is the only layer with
|
|
33
|
+
codec knowledge.
|
|
34
|
+
- **transmux** — Stateful orchestrator. Detects the input format (MPEG-TS or raw
|
|
35
|
+
ADTS), demuxes, parses codec configuration, builds the fMP4 init and media
|
|
36
|
+
segments.
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { createTransmuxer } from '@amazon/vinyl-transmux'
|
|
42
|
+
|
|
43
|
+
const transmuxer = createTransmuxer()
|
|
44
|
+
|
|
45
|
+
// For each HLS segment (ArrayBuffer of MPEG-TS or ADTS data):
|
|
46
|
+
const result = transmuxer.transmux(segmentData)
|
|
47
|
+
|
|
48
|
+
// result.initSegment — ftyp + moov (always returned, cached after first call)
|
|
49
|
+
// result.mediaSegment — moof + mdat
|
|
50
|
+
// result.duration — segment duration in seconds
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The transmuxer is stateful — call `transmux()` for each segment in order. It
|
|
54
|
+
tracks decode timestamps, sequence numbers, and codec configuration across
|
|
55
|
+
calls. The init segment is generated on the first call and cached for subsequent
|
|
56
|
+
calls.
|
|
57
|
+
|
|
58
|
+
## Supported Formats
|
|
59
|
+
|
|
60
|
+
| Input | Output | Status |
|
|
61
|
+
| ------------------ | ------------------------------- | ------ |
|
|
62
|
+
| ADTS AAC | fMP4 audio (`mp4a`) | ✅ |
|
|
63
|
+
| MPEG-TS with AAC | fMP4 audio (`mp4a`) | ✅ |
|
|
64
|
+
| MPEG-TS with H.264 | fMP4 video (`avc1`) | ✅ |
|
|
65
|
+
| MPEG-TS muxed | fMP4 video + audio (multi-trak) | ✅ |
|
|
66
|
+
|
|
67
|
+
## MP4 Box Writer
|
|
68
|
+
|
|
69
|
+
The `mp4` module is a general-purpose fMP4 box writer, usable independently of
|
|
70
|
+
the transmuxer:
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import {
|
|
74
|
+
box,
|
|
75
|
+
fullBox,
|
|
76
|
+
ftyp,
|
|
77
|
+
moov,
|
|
78
|
+
audioTrak,
|
|
79
|
+
videoTrak,
|
|
80
|
+
moof,
|
|
81
|
+
mdat,
|
|
82
|
+
patchDataOffset,
|
|
83
|
+
} from '@amazon/vinyl-transmux'
|
|
84
|
+
|
|
85
|
+
// Custom ftyp
|
|
86
|
+
const ftypBox = ftyp({
|
|
87
|
+
majorBrand: 'dash',
|
|
88
|
+
compatibleBrands: ['iso6', 'mp41'],
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
// Build a moov with custom tracks
|
|
92
|
+
const moovBox = moov(
|
|
93
|
+
audioTrak({
|
|
94
|
+
trackId: 1,
|
|
95
|
+
sampleRate: 44100,
|
|
96
|
+
channelCount: 2,
|
|
97
|
+
sampleEntry: myAudioSampleEntry,
|
|
98
|
+
}),
|
|
99
|
+
videoTrak({
|
|
100
|
+
trackId: 2,
|
|
101
|
+
width: 1920,
|
|
102
|
+
height: 1080,
|
|
103
|
+
sampleEntry: myVideoSampleEntry,
|
|
104
|
+
})
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
// Build a media fragment
|
|
108
|
+
const moofBox = moof({
|
|
109
|
+
sequenceNumber: 1,
|
|
110
|
+
trackId: 1,
|
|
111
|
+
baseDecodeTime: 0,
|
|
112
|
+
samples: [
|
|
113
|
+
{ duration: 1024, size: 400 },
|
|
114
|
+
{ duration: 1024, size: 380 },
|
|
115
|
+
],
|
|
116
|
+
})
|
|
117
|
+
patchDataOffset(moofBox, moofBox.byteLength)
|
|
118
|
+
const mdatBox = mdat(rawMediaData)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## ID3 Tags
|
|
122
|
+
|
|
123
|
+
Leading ID3v2 tags (common in HLS for timed metadata) are automatically skipped
|
|
124
|
+
before format detection.
|
|
125
|
+
|
|
126
|
+
## H.264 SPS Parsing
|
|
127
|
+
|
|
128
|
+
The transmuxer includes a minimal H.264 SPS parser that extracts resolution and
|
|
129
|
+
profile information from Sequence Parameter Set NAL units. It supports Baseline,
|
|
130
|
+
Main, and High profiles including the chroma format and scaling matrix
|
|
131
|
+
extensions.
|
package/package.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@amazon/vinyl-transmux",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MPEG-TS to fMP4 transmuxer for browser and Node.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/amazonmusic/vinyl.git"
|
|
8
|
+
},
|
|
9
|
+
"license": "UNLICENSED",
|
|
10
|
+
"module": "./dist/index.js",
|
|
11
|
+
"main": "./dist/index.cjs",
|
|
12
|
+
"types": "./dist/types/ts3.7/index.d.ts",
|
|
13
|
+
"type": "module",
|
|
14
|
+
"sideEffects": [
|
|
15
|
+
"**/polyfill/**",
|
|
16
|
+
"test/**/*"
|
|
17
|
+
],
|
|
18
|
+
"files": [
|
|
19
|
+
"dist/*",
|
|
20
|
+
"docs/*"
|
|
21
|
+
],
|
|
22
|
+
"typesVersions": {
|
|
23
|
+
">=5.4": {
|
|
24
|
+
"*": [
|
|
25
|
+
"./dist/types/current/index.d.ts"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
">=4.7": {
|
|
29
|
+
"*": [
|
|
30
|
+
"./dist/types/ts4.7/index.d.ts"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
">=4.1": {
|
|
34
|
+
"*": [
|
|
35
|
+
"./dist/types/ts4.1/index.d.ts"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
">=3.7": {
|
|
39
|
+
"*": [
|
|
40
|
+
"./dist/types/ts3.7/index.d.ts"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"exports": {
|
|
45
|
+
".": {
|
|
46
|
+
"types@>=5.4": "./dist/types/current/index.d.ts",
|
|
47
|
+
"types@>=4.7": "./dist/types/ts4.7/index.d.ts",
|
|
48
|
+
"require": "./dist/index.cjs",
|
|
49
|
+
"import": "./dist/index.js"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"analyzeExports": "tsx buildSrc/analyzeExports.ts",
|
|
54
|
+
"analyzeExports:write": "tsx buildSrc/analyzeExports.ts --write",
|
|
55
|
+
"clean": "rimraf --glob dist .eslintcache \"**/*.tsbuildinfo\"",
|
|
56
|
+
"indexFiles:check": "tsx buildSrc/writeIndexFiles.ts --check",
|
|
57
|
+
"indexFiles:write": "tsx buildSrc/writeIndexFiles.ts",
|
|
58
|
+
"build": "tsx buildSrc/build.ts",
|
|
59
|
+
"build:release": "tsx buildSrc/build.ts --release",
|
|
60
|
+
"prettier:check": "prettier . --ignore-path ../../.prettierignore --cache --check",
|
|
61
|
+
"prettier:write": "prettier . --ignore-path ../../.prettierignore --cache --write",
|
|
62
|
+
"eslint:check": "eslint . --cache --max-warnings=0",
|
|
63
|
+
"eslint:write": "eslint . --cache --fix",
|
|
64
|
+
"lint": "npm run indexFiles:check && npm run eslint:check && npm run prettier:check",
|
|
65
|
+
"lint:write": "npm run indexFiles:write && npm run eslint:write && npm run prettier:write",
|
|
66
|
+
"validate": "npm run lint && npm run test",
|
|
67
|
+
"test": "tsx --tsconfig ../../tsconfig.flat.json ../../node_modules/jasmine/bin/jasmine --config=test/unit/jasmine.config.json",
|
|
68
|
+
"test:coverage": "c8 npm run test",
|
|
69
|
+
"watch": "tsx buildSrc/build.ts --watch",
|
|
70
|
+
"watch:release": "tsx buildSrc/build.ts --watch --release"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@amazon/vinyl-build-utils": "^1.0.0",
|
|
74
|
+
"@amazon/vinyl-jasmine-wrapper": "^1.0.0"
|
|
75
|
+
},
|
|
76
|
+
"dependencies": {
|
|
77
|
+
"@amazon/vinyl-util": "^1.0.0"
|
|
78
|
+
},
|
|
79
|
+
"browserslist": [
|
|
80
|
+
"defaults, chrome 52, firefox 54, edge 15, safari 8"
|
|
81
|
+
]
|
|
82
|
+
}
|