Skip to content

Commit ddb657f

Browse files
authored
Use .ts extensions and type so node type stripping will work (#602)
2 parents f303270 + 3517911 commit ddb657f

68 files changed

Lines changed: 461 additions & 1256 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

__tests__/batchJobs.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { jest } from "@jest/globals";
22

3-
import { Task, TaskList, WorkerSharedOptions } from "../src/interfaces";
4-
import { runTaskListOnce } from "../src/main";
3+
import { Task, TaskList, WorkerSharedOptions } from "../src/interfaces.ts";
4+
import { runTaskListOnce } from "../src/main.ts";
55
import {
66
ESCAPED_GRAPHILE_WORKER_SCHEMA,
77
getJobQueues,
88
getJobs,
99
reset,
1010
withPgClient,
11-
} from "./helpers";
11+
} from "./helpers.ts";
1212

1313
const options: WorkerSharedOptions = {};
1414

__tests__/cron-timing.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { run } from "../src";
1+
import { run } from "../src/index.ts";
22
import {
33
EventMonitor,
44
getJobs,
@@ -9,7 +9,7 @@ import {
99
setupFakeTimers,
1010
sleep,
1111
withOptions,
12-
} from "./helpers";
12+
} from "./helpers.ts";
1313

1414
const { setTime } = setupFakeTimers();
1515
const REFERENCE_TIMESTAMP = 1609459200000; /* 1st January 2021, 00:00:00 UTC */

__tests__/cron.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { run } from "../src";
1+
import { run } from "../src/index.ts";
22
import {
33
ESCAPED_GRAPHILE_WORKER_SCHEMA,
44
EventMonitor,
55
getJobs,
66
getKnown,
77
reset,
88
withOptions,
9-
} from "./helpers";
9+
} from "./helpers.ts";
1010

1111
const CRONTAB_DO_IT = `
1212
0 */4 * * * do_it ?fill=1d

__tests__/cronMatcher.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createCronMatcher } from "../src/cronMatcher";
1+
import { createCronMatcher } from "../src/cronMatcher.ts";
22

33
describe("matches datetime", () => {
44
const makeMatcher = (pattern: string) => createCronMatcher(pattern, "test");

__tests__/crontab.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { CronItemOptions, ParsedCronMatch } from "../src";
2-
import { parseCronItem, parseCrontab } from "../src/crontab";
1+
import { parseCronItem, parseCrontab } from "../src/crontab.ts";
2+
import { CronItemOptions, ParsedCronMatch } from "../src/index.ts";
33

44
// 0...59
55
const ALL_MINUTES = Array.from(Array(60).keys());

__tests__/events.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ import { jest } from "@jest/globals";
22
import { EventEmitter } from "events";
33
import type { Pool } from "pg";
44

5-
import { run, Runner } from "../src";
6-
import deferred, { Deferred } from "../src/deferred";
7-
import { Task, TaskList, WorkerSharedOptions } from "../src/interfaces";
5+
import deferred, { Deferred } from "../src/deferred.ts";
6+
import { run, Runner } from "../src/index.ts";
7+
import { Task, TaskList, WorkerSharedOptions } from "../src/interfaces.ts";
88
import {
99
ESCAPED_GRAPHILE_WORKER_SCHEMA,
1010
expectJobCount,
1111
reset,
1212
sleep,
1313
sleepUntil,
1414
withPgPool,
15-
} from "./helpers";
15+
} from "./helpers.ts";
1616

1717
const EVENTS = [
1818
"pool:create",

__tests__/fixtures/tasks/wouldyoulike.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { rand } = require("../blah");
1+
const { rand } = require("../blah.js");
22
module.exports = (_payload, helpers) => {
33
helpers.logger.debug(rand());
44
return "some sausages";

__tests__/fixtures/tasks/wouldyoulike_ts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3-
const blah_1 = require("../blah");
3+
const blah_1 = require("../blah.js");
44
exports.default = (_payload, helpers) => {
55
helpers.logger.debug((0, blah_1.rand)());
66
return "some TS sausages";

__tests__/forbiddenFlags.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import {
66
Task,
77
TaskList,
88
WorkerSharedOptions,
9-
} from "../src/index";
10-
import { getJobs, reset, withPgClient, withPgPool } from "./helpers";
9+
} from "../src/index.ts";
10+
import { getJobs, reset, withPgClient, withPgPool } from "./helpers.ts";
1111

1212
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
1313

__tests__/getTasks.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
import { getTasks } from "../src/getTasks.ts";
2+
import { makeJobHelpers, makeWithPgClientFromClient } from "../src/helpers.ts";
13
import {
24
CompiledSharedOptions,
35
WatchedTaskList,
46
WorkerSharedOptions,
5-
} from "../src";
6-
import { getTasks } from "../src/getTasks";
7-
import { makeJobHelpers, makeWithPgClientFromClient } from "../src/helpers";
8-
import { makeEnhancedWithPgClient } from "../src/lib";
9-
import { makeMockJob, withPgClient } from "./helpers";
7+
} from "../src/index.ts";
8+
import { makeEnhancedWithPgClient } from "../src/lib.ts";
9+
import { makeMockJob, withPgClient } from "./helpers.ts";
1010

1111
const options: WorkerSharedOptions = {};
1212

0 commit comments

Comments
 (0)