@protobase/config 0.49.1 → 0.49.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.
package/dist/index.d.ts CHANGED
@@ -1,10 +1,15 @@
1
1
  import { AuthConfig, ConfigCommand, ConfigEnv, ConfigFunction, ConfigInput, FilesConfig, ProtobaseConfig } from "./config.js";
2
+ import { JobDeclaration } from "@protobase/server";
2
3
  //#region src/index.d.ts
4
+ type WithJobs<Jobs> = Omit<ProtobaseConfig, 'jobs'> & {
5
+ jobs?: Jobs;
6
+ };
3
7
  /**
4
8
  * Types `protobase.config.ts`'s default export and returns it as it is: a config, or a function of the command and the
5
- * environment that returns one, at once or as a promise.
9
+ * environment that returns one, at once or as a promise. Its type keeps the jobs as written, so
10
+ * `EnqueueJob<typeof config>` of `@protobase/server` knows their names and arguments.
6
11
  */
7
- export declare function defineConfig(config: ProtobaseConfig): ProtobaseConfig;
8
- export declare function defineConfig(config: ConfigFunction): ConfigFunction;
12
+ export declare function defineConfig<const Jobs extends Record<string, JobDeclaration> = {}>(config: WithJobs<Jobs>): WithJobs<Jobs>;
13
+ export declare function defineConfig<const Jobs extends Record<string, JobDeclaration> = {}>(config: (configEnv: ConfigEnv) => WithJobs<Jobs> | Promise<WithJobs<Jobs>>): (configEnv: ConfigEnv) => WithJobs<Jobs> | Promise<WithJobs<Jobs>>;
9
14
  //#endregion
10
15
  export type { AuthConfig, ConfigCommand, ConfigEnv, ConfigFunction, ConfigInput, FilesConfig, ProtobaseConfig };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@protobase/config",
3
- "version": "0.49.1",
4
- "description": "defineConfig and the types of a Protobase project's protobase.config.ts.",
3
+ "version": "0.49.2",
4
+ "description": "defineConfig and the types of a Protobase project's protobase.config.ts, and the JSON Schema of protobase.config.json.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -15,11 +15,13 @@
15
15
  "node": ">=22.12.0"
16
16
  },
17
17
  "exports": {
18
- ".": "./dist/index.js"
18
+ ".": "./dist/index.js",
19
+ "./schema.json": "./schema.json"
19
20
  },
20
21
  "types": "./dist/index.d.ts",
21
22
  "files": [
22
- "dist"
23
+ "dist",
24
+ "schema.json"
23
25
  ],
24
26
  "scripts": {
25
27
  "build": "tsdown",
@@ -29,6 +31,6 @@
29
31
  "access": "public"
30
32
  },
31
33
  "peerDependencies": {
32
- "@protobase/server": "0.49.1"
34
+ "@protobase/server": "0.49.2"
33
35
  }
34
36
  }