Skip to content

Commit 884ee16

Browse files
committed
package up like a library
1 parent f2f97ff commit 884ee16

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@
55
"@cloudflare/workers-types": "^3.11.0",
66
"typescript": "^4.7.3"
77
},
8+
"module": "./dist/index.js",
9+
"types": "./dist/index.d.ts",
10+
"scripts": {
11+
"build": "tsc"
12+
},
813
"private": true
914
}

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PointInTime, TM_DurableObject, TM_DO_class, TM_Env, Task, TaskManager, taskId } from './types'
1+
import { PointInTime, TM_DurableObject, TM_DO_class, TM_Env, Task, TaskManager, taskId, SingleTask, RecurringTask } from './types'
22
import { TaskContext } from './context'
33

44
export class TaskManagerImpl implements TaskManager {
@@ -105,4 +105,4 @@ export function withTaskManager<T extends TM_Env>(do_class: TM_DO_class<T>): TM_
105105
return proxy
106106
}
107107

108-
export type { Task, TaskManager, TM_DurableObject }
108+
export type { PointInTime, SingleTask, Task, taskId, TaskManager, TM_DurableObject, RecurringTask }

tsconfig.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"include": ["src/**/*"],
23
"compilerOptions": {
34
/* Visit https://aka.ms/tsconfig.json to read more about this file */
45

@@ -46,14 +47,14 @@
4647
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
4748

4849
/* Emit */
49-
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
50+
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
5051
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
5152
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
5253
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
5354
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
54-
// "outDir": "./", /* Specify an output folder for all emitted files. */
55+
"outDir": "./dist", /* Specify an output folder for all emitted files. */
5556
// "removeComments": true, /* Disable emitting comments. */
56-
"noEmit": true /* Disable emitting files from a compilation. */,
57+
// "noEmit": true /* Disable emitting files from a compilation. */,
5758
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
5859
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
5960
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */

0 commit comments

Comments
 (0)