@redmix/jobs 0.0.1
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/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/adapters/BaseAdapter/BaseAdapter.d.ts +64 -0
- package/dist/adapters/BaseAdapter/BaseAdapter.d.ts.map +1 -0
- package/dist/adapters/BaseAdapter/BaseAdapter.js +36 -0
- package/dist/adapters/PrismaAdapter/PrismaAdapter.d.ts +68 -0
- package/dist/adapters/PrismaAdapter/PrismaAdapter.d.ts.map +1 -0
- package/dist/adapters/PrismaAdapter/PrismaAdapter.js +189 -0
- package/dist/adapters/PrismaAdapter/errors.d.ts +8 -0
- package/dist/adapters/PrismaAdapter/errors.d.ts.map +1 -0
- package/dist/adapters/PrismaAdapter/errors.js +33 -0
- package/dist/bins/rw-jobs-worker.d.ts +13 -0
- package/dist/bins/rw-jobs-worker.d.ts.map +1 -0
- package/dist/bins/rw-jobs-worker.js +126 -0
- package/dist/bins/rw-jobs.d.ts +20 -0
- package/dist/bins/rw-jobs.d.ts.map +1 -0
- package/dist/bins/rw-jobs.js +248 -0
- package/dist/consts.d.ts +26 -0
- package/dist/consts.d.ts.map +1 -0
- package/dist/consts.js +81 -0
- package/dist/core/Executor.d.ts +29 -0
- package/dist/core/Executor.d.ts.map +1 -0
- package/dist/core/Executor.js +95 -0
- package/dist/core/JobManager.d.ts +20 -0
- package/dist/core/JobManager.d.ts.map +1 -0
- package/dist/core/JobManager.js +78 -0
- package/dist/core/Scheduler.d.ts +27 -0
- package/dist/core/Scheduler.d.ts.map +1 -0
- package/dist/core/Scheduler.js +91 -0
- package/dist/core/Worker.d.ts +49 -0
- package/dist/core/Worker.d.ts.map +1 -0
- package/dist/core/Worker.js +143 -0
- package/dist/errors.d.ts +104 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +156 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/loaders.d.ts +13 -0
- package/dist/loaders.d.ts.map +1 -0
- package/dist/loaders.js +71 -0
- package/dist/setupEnv.d.ts +2 -0
- package/dist/setupEnv.d.ts.map +1 -0
- package/dist/setupEnv.js +34 -0
- package/dist/types.d.ts +175 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +16 -0
- package/dist/util.d.ts +2 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +31 -0
- package/package.json +58 -0
package/dist/loaders.js
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __export = (target, all) => {
|
9
|
+
for (var name in all)
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
+
};
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
+
for (let key of __getOwnPropNames(from))
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
+
}
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
+
mod
|
27
|
+
));
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
+
var loaders_exports = {};
|
30
|
+
__export(loaders_exports, {
|
31
|
+
loadJob: () => loadJob,
|
32
|
+
loadJobsManager: () => loadJobsManager
|
33
|
+
});
|
34
|
+
module.exports = __toCommonJS(loaders_exports);
|
35
|
+
var import_node_fs = __toESM(require("node:fs"));
|
36
|
+
var import_node_path = __toESM(require("node:path"));
|
37
|
+
var import_project_config = require("@redmix/project-config");
|
38
|
+
var import_errors = require("./errors.js");
|
39
|
+
var import_util = require("./util.js");
|
40
|
+
const loadJobsManager = async () => {
|
41
|
+
const jobsConfigPath = (0, import_project_config.getPaths)().api.distJobsConfig;
|
42
|
+
if (!jobsConfigPath) {
|
43
|
+
throw new import_errors.JobsLibNotFoundError();
|
44
|
+
}
|
45
|
+
const importPath = (0, import_util.makeFilePath)(jobsConfigPath);
|
46
|
+
const { jobs } = await import(importPath);
|
47
|
+
if (!jobs) {
|
48
|
+
throw new import_errors.JobsLibNotFoundError();
|
49
|
+
}
|
50
|
+
return jobs;
|
51
|
+
};
|
52
|
+
const loadJob = async ({
|
53
|
+
name: jobName,
|
54
|
+
path: jobPath
|
55
|
+
}) => {
|
56
|
+
const completeJobPath = import_node_path.default.join((0, import_project_config.getPaths)().api.distJobs, jobPath) + ".js";
|
57
|
+
if (!import_node_fs.default.existsSync(completeJobPath)) {
|
58
|
+
throw new import_errors.JobNotFoundError(jobName);
|
59
|
+
}
|
60
|
+
const importPath = (0, import_util.makeFilePath)(completeJobPath);
|
61
|
+
const jobModule = await import(importPath);
|
62
|
+
if (!jobModule[jobName]) {
|
63
|
+
throw new import_errors.JobNotFoundError(jobName);
|
64
|
+
}
|
65
|
+
return jobModule[jobName];
|
66
|
+
};
|
67
|
+
// Annotate the CommonJS export names for ESM import in node:
|
68
|
+
0 && (module.exports = {
|
69
|
+
loadJob,
|
70
|
+
loadJobsManager
|
71
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"setupEnv.d.ts","sourceRoot":"","sources":["../src/setupEnv.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,YAQpB,CAAA"}
|
package/dist/setupEnv.js
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
7
|
+
for (var name in all)
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
+
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
+
var setupEnv_exports = {};
|
20
|
+
__export(setupEnv_exports, {
|
21
|
+
setupEnv: () => setupEnv
|
22
|
+
});
|
23
|
+
module.exports = __toCommonJS(setupEnv_exports);
|
24
|
+
var import_loadEnvFiles = require("@redmix/cli-helpers/loadEnvFiles");
|
25
|
+
const setupEnv = () => {
|
26
|
+
(0, import_loadEnvFiles.loadEnvFiles)();
|
27
|
+
if (process.env.NODE_ENV === void 0) {
|
28
|
+
process.env.NODE_ENV = "development";
|
29
|
+
}
|
30
|
+
};
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
32
|
+
0 && (module.exports = {
|
33
|
+
setupEnv
|
34
|
+
});
|
package/dist/types.d.ts
ADDED
@@ -0,0 +1,175 @@
|
|
1
|
+
import type { IntRange } from 'type-fest';
|
2
|
+
import type { BaseAdapter } from './adapters/BaseAdapter/BaseAdapter.js';
|
3
|
+
/** Redwood's logger and the standard console logger conform to this shape. */
|
4
|
+
export interface BasicLogger {
|
5
|
+
debug: (message?: any, ...optionalParams: any[]) => void;
|
6
|
+
info: (message?: any, ...optionalParams: any[]) => void;
|
7
|
+
warn: (message?: any, ...optionalParams: any[]) => void;
|
8
|
+
error: (message?: any, ...optionalParams: any[]) => void;
|
9
|
+
}
|
10
|
+
/**
|
11
|
+
*This is the minimum interface that a "job" must conform to in order to be
|
12
|
+
* scheduled and executed by Redwood's job engine.
|
13
|
+
*/
|
14
|
+
export interface BaseJob {
|
15
|
+
id: string | number;
|
16
|
+
name: string;
|
17
|
+
path: string;
|
18
|
+
args: unknown[];
|
19
|
+
attempts: number;
|
20
|
+
}
|
21
|
+
export type PossibleBaseJob = BaseJob | undefined;
|
22
|
+
export type Adapters = Record<string, BaseAdapter>;
|
23
|
+
export type QueueNames = readonly [string, ...string[]];
|
24
|
+
export interface WorkerConfig<TAdapters extends Adapters, TQueues extends QueueNames> extends WorkerSharedOptions {
|
25
|
+
/**
|
26
|
+
* The name of the adapter to use for this worker. This must be one of the keys
|
27
|
+
* in the `adapters` object when you created the `JobManager`.
|
28
|
+
*/
|
29
|
+
adapter: keyof TAdapters;
|
30
|
+
/**
|
31
|
+
* The queue or queues that this worker should work on. You can pass a single
|
32
|
+
* queue name, an array of queue names, or the string `'*'` to work on all
|
33
|
+
* queues.
|
34
|
+
*/
|
35
|
+
queue: '*' | TQueues[number] | TQueues[number][];
|
36
|
+
/**
|
37
|
+
* The number of workers to spawn for this worker configuration.
|
38
|
+
*
|
39
|
+
* @default 1
|
40
|
+
*/
|
41
|
+
count?: number;
|
42
|
+
/**
|
43
|
+
* The logger to use for this worker. If not provided, the logger from the
|
44
|
+
* `JobManager` will be used.
|
45
|
+
*/
|
46
|
+
logger?: BasicLogger;
|
47
|
+
}
|
48
|
+
export interface WorkerSharedOptions {
|
49
|
+
/**
|
50
|
+
* The maximum number of retries to attempt for a job before giving up.
|
51
|
+
*
|
52
|
+
* @default 24
|
53
|
+
*/
|
54
|
+
maxAttempts?: number;
|
55
|
+
/**
|
56
|
+
* The maximum amount of time in seconds that a job can run before another
|
57
|
+
* worker will attempt to retry it.
|
58
|
+
*
|
59
|
+
* @default 14,400 (4 hours)
|
60
|
+
*/
|
61
|
+
maxRuntime?: number;
|
62
|
+
/**
|
63
|
+
* Whether a job that exceeds its `maxAttempts` should be deleted from the
|
64
|
+
* queue. If `false`, the job will remain in the queue but will not be
|
65
|
+
* processed further.
|
66
|
+
*
|
67
|
+
* @default false
|
68
|
+
*/
|
69
|
+
deleteFailedJobs?: boolean;
|
70
|
+
/**
|
71
|
+
* Whether to keep succeeded jobs in the database after they have completed
|
72
|
+
* successfully.
|
73
|
+
*
|
74
|
+
* @default true
|
75
|
+
*
|
76
|
+
*/
|
77
|
+
deleteSuccessfulJobs?: boolean;
|
78
|
+
/**
|
79
|
+
* The amount of time in seconds to wait between polling the queue for new
|
80
|
+
* jobs. Some adapters may not need this if they do not poll the queue and
|
81
|
+
* instead rely on a subscription model.
|
82
|
+
*
|
83
|
+
* @default 5
|
84
|
+
*/
|
85
|
+
sleepDelay?: number;
|
86
|
+
}
|
87
|
+
export interface JobManagerConfig<TAdapters extends Adapters, TQueues extends QueueNames, TLogger extends BasicLogger> {
|
88
|
+
/**
|
89
|
+
* An object containing all of the adapters that this job manager will use.
|
90
|
+
* The keys should be the names of the adapters and the values should be the
|
91
|
+
* adapter instances.
|
92
|
+
*/
|
93
|
+
adapters: TAdapters;
|
94
|
+
/**
|
95
|
+
* The logger to use for this job manager. If not provided, the logger will
|
96
|
+
* default to the console.
|
97
|
+
*/
|
98
|
+
logger: TLogger;
|
99
|
+
/**
|
100
|
+
* An array of all of queue names that jobs can be scheduled on to. Workers can
|
101
|
+
* be configured to work on a selection of these queues.
|
102
|
+
*
|
103
|
+
* This should be an array of string literals.
|
104
|
+
* If you're using TypeScript, you can use `as const`, like in
|
105
|
+
* `['default', 'critical', 'low'] as const` to construct an array of string
|
106
|
+
* literals
|
107
|
+
*/
|
108
|
+
queues: TQueues;
|
109
|
+
/**
|
110
|
+
* An array of worker configurations that define how jobs should be processed.
|
111
|
+
*/
|
112
|
+
workers: WorkerConfig<TAdapters, TQueues>[];
|
113
|
+
}
|
114
|
+
export interface CreateSchedulerConfig<TAdapters extends Adapters> {
|
115
|
+
/**
|
116
|
+
* The name of the adapter to use for this scheduler. This must be one of the keys
|
117
|
+
* in the `adapters` object when you created the `JobManager`.
|
118
|
+
*/
|
119
|
+
adapter: keyof TAdapters;
|
120
|
+
/**
|
121
|
+
* The logger to use for this scheduler. If not provided, the logger from the
|
122
|
+
* `JobManager` will be used.
|
123
|
+
*/
|
124
|
+
logger?: BasicLogger;
|
125
|
+
}
|
126
|
+
export interface JobDefinition<TQueues extends QueueNames, TArgs extends unknown[] = []> {
|
127
|
+
/**
|
128
|
+
* The name of the queue that this job should always be scheduled on. This
|
129
|
+
* must be one of the values in the `queues` array when you created the
|
130
|
+
* `JobManager`.
|
131
|
+
*/
|
132
|
+
queue: TQueues[number];
|
133
|
+
/**
|
134
|
+
* The priority of the job in the range of 0-100. The lower the number, the
|
135
|
+
* higher the priority. The default is 50.
|
136
|
+
* @default 50
|
137
|
+
*/
|
138
|
+
priority?: PriorityValue;
|
139
|
+
/**
|
140
|
+
* The function to run when this job is executed.
|
141
|
+
*
|
142
|
+
* @param args The arguments that were passed when the job was scheduled.
|
143
|
+
*/
|
144
|
+
perform: (...args: TArgs) => Promise<void> | void;
|
145
|
+
}
|
146
|
+
export type JobComputedProperties = {
|
147
|
+
/**
|
148
|
+
* The name of the job that was defined in the job file.
|
149
|
+
*/
|
150
|
+
name: string;
|
151
|
+
/**
|
152
|
+
* The path to the job file that this job was defined in.
|
153
|
+
*/
|
154
|
+
path: string;
|
155
|
+
};
|
156
|
+
export type Job<TQueues extends QueueNames, TArgs extends unknown[] = []> = JobDefinition<TQueues, TArgs> & JobComputedProperties;
|
157
|
+
export type ScheduleJobOptions = {
|
158
|
+
/**
|
159
|
+
* The number of seconds to wait before scheduling this job. This is mutually
|
160
|
+
* exclusive with `waitUntil`.
|
161
|
+
*/
|
162
|
+
wait: number;
|
163
|
+
waitUntil?: never;
|
164
|
+
} | {
|
165
|
+
wait?: never;
|
166
|
+
/**
|
167
|
+
* The date and time to schedule this job for. This is mutually exclusive with
|
168
|
+
* `wait`.
|
169
|
+
*/
|
170
|
+
waitUntil: Date;
|
171
|
+
};
|
172
|
+
type PriorityValue = IntRange<1, 101>;
|
173
|
+
export type CreateSchedulerArgs<TJob extends Job<QueueNames>> = Parameters<TJob['perform']> extends [] ? [ScheduleJobOptions?] | [[], ScheduleJobOptions?] : [Parameters<TJob['perform']>, ScheduleJobOptions?];
|
174
|
+
export {};
|
175
|
+
//# sourceMappingURL=types.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAA;AAExE,8EAA8E;AAC9E,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE,KAAK,IAAI,CAAA;IACxD,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE,KAAK,IAAI,CAAA;IACvD,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE,KAAK,IAAI,CAAA;IACvD,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE,KAAK,IAAI,CAAA;CACzD;AAED;;;GAGG;AACH,MAAM,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mB,CAAC,IAAI,SAAS,GAAG,CAAC,UAAU,CAAC,IAC1D,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,GAClC,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,kBAAkB,CAAC,CAAC,GACjD,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAA"}
|
package/dist/types.js
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
8
|
+
for (let key of __getOwnPropNames(from))
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
11
|
+
}
|
12
|
+
return to;
|
13
|
+
};
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
15
|
+
var types_exports = {};
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
package/dist/util.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAGA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,UAExC"}
|
package/dist/util.js
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
7
|
+
for (var name in all)
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
+
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
+
var util_exports = {};
|
20
|
+
__export(util_exports, {
|
21
|
+
makeFilePath: () => makeFilePath
|
22
|
+
});
|
23
|
+
module.exports = __toCommonJS(util_exports);
|
24
|
+
var import_node_url = require("node:url");
|
25
|
+
function makeFilePath(path) {
|
26
|
+
return (0, import_node_url.pathToFileURL)(path).href;
|
27
|
+
}
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
29
|
+
0 && (module.exports = {
|
30
|
+
makeFilePath
|
31
|
+
});
|
package/package.json
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
{
|
2
|
+
"name": "@redmix/jobs",
|
3
|
+
"version": "0.0.1",
|
4
|
+
"repository": {
|
5
|
+
"type": "git",
|
6
|
+
"url": "git+https://github.com/redmix-run/redmix.git",
|
7
|
+
"directory": "packages/jobs"
|
8
|
+
},
|
9
|
+
"license": "MIT",
|
10
|
+
"type": "commonjs",
|
11
|
+
"exports": {
|
12
|
+
".": {
|
13
|
+
"default": {
|
14
|
+
"types": "./dist/index.d.ts",
|
15
|
+
"default": "./dist/index.js"
|
16
|
+
}
|
17
|
+
},
|
18
|
+
"./package.json": "./package.json"
|
19
|
+
},
|
20
|
+
"main": "./dist/index.js",
|
21
|
+
"types": "./dist/index.d.ts",
|
22
|
+
"bin": {
|
23
|
+
"rw-jobs": "./dist/bins/rw-jobs.js",
|
24
|
+
"rw-jobs-worker": "./dist/bins/rw-jobs-worker.js"
|
25
|
+
},
|
26
|
+
"files": [
|
27
|
+
"dist"
|
28
|
+
],
|
29
|
+
"scripts": {
|
30
|
+
"build": "tsx ./build.mts && yarn build:types",
|
31
|
+
"build:pack": "yarn pack -o redmix-jobs.tgz",
|
32
|
+
"build:types": "tsc --build --verbose ./tsconfig.build.json",
|
33
|
+
"build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"",
|
34
|
+
"check:attw": "yarn rw-fwtools-attw",
|
35
|
+
"check:package": "concurrently npm:check:attw yarn:publint",
|
36
|
+
"prepublishOnly": "NODE_ENV=production yarn build",
|
37
|
+
"test": "vitest run",
|
38
|
+
"test:watch": "vitest"
|
39
|
+
},
|
40
|
+
"dependencies": {
|
41
|
+
"@redmix/cli-helpers": "0.0.1",
|
42
|
+
"@redmix/project-config": "0.0.1",
|
43
|
+
"type-fest": "4.26.1"
|
44
|
+
},
|
45
|
+
"devDependencies": {
|
46
|
+
"@prisma/client": "5.20.0",
|
47
|
+
"@redmix/framework-tools": "0.0.1",
|
48
|
+
"concurrently": "8.2.2",
|
49
|
+
"publint": "0.3.11",
|
50
|
+
"tsx": "4.19.3",
|
51
|
+
"typescript": "5.6.2",
|
52
|
+
"vitest": "2.1.9"
|
53
|
+
},
|
54
|
+
"publishConfig": {
|
55
|
+
"access": "public"
|
56
|
+
},
|
57
|
+
"gitHead": "688027c97502c500ebbede9cdc7cc51545a8dcf3"
|
58
|
+
}
|