rura 1.1.1 → 1.1.3

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.cjs CHANGED
@@ -122,20 +122,20 @@ async function runAsync(ctx, hooks) {
122
122
  }
123
123
 
124
124
  // src/pipeline/create/create-pipeline.ts
125
- function createPipeline(hooks = []) {
125
+ function createPipeline(hooks = [], options) {
126
126
  return createPipelineBase(
127
127
  hooks,
128
128
  run,
129
- { mode: "sync" }
129
+ { mode: "sync", ...options }
130
130
  );
131
131
  }
132
132
 
133
133
  // src/pipeline/create/create-pipeline-async.ts
134
- function createPipelineAsync(hooks = []) {
134
+ function createPipelineAsync(hooks = [], options) {
135
135
  return createPipelineBase(
136
136
  hooks,
137
137
  runAsync,
138
- { mode: "async" }
138
+ { mode: "async", ...options }
139
139
  );
140
140
  }
141
141
 
package/dist/index.d.ts CHANGED
@@ -35,7 +35,9 @@ export declare function createHookAsync<Ctx = unknown, Out = unknown>(name: stri
35
35
  *
36
36
  * @public
37
37
  */
38
- export declare function createPipeline<Ctx = unknown, Out = unknown>(hooks?: RuraHookSync<Ctx, Out>[]): {
38
+ export declare function createPipeline<Ctx = unknown, Out = unknown>(hooks?: RuraHookSync<Ctx, Out>[], options?: {
39
+ name?: string;
40
+ }): {
39
41
  use: (hook: RuraHookSync<Ctx, Out>) => /*elided*/ any;
40
42
  getHooks: () => RuraHookSync<Ctx, Out>[];
41
43
  logHooks: () => void;
@@ -54,7 +56,9 @@ export declare function createPipeline<Ctx = unknown, Out = unknown>(hooks?: Rur
54
56
  *
55
57
  * @public
56
58
  */
57
- export declare function createPipelineAsync<Ctx = unknown, Out = unknown>(hooks?: RuraHook<Ctx, Out>[]): {
59
+ export declare function createPipelineAsync<Ctx = unknown, Out = unknown>(hooks?: RuraHook<Ctx, Out>[], options?: {
60
+ name?: string;
61
+ }): {
58
62
  use: (hook: RuraHook<Ctx, Out>) => /*elided*/ any;
59
63
  getHooks: () => RuraHook<Ctx, Out>[];
60
64
  logHooks: () => void;
package/dist/index.js CHANGED
@@ -120,20 +120,20 @@ async function runAsync(ctx, hooks) {
120
120
  }
121
121
 
122
122
  // src/pipeline/create/create-pipeline.ts
123
- function createPipeline(hooks = []) {
123
+ function createPipeline(hooks = [], options) {
124
124
  return createPipelineBase(
125
125
  hooks,
126
126
  run,
127
- { mode: "sync" }
127
+ { mode: "sync", ...options }
128
128
  );
129
129
  }
130
130
 
131
131
  // src/pipeline/create/create-pipeline-async.ts
132
- function createPipelineAsync(hooks = []) {
132
+ function createPipelineAsync(hooks = [], options) {
133
133
  return createPipelineBase(
134
134
  hooks,
135
135
  runAsync,
136
- { mode: "async" }
136
+ { mode: "async", ...options }
137
137
  );
138
138
  }
139
139
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rura",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "The hook pipeline",
5
5
  "author": "Yiming Liao",
6
6
  "homepage": "https://github.com/yiming-liao/rura#readme",
@@ -28,16 +28,16 @@
28
28
  "type": "module",
29
29
  "exports": {
30
30
  ".": {
31
- "types": "./dist/types/export/index.d.ts",
31
+ "types": "./dist/index.d.ts",
32
32
  "import": "./dist/index.js",
33
33
  "require": "./dist/index.cjs"
34
34
  }
35
35
  },
36
36
  "main": "./dist/index.cjs",
37
37
  "module": "./dist/index.js",
38
- "types": "./dist/types/export/index.d.ts",
38
+ "types": "./dist/index.d.ts",
39
39
  "files": [
40
- "dist/index.*",
40
+ "dist",
41
41
  "README.md",
42
42
  "LICENSE"
43
43
  ],
@@ -50,10 +50,12 @@
50
50
  "lint": "eslint",
51
51
  "test": "vitest",
52
52
  "knip": "knip --config .config/knip.config.ts",
53
- "build": "tsup && tsc -p tsconfig.build.json",
54
- "prepublishOnly": "yarn build && yarn api:check",
53
+ "build": "tsup",
54
+ "build:types": "tsc -p tsconfig.build.json && api-extractor run -c api-extractor/index.json --local",
55
+ "build:release": "yarn build && yarn build:types",
56
+ "api:check": "api-extractor run -c api-extractor/index.json",
55
57
  "api:build": "api-extractor run -c api-extractor/index.json --local",
56
- "api:check": "api-extractor run -c api-extractor/index.json"
58
+ "prepublishOnly": "yarn build:release"
57
59
  },
58
60
  "dependencies": {},
59
61
  "devDependencies": {