@wrelik/jobs 0.1.0 → 0.1.2

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.
@@ -0,0 +1,23 @@
1
+
2
+ > @wrelik/jobs@0.1.2 build /home/runner/work/wrelik-kit/wrelik-kit/packages/jobs
3
+ > tsup src/index.ts src/unsupported.ts --format cjs,esm --dts --clean
4
+
5
+ CLI Building entry: src/index.ts, src/unsupported.ts
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v8.5.1
8
+ CLI Target: es2022
9
+ CLI Cleaning output folder
10
+ CJS Build start
11
+ ESM Build start
12
+ CJS dist/index.js 1.60 KB
13
+ CJS dist/unsupported.js 192.00 B
14
+ CJS ⚡️ Build success in 54ms
15
+ ESM dist/index.mjs 537.00 B
16
+ ESM dist/unsupported.mjs 177.00 B
17
+ ESM ⚡️ Build success in 51ms
18
+ DTS Build start
19
+ DTS ⚡️ Build success in 2292ms
20
+ DTS dist/unsupported.d.ts 13.00 B
21
+ DTS dist/index.d.ts 1.18 KB
22
+ DTS dist/unsupported.d.mts 13.00 B
23
+ DTS dist/index.d.mts 1.18 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @wrelik/jobs
2
2
 
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - a38ebcb: Add React Native / Expo support and enforce server-only boundaries.
8
+
9
+ ## 0.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Update publishConfig to access:public for all packages.
14
+
3
15
  ## 0.1.0
4
16
 
5
17
  ### Minor Changes
@@ -0,0 +1,30 @@
1
+ import * as inngest_types from 'inngest/types';
2
+ import * as inngest from 'inngest';
3
+ import { Inngest } from 'inngest';
4
+
5
+ declare let client: Inngest;
6
+ declare function initJobs(appId: string): void;
7
+ declare function emit(eventName: string, payload: any): Promise<inngest_types.SendEventOutput<inngest.ClientOptions>>;
8
+ declare function createFunction(name: string, trigger: {
9
+ event: string;
10
+ } | {
11
+ cron: string;
12
+ }, handler: (args: any) => Promise<any>): inngest.InngestFunction<Omit<inngest.InngestFunction.Options<Inngest<inngest.ClientOptions>, inngest.InngestMiddleware.Stack, [{
13
+ event: string;
14
+ }] | [{
15
+ cron: string;
16
+ }], inngest.Handler<Inngest<inngest.ClientOptions>, string, {
17
+ event: inngest.FailureEventPayload<inngest.EventPayload<any>>;
18
+ logger: inngest.Logger;
19
+ error: Error;
20
+ }>>, "triggers">, (args: any) => Promise<any>, inngest.Handler<Inngest<inngest.ClientOptions>, string, {
21
+ event: inngest.FailureEventPayload<inngest.EventPayload<any>>;
22
+ logger: inngest.Logger;
23
+ error: Error;
24
+ }>, Inngest<inngest.ClientOptions>, inngest.InngestMiddleware.Stack, [{
25
+ event: string;
26
+ }] | [{
27
+ cron: string;
28
+ }]>;
29
+
30
+ export { createFunction, emit, initJobs, client as inngest };
@@ -0,0 +1,30 @@
1
+ import * as inngest_types from 'inngest/types';
2
+ import * as inngest from 'inngest';
3
+ import { Inngest } from 'inngest';
4
+
5
+ declare let client: Inngest;
6
+ declare function initJobs(appId: string): void;
7
+ declare function emit(eventName: string, payload: any): Promise<inngest_types.SendEventOutput<inngest.ClientOptions>>;
8
+ declare function createFunction(name: string, trigger: {
9
+ event: string;
10
+ } | {
11
+ cron: string;
12
+ }, handler: (args: any) => Promise<any>): inngest.InngestFunction<Omit<inngest.InngestFunction.Options<Inngest<inngest.ClientOptions>, inngest.InngestMiddleware.Stack, [{
13
+ event: string;
14
+ }] | [{
15
+ cron: string;
16
+ }], inngest.Handler<Inngest<inngest.ClientOptions>, string, {
17
+ event: inngest.FailureEventPayload<inngest.EventPayload<any>>;
18
+ logger: inngest.Logger;
19
+ error: Error;
20
+ }>>, "triggers">, (args: any) => Promise<any>, inngest.Handler<Inngest<inngest.ClientOptions>, string, {
21
+ event: inngest.FailureEventPayload<inngest.EventPayload<any>>;
22
+ logger: inngest.Logger;
23
+ error: Error;
24
+ }>, Inngest<inngest.ClientOptions>, inngest.InngestMiddleware.Stack, [{
25
+ event: string;
26
+ }] | [{
27
+ cron: string;
28
+ }]>;
29
+
30
+ export { createFunction, emit, initJobs, client as inngest };
package/dist/index.js ADDED
@@ -0,0 +1,53 @@
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
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ createFunction: () => createFunction,
24
+ emit: () => emit,
25
+ initJobs: () => initJobs,
26
+ inngest: () => client
27
+ });
28
+ module.exports = __toCommonJS(index_exports);
29
+ var import_inngest = require("inngest");
30
+ var client;
31
+ function initJobs(appId) {
32
+ client = new import_inngest.Inngest({ id: appId });
33
+ }
34
+ function getClient() {
35
+ if (!client) throw new Error("Jobs not initialized");
36
+ return client;
37
+ }
38
+ async function emit(eventName, payload) {
39
+ return getClient().send({
40
+ name: eventName,
41
+ data: payload
42
+ });
43
+ }
44
+ function createFunction(name, trigger, handler) {
45
+ return getClient().createFunction({ id: name }, trigger, handler);
46
+ }
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ createFunction,
50
+ emit,
51
+ initJobs,
52
+ inngest
53
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,25 @@
1
+ // src/index.ts
2
+ import { Inngest } from "inngest";
3
+ var client;
4
+ function initJobs(appId) {
5
+ client = new Inngest({ id: appId });
6
+ }
7
+ function getClient() {
8
+ if (!client) throw new Error("Jobs not initialized");
9
+ return client;
10
+ }
11
+ async function emit(eventName, payload) {
12
+ return getClient().send({
13
+ name: eventName,
14
+ data: payload
15
+ });
16
+ }
17
+ function createFunction(name, trigger, handler) {
18
+ return getClient().createFunction({ id: name }, trigger, handler);
19
+ }
20
+ export {
21
+ createFunction,
22
+ emit,
23
+ initJobs,
24
+ client as inngest
25
+ };
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ // src/unsupported.ts
4
+ throw new Error(
5
+ "This package is server-only and cannot be used in client/mobile environments. Access this functionality via a backend API instead."
6
+ );
@@ -0,0 +1,4 @@
1
+ // src/unsupported.ts
2
+ throw new Error(
3
+ "This package is server-only and cannot be used in client/mobile environments. Access this functionality via a backend API instead."
4
+ );
package/package.json CHANGED
@@ -1,19 +1,28 @@
1
1
  {
2
2
  "name": "@wrelik/jobs",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/lwhite702/wrelik-kit.git",
10
+ "directory": "packages/jobs"
11
+ },
4
12
  "main": "./dist/index.js",
5
13
  "types": "./dist/index.d.ts",
14
+ "react-native": "./dist/unsupported.js",
6
15
  "dependencies": {
7
16
  "inngest": "^3.11.0"
8
17
  },
9
18
  "devDependencies": {
10
19
  "tsup": "^8.0.1",
11
20
  "vitest": "^1.2.2",
12
- "@wrelik/eslint-config": "0.1.0",
13
- "@wrelik/tsconfig": "0.1.0"
21
+ "@wrelik/eslint-config": "0.1.1",
22
+ "@wrelik/tsconfig": "0.1.1"
14
23
  },
15
24
  "scripts": {
16
- "build": "tsup src/index.ts --format cjs,esm --dts --clean",
25
+ "build": "tsup src/index.ts src/unsupported.ts --format cjs,esm --dts --clean",
17
26
  "lint": "eslint src/",
18
27
  "test": "vitest run --passWithNoTests"
19
28
  }
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { Inngest, EventSchemas, type GetEvents } from 'inngest';
1
+ // eslint-disable-next-line no-restricted-imports
2
+ import { Inngest } from 'inngest';
2
3
 
3
4
  // Define the event types map that apps can extend via module augmentation?
4
5
  // For now, we use a generic approach or require strict schemas.
@@ -7,7 +8,8 @@ import { Inngest, EventSchemas, type GetEvents } from 'inngest';
7
8
 
8
9
  let client: Inngest;
9
10
 
10
- export function initJobs(appId: string, eventSchema?: any) {
11
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+ export function initJobs(appId: string) {
11
13
  // We can pass schemas if we want strict typing
12
14
  client = new Inngest({ id: appId });
13
15
  }
@@ -17,6 +19,7 @@ function getClient() {
17
19
  return client;
18
20
  }
19
21
 
22
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
23
  export async function emit(eventName: string, payload: any) {
21
24
  return getClient().send({
22
25
  name: eventName,
@@ -28,6 +31,7 @@ export async function emit(eventName: string, payload: any) {
28
31
  export function createFunction(
29
32
  name: string,
30
33
  trigger: { event: string } | { cron: string },
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
35
  handler: (args: any) => Promise<any>,
32
36
  ) {
33
37
  return getClient().createFunction({ id: name }, trigger, handler);
@@ -0,0 +1,4 @@
1
+ throw new Error(
2
+ 'This package is server-only and cannot be used in client/mobile environments. ' +
3
+ 'Access this functionality via a backend API instead.',
4
+ );
package/tsconfig.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "extends": "@wrelik/tsconfig/node.json",
3
3
  "compilerOptions": {
4
- "outDir": "dist"
4
+ "outDir": "dist", "skipLibCheck": true
5
5
  },
6
6
  "include": ["src"]
7
7
  }