Skip to content

Commit

Permalink
Copy missing types.ts from NPM script and bump version.
Browse files Browse the repository at this point in the history
This is a workaround for microbundle / rollup-plugin-typescript2:
* developit/microbundle#1084

Also update tsconfig.json moduleResolution to NodeNext:
* recommended setup for microbundle
  • Loading branch information
eternal-turtles committed Jul 18, 2024
1 parent 04d4bcf commit 535ed91
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mightylittle/transaction-log",
"type": "module",
"version": "0.1.0",
"version": "0.2.0",
"description": "In-memory, non-threadsafe replayable logs.",
"homepage": "https://github.com/mightylittle/transaction-log",
"source": "src/index.ts",
Expand All @@ -18,7 +18,7 @@
],
"scripts": {
"clean": "rm -rf dist/",
"build": "npm run clean && microbundle",
"build": "npm run clean && microbundle && cp src/types.ts dist/types.d.ts",
"start": "npm run clean && microbundle watch",
"test": "npm run build && mocha",
"typedoc": "typedoc src/index.ts"
Expand Down
15 changes: 7 additions & 8 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type Commit = {
* Array of transaction IDs included in the commit.
*/
transactions: number[];
};
}

/**
* @remarks
Expand All @@ -40,7 +40,7 @@ export type CommitInfo<T> = {
* Array of transactions included in the commit.
*/
transactions: Transaction<T>[];
};
}

/**
* @remarks
Expand All @@ -57,7 +57,7 @@ export type Transaction<T> = {
* Application-specific data.
*/
data: T;
};
}

/**
* @remarks
Expand Down Expand Up @@ -87,7 +87,7 @@ export interface SimpleTransactionLogCallbacks<T> {
* Application data to write to the transaction-log.
*/
onappend?: (data: T) => void;
};
}

/**
* @remarks
Expand Down Expand Up @@ -123,7 +123,7 @@ export interface BatchedTransactionLogCallbacks<T> extends SimpleTransactionLogC
* Callback called after committing buffered transactions.
*/
oncommit?: (commit: Commit) => void;
};
}

/**
* @remarks
Expand Down Expand Up @@ -188,7 +188,7 @@ export interface SimpleTransactionLog<T> {
* Sequence identifier of the final transaction-entry to include in results (inclusive).
*/
getSeqRangeTransactions(startId: number, finishId?: number): Promise<Transaction<T>[]>;
};
}

/**
* @remarks
Expand Down Expand Up @@ -277,5 +277,4 @@ export interface BatchedTransactionLog<T> {
* Sequence identifier of the final transaction-entry to include in results (inclusive).
*/
getSeqRangeTransactions(startId: number, finishId?: number): Promise<Transaction<T>[]>;
};

}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"moduleResolution": "NodeNext",
"rootDir": "./src",
"declaration": true,
"declarationDir": "./dist",
Expand Down

0 comments on commit 535ed91

Please sign in to comment.