@adonis-agora/durable 0.31.0 → 0.31.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/CHANGELOG.md +29 -0
- package/dist/configure.d.ts +5 -2
- package/dist/configure.d.ts.map +1 -1
- package/dist/configure.js +33 -2
- package/dist/configure.js.map +1 -1
- package/dist/src/configure-imports.d.ts +27 -0
- package/dist/src/configure-imports.d.ts.map +1 -0
- package/dist/src/configure-imports.js +37 -0
- package/dist/src/configure-imports.js.map +1 -0
- package/dist/src/dashboard/index.d.ts +1 -1
- package/dist/src/dashboard/index.js +1 -1
- package/dist/src/hooks/steps.d.ts +4 -8
- package/dist/src/hooks/steps.d.ts.map +1 -1
- package/dist/src/hooks/steps.js +19 -15
- package/dist/src/hooks/steps.js.map +1 -1
- package/dist/src/hooks/workflows.d.ts +4 -8
- package/dist/src/hooks/workflows.d.ts.map +1 -1
- package/dist/src/hooks/workflows.js +21 -17
- package/dist/src/hooks/workflows.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @adonis-agora/durable
|
|
2
2
|
|
|
3
|
+
## 0.31.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#100](https://github.com/DavideCarvalho/adonis-agora-durable/pull/100) [`b2297e2`](https://github.com/DavideCarvalho/adonis-agora-durable/commit/b2297e2d5f567ab5b0b3d707457c68d6c596a668) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - `node ace configure` now writes the `#workflows/*` and `#steps/*` subpath imports into the app's `package.json`.
|
|
8
|
+
|
|
9
|
+
The barrels the assembler hooks generate import each module by alias (`#workflows/foo_workflow`), the way `@adonisjs/core`'s controllers barrel uses `#controllers/*`. The difference is that `#controllers/*` ships in the app skeleton and `#workflows/*` does not — so `configure` wired up barrels that named a specifier Node cannot resolve, and the app died at boot with `ERR_PACKAGE_IMPORT_NOT_DEFINED`, after a build that reported success.
|
|
10
|
+
|
|
11
|
+
Existing apps: add these to `package.json` → `imports` (or re-run `configure`, which is now a no-op when they are already present and never overwrites an alias you point elsewhere):
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
"#workflows/*": "./app/workflows/*.js",
|
|
15
|
+
"#steps/*": "./app/steps/*.js"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 0.31.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- [#98](https://github.com/DavideCarvalho/adonis-agora-durable/pull/98) [`4d61da2`](https://github.com/DavideCarvalho/adonis-agora-durable/commit/4d61da2cb0bf977706bdd62382cdd8f49bf7ee0f) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Fix the assembler codegen hooks, which broke the build of every app that ran `node ace configure @adonis-agora/durable`. The configure step writes both hooks into `adonisrc.ts` by itself, and the build then died with:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
TypeError: handler.handle is not a function
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`@poppinss/hooks` — the runner the assembler drives its `init` hooks with — invokes a handler as `typeof handler === 'function' ? handler(...data) : handler.handle(action, ...data)`, so a non-function handler must expose `handle`. Both hooks exported `{ run }`. The same shape also mismatched the assembler's own `DefineHook` type, so a consumer's typecheck failed too.
|
|
29
|
+
|
|
30
|
+
`workflowsHook()` / `stepsHook()` and the default exports of `@adonis-agora/durable/hooks/workflows` and `/hooks/steps` are now plain functions. If you called `workflowsHook().run(...)` directly, call the returned value itself; the wiring in `adonisrc.ts` is unchanged, and it now works instead of throwing.
|
|
31
|
+
|
|
3
32
|
## 0.31.0
|
|
4
33
|
|
|
5
34
|
### Minor Changes
|
package/dist/configure.d.ts
CHANGED
|
@@ -10,8 +10,11 @@ import type Configure from '@adonisjs/core/commands/configure';
|
|
|
10
10
|
* and `app/steps` barrels at build/dev time (the provider imports them instead
|
|
11
11
|
* of scanning at runtime; each falls back to the runtime scan when its barrel
|
|
12
12
|
* is absent);
|
|
13
|
-
* 5.
|
|
14
|
-
*
|
|
13
|
+
* 5. adds the `#workflows/*` and `#steps/*` subpath imports to the app's `package.json`,
|
|
14
|
+
* which the generated barrels import through (without them the app boots into
|
|
15
|
+
* `ERR_PACKAGE_IMPORT_NOT_DEFINED`);
|
|
16
|
+
* 6. publishes `config/durable.ts` + `config/durable_dashboard.ts`;
|
|
17
|
+
* 7. publishes the Lucid migrations for the optional `lucid` store and `db`
|
|
15
18
|
* transport drivers (run `node ace migration:run`, and delete the transport
|
|
16
19
|
* migration if you don't use the `db` transport).
|
|
17
20
|
*/
|
package/dist/configure.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../configure.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../configure.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,SAAS,MAAM,mCAAmC,CAAC;AAI/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,SAAS,iBAuBjD"}
|
package/dist/configure.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { mergeSubpathImports } from './src/configure-imports.js';
|
|
1
3
|
import { stubsRoot } from './stubs/main.js';
|
|
2
4
|
/**
|
|
3
5
|
* `node ace configure @adonis-agora/durable` — auto-wires the package:
|
|
@@ -10,8 +12,11 @@ import { stubsRoot } from './stubs/main.js';
|
|
|
10
12
|
* and `app/steps` barrels at build/dev time (the provider imports them instead
|
|
11
13
|
* of scanning at runtime; each falls back to the runtime scan when its barrel
|
|
12
14
|
* is absent);
|
|
13
|
-
* 5.
|
|
14
|
-
*
|
|
15
|
+
* 5. adds the `#workflows/*` and `#steps/*` subpath imports to the app's `package.json`,
|
|
16
|
+
* which the generated barrels import through (without them the app boots into
|
|
17
|
+
* `ERR_PACKAGE_IMPORT_NOT_DEFINED`);
|
|
18
|
+
* 6. publishes `config/durable.ts` + `config/durable_dashboard.ts`;
|
|
19
|
+
* 7. publishes the Lucid migrations for the optional `lucid` store and `db`
|
|
15
20
|
* transport drivers (run `node ace migration:run`, and delete the transport
|
|
16
21
|
* migration if you don't use the `db` transport).
|
|
17
22
|
*/
|
|
@@ -26,9 +31,35 @@ export async function configure(command) {
|
|
|
26
31
|
rcFile.addAssemblerHook('init', '@adonis-agora/durable/hooks/workflows');
|
|
27
32
|
rcFile.addAssemblerHook('init', '@adonis-agora/durable/hooks/steps');
|
|
28
33
|
});
|
|
34
|
+
await addSubpathImports(command);
|
|
29
35
|
await codemods.makeUsingStub(stubsRoot, 'config/durable.stub', {});
|
|
30
36
|
await codemods.makeUsingStub(stubsRoot, 'config/durable_dashboard.stub', {});
|
|
31
37
|
await codemods.makeUsingStub(stubsRoot, 'database/migrations/create_durable_tables.stub', {});
|
|
32
38
|
await codemods.makeUsingStub(stubsRoot, 'database/migrations/create_durable_transport_tables.stub', {});
|
|
33
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Add the subpath imports the generated barrels resolve through. There is no codemod for the
|
|
42
|
+
* `imports` map, so this edits `package.json` directly — and only when something is missing, so a
|
|
43
|
+
* second `configure` run neither rewrites the file nor logs a change it did not make.
|
|
44
|
+
*/
|
|
45
|
+
async function addSubpathImports(command) {
|
|
46
|
+
const path = command.app.makePath('package.json');
|
|
47
|
+
let raw;
|
|
48
|
+
try {
|
|
49
|
+
raw = await readFile(path, 'utf-8');
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
command.logger.warning('could not read package.json — add "#workflows/*": "./app/workflows/*.js" and "#steps/*": "./app/steps/*.js" to its "imports" by hand');
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const pkg = JSON.parse(raw);
|
|
56
|
+
const { imports, added } = mergeSubpathImports(pkg.imports);
|
|
57
|
+
if (added.length === 0)
|
|
58
|
+
return;
|
|
59
|
+
pkg.imports = imports;
|
|
60
|
+
// Two-space JSON with a trailing newline: what `create-adonisjs` writes, so the diff stays to
|
|
61
|
+
// the added lines instead of reformatting the whole file.
|
|
62
|
+
await writeFile(path, `${JSON.stringify(pkg, null, 2)}\n`);
|
|
63
|
+
command.logger.action(`update package.json (imports: ${added.join(', ')})`).succeeded();
|
|
64
|
+
}
|
|
34
65
|
//# sourceMappingURL=configure.js.map
|
package/dist/configure.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../configure.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../configure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAkB;IAChD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,cAAc,EAAE,CAAC;IAEhD,MAAM,QAAQ,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,EAAE;QACrC,MAAM,CAAC,WAAW,CAAC,wCAAwC,CAAC,CAAC;QAC7D,MAAM,CAAC,WAAW,CAAC,0CAA0C,CAAC,CAAC;QAC/D,MAAM,CAAC,UAAU,CAAC,gCAAgC,CAAC,CAAC;QACpD,4FAA4F;QAC5F,sFAAsF;QACtF,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,uCAAuC,CAAC,CAAC;QACzE,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,mCAAmC,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAEjC,MAAM,QAAQ,CAAC,aAAa,CAAC,SAAS,EAAE,qBAAqB,EAAE,EAAE,CAAC,CAAC;IACnE,MAAM,QAAQ,CAAC,aAAa,CAAC,SAAS,EAAE,+BAA+B,EAAE,EAAE,CAAC,CAAC;IAC7E,MAAM,QAAQ,CAAC,aAAa,CAAC,SAAS,EAAE,gDAAgD,EAAE,EAAE,CAAC,CAAC;IAC9F,MAAM,QAAQ,CAAC,aAAa,CAC1B,SAAS,EACT,0DAA0D,EAC1D,EAAE,CACH,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,KAAK,UAAU,iBAAiB,CAAC,OAAkB;IACjD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IAElD,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,MAAM,CAAC,OAAO,CACpB,sIAAsI,CACvI,CAAC;QACF,OAAO;IACT,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAyC,CAAC;IACpE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC5D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAE/B,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;IACtB,8FAA8F;IAC9F,0DAA0D;IAC1D,MAAM,SAAS,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC3D,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,iCAAiC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC;AAC1F,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Node subpath imports the generated barrels resolve through.
|
|
3
|
+
*
|
|
4
|
+
* The barrels the assembler hooks emit import each module by alias — `#workflows/foo_workflow` —
|
|
5
|
+
* exactly like `@adonisjs/core`'s controllers barrel uses `#controllers/*`. The difference is that
|
|
6
|
+
* `#controllers/*` ships in the app skeleton and `#workflows/*` does not, so without `configure`
|
|
7
|
+
* writing them the generated barrel names a specifier Node cannot resolve and the app dies at boot
|
|
8
|
+
* with `ERR_PACKAGE_IMPORT_NOT_DEFINED` — after a build that reported success.
|
|
9
|
+
*
|
|
10
|
+
* Keys and targets are kept in lockstep with the hooks' `importAlias` / `source` defaults; the spec
|
|
11
|
+
* asserts that pairing so changing one without the other fails loudly instead of at a consumer's
|
|
12
|
+
* boot.
|
|
13
|
+
*/
|
|
14
|
+
export declare const DURABLE_SUBPATH_IMPORTS: Readonly<Record<string, string>>;
|
|
15
|
+
/**
|
|
16
|
+
* Merge {@link DURABLE_SUBPATH_IMPORTS} into an app's `package.json` `imports` map.
|
|
17
|
+
*
|
|
18
|
+
* Never overwrites an entry the app already defines — an app that points `#workflows/*` somewhere
|
|
19
|
+
* else made that choice deliberately, and `configure` is not the place to overrule it. Returns the
|
|
20
|
+
* merged map plus the keys actually added, so the caller can skip the write (and the log line) when
|
|
21
|
+
* there is nothing to do, making a re-run of `configure` a no-op.
|
|
22
|
+
*/
|
|
23
|
+
export declare function mergeSubpathImports(existing: Record<string, string> | undefined): {
|
|
24
|
+
imports: Record<string, string>;
|
|
25
|
+
added: string[];
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=configure-imports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure-imports.d.ts","sourceRoot":"","sources":["../../src/configure-imports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGpE,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG;IACjF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAWA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Node subpath imports the generated barrels resolve through.
|
|
3
|
+
*
|
|
4
|
+
* The barrels the assembler hooks emit import each module by alias — `#workflows/foo_workflow` —
|
|
5
|
+
* exactly like `@adonisjs/core`'s controllers barrel uses `#controllers/*`. The difference is that
|
|
6
|
+
* `#controllers/*` ships in the app skeleton and `#workflows/*` does not, so without `configure`
|
|
7
|
+
* writing them the generated barrel names a specifier Node cannot resolve and the app dies at boot
|
|
8
|
+
* with `ERR_PACKAGE_IMPORT_NOT_DEFINED` — after a build that reported success.
|
|
9
|
+
*
|
|
10
|
+
* Keys and targets are kept in lockstep with the hooks' `importAlias` / `source` defaults; the spec
|
|
11
|
+
* asserts that pairing so changing one without the other fails loudly instead of at a consumer's
|
|
12
|
+
* boot.
|
|
13
|
+
*/
|
|
14
|
+
export const DURABLE_SUBPATH_IMPORTS = {
|
|
15
|
+
'#workflows/*': './app/workflows/*.js',
|
|
16
|
+
'#steps/*': './app/steps/*.js',
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Merge {@link DURABLE_SUBPATH_IMPORTS} into an app's `package.json` `imports` map.
|
|
20
|
+
*
|
|
21
|
+
* Never overwrites an entry the app already defines — an app that points `#workflows/*` somewhere
|
|
22
|
+
* else made that choice deliberately, and `configure` is not the place to overrule it. Returns the
|
|
23
|
+
* merged map plus the keys actually added, so the caller can skip the write (and the log line) when
|
|
24
|
+
* there is nothing to do, making a re-run of `configure` a no-op.
|
|
25
|
+
*/
|
|
26
|
+
export function mergeSubpathImports(existing) {
|
|
27
|
+
const imports = { ...(existing ?? {}) };
|
|
28
|
+
const added = [];
|
|
29
|
+
for (const [key, target] of Object.entries(DURABLE_SUBPATH_IMPORTS)) {
|
|
30
|
+
if (key in imports)
|
|
31
|
+
continue;
|
|
32
|
+
imports[key] = target;
|
|
33
|
+
added.push(key);
|
|
34
|
+
}
|
|
35
|
+
return { imports, added };
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=configure-imports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure-imports.js","sourceRoot":"","sources":["../../src/configure-imports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAqC;IACvE,cAAc,EAAE,sBAAsB;IACtC,UAAU,EAAE,kBAAkB;CAC/B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAA4C;IAI9E,MAAM,OAAO,GAAG,EAAE,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,CAAC;IACxC,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,EAAE,CAAC;QACpE,IAAI,GAAG,IAAI,OAAO;YAAE,SAAS;QAC7B,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;QACtB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Keep in sync with this package's `version` in package.json. */
|
|
2
|
-
export declare const VERSION = "0.31.
|
|
2
|
+
export declare const VERSION = "0.31.2";
|
|
3
3
|
export type { AccessDeniedInfo, AccessDeniedPageOptions, AccessDeniedReason, } from './access_denied_page.js';
|
|
4
4
|
export { CONSOLE as ACCESS_DENIED_CONSOLE, escapeHtml, renderAccessDeniedPage, resolveAccessDeniedPage, } from './access_denied_page.js';
|
|
5
5
|
export type { AuthMode, DashboardAuthOptions, LoginHook, LoginOutcome, ResolvedDashboardAuth, SessionHook, SessionOutcome, } from './auth.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Keep in sync with this package's `version` in package.json. */
|
|
2
|
-
export const VERSION = '0.31.
|
|
2
|
+
export const VERSION = '0.31.2';
|
|
3
3
|
// The built-in "access denied" page (what a browser sees on a refused page navigation).
|
|
4
4
|
export { CONSOLE as ACCESS_DENIED_CONSOLE, escapeHtml, renderAccessDeniedPage, resolveAccessDeniedPage, } from './access_denied_page.js';
|
|
5
5
|
// Built-in `dashboardAuth` login screen (optional; opt-in via `config/durable_dashboard.ts`).
|
|
@@ -31,13 +31,9 @@ export interface StepsHookOptions {
|
|
|
31
31
|
* })
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
|
-
export declare function stepsHook(options?: StepsHookOptions):
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
* in `adonisrc.ts` resolves to a ready hook (the assembler calls its `run`). */
|
|
39
|
-
declare const _default: {
|
|
40
|
-
run(_parent: unknown, _hooks: unknown, indexGenerator: IndexGenerator): void;
|
|
41
|
-
};
|
|
34
|
+
export declare function stepsHook(options?: StepsHookOptions): (_parent: unknown, _hooks: unknown, indexGenerator: IndexGenerator) => void;
|
|
35
|
+
/** The default export is the hook function itself, so `() => import('@adonis-agora/durable/hooks/steps')`
|
|
36
|
+
* in `adonisrc.ts` resolves to a handler the assembler can call directly. */
|
|
37
|
+
declare const _default: (_parent: unknown, _hooks: unknown, indexGenerator: IndexGenerator) => void;
|
|
42
38
|
export default _default;
|
|
43
39
|
//# sourceMappingURL=steps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../../src/hooks/steps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,+BAA+B,CAAC;AAEnE,sFAAsF;AACtF,MAAM,WAAW,gBAAgB;IAC/B,qGAAqG;IACrG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4GAA4G;IAC5G,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,gBAAqB
|
|
1
|
+
{"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../../src/hooks/steps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,+BAA+B,CAAC;AAEnE,sFAAsF;AACtF,MAAM,WAAW,gBAAgB;IAC/B,qGAAqG;IACrG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4GAA4G;IAC5G,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,gBAAqB,aAY3C,OAAO,UACR,OAAO,kBACC,cAAc,KAC7B,IAAI,CAYR;AAED;8EAC8E;kCAlBjE,OAAO,UACR,OAAO,kBACC,cAAc,KAC7B,IAAI"}
|
package/dist/src/hooks/steps.js
CHANGED
|
@@ -25,22 +25,26 @@ export function stepsHook(options = {}) {
|
|
|
25
25
|
const source = options.source ?? 'app/steps';
|
|
26
26
|
const importAlias = options.importAlias ?? '#steps';
|
|
27
27
|
const output = options.output ?? GENERATED_STEPS_OUTPUT;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
// A FUNCTION, not an object with a `run` method. `@poppinss/hooks` — the runner the
|
|
29
|
+
// assembler drives its `init` hooks with — invokes a handler as
|
|
30
|
+
// `typeof handler === 'function' ? handler(...data) : handler.handle(action, ...data)`
|
|
31
|
+
// so a non-function handler must expose `handle`. Exporting `{ run }` made every app that
|
|
32
|
+
// ran `node ace configure` fail its build with `handler.handle is not a function`, and it
|
|
33
|
+
// also mismatched the assembler's own `DefineHook` type, which is a plain function.
|
|
34
|
+
return function generateStepsBarrel(_parent, _hooks, indexGenerator) {
|
|
35
|
+
indexGenerator.add('steps', {
|
|
36
|
+
source,
|
|
37
|
+
as: 'barrelFile',
|
|
38
|
+
exportName: 'steps',
|
|
39
|
+
importAlias,
|
|
40
|
+
removeSuffix: 'step',
|
|
41
|
+
skipSegments: ['steps'],
|
|
42
|
+
output,
|
|
43
|
+
comment: true,
|
|
44
|
+
});
|
|
41
45
|
};
|
|
42
46
|
}
|
|
43
|
-
/** The default export is the hook
|
|
44
|
-
* in `adonisrc.ts` resolves to a
|
|
47
|
+
/** The default export is the hook function itself, so `() => import('@adonis-agora/durable/hooks/steps')`
|
|
48
|
+
* in `adonisrc.ts` resolves to a handler the assembler can call directly. */
|
|
45
49
|
export default stepsHook();
|
|
46
50
|
//# sourceMappingURL=steps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steps.js","sourceRoot":"","sources":["../../../src/hooks/steps.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AAYnE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,SAAS,CAAC,OAAO,GAAqB,EAAE;IACtD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,WAAW,CAAC;IAC7C,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,QAAQ,CAAC;IACpD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,sBAAsB,CAAC;IAExD,
|
|
1
|
+
{"version":3,"file":"steps.js","sourceRoot":"","sources":["../../../src/hooks/steps.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AAYnE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,SAAS,CAAC,OAAO,GAAqB,EAAE;IACtD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,WAAW,CAAC;IAC7C,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,QAAQ,CAAC;IACpD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,sBAAsB,CAAC;IAExD,oFAAoF;IACpF,gEAAgE;IAChE,yFAAyF;IACzF,0FAA0F;IAC1F,0FAA0F;IAC1F,oFAAoF;IACpF,OAAO,SAAS,mBAAmB,CACjC,OAAgB,EAChB,MAAe,EACf,cAA8B;QAE9B,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE;YAC1B,MAAM;YACN,EAAE,EAAE,YAAY;YAChB,UAAU,EAAE,OAAO;YACnB,WAAW;YACX,YAAY,EAAE,MAAM;YACpB,YAAY,EAAE,CAAC,OAAO,CAAC;YACvB,MAAM;YACN,OAAO,EAAE,IAAI;SACd,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED;8EAC8E;AAC9E,eAAe,SAAS,EAAE,CAAC"}
|
|
@@ -42,13 +42,9 @@ export interface WorkflowsHookOptions {
|
|
|
42
42
|
*
|
|
43
43
|
* The default export is the hook object the assembler expects (`{ run(parent, hooks, indexGenerator) }`).
|
|
44
44
|
*/
|
|
45
|
-
export declare function workflowsHook(options?: WorkflowsHookOptions):
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
* in `adonisrc.ts` resolves to a ready hook (the assembler calls its `run`). */
|
|
50
|
-
declare const _default: {
|
|
51
|
-
run(_parent: unknown, _hooks: unknown, indexGenerator: IndexGenerator): void;
|
|
52
|
-
};
|
|
45
|
+
export declare function workflowsHook(options?: WorkflowsHookOptions): (_parent: unknown, _hooks: unknown, indexGenerator: IndexGenerator) => void;
|
|
46
|
+
/** The default export is the hook function itself, so `() => import('@adonis-agora/durable/hooks/workflows')`
|
|
47
|
+
* in `adonisrc.ts` resolves to a handler the assembler can call directly. */
|
|
48
|
+
declare const _default: (_parent: unknown, _hooks: unknown, indexGenerator: IndexGenerator) => void;
|
|
53
49
|
export default _default;
|
|
54
50
|
//# sourceMappingURL=workflows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../../src/hooks/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,mCAAmC,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,6GAA6G;IAC7G,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6FAA6F;IAC7F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gHAAgH;IAChH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB
|
|
1
|
+
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../../src/hooks/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,mCAAmC,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,6GAA6G;IAC7G,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6FAA6F;IAC7F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gHAAgH;IAChH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,aAYnD,OAAO,UACR,OAAO,kBACC,cAAc,KAC7B,IAAI,CAcR;AAED;8EAC8E;kCApBjE,OAAO,UACR,OAAO,kBACC,cAAc,KAC7B,IAAI"}
|
|
@@ -33,24 +33,28 @@ export function workflowsHook(options = {}) {
|
|
|
33
33
|
const source = options.source ?? 'app/workflows';
|
|
34
34
|
const importAlias = options.importAlias ?? '#workflows';
|
|
35
35
|
const output = options.output ?? GENERATED_WORKFLOWS_OUTPUT;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
// A FUNCTION, not an object with a `run` method. `@poppinss/hooks` — the runner the
|
|
37
|
+
// assembler drives its `init` hooks with — invokes a handler as
|
|
38
|
+
// `typeof handler === 'function' ? handler(...data) : handler.handle(action, ...data)`
|
|
39
|
+
// so a non-function handler must expose `handle`. Exporting `{ run }` made every app that
|
|
40
|
+
// ran `node ace configure` fail its build with `handler.handle is not a function`, and it
|
|
41
|
+
// also mismatched the assembler's own `DefineHook` type, which is a plain function.
|
|
42
|
+
return function generateWorkflowsBarrel(_parent, _hooks, indexGenerator) {
|
|
43
|
+
indexGenerator.add('workflows', {
|
|
44
|
+
source,
|
|
45
|
+
as: 'barrelFile',
|
|
46
|
+
exportName: 'workflows',
|
|
47
|
+
importAlias,
|
|
48
|
+
// `app/workflows/billing/charge_workflow.ts` → key `Billing/Charge`; the `Workflow` suffix is
|
|
49
|
+
// dropped so a barrel key reads as the class, mirroring controllers' `removeSuffix: 'controller'`.
|
|
50
|
+
removeSuffix: 'workflow',
|
|
51
|
+
skipSegments: ['workflows'],
|
|
52
|
+
output,
|
|
53
|
+
comment: true,
|
|
54
|
+
});
|
|
51
55
|
};
|
|
52
56
|
}
|
|
53
|
-
/** The default export is the hook
|
|
54
|
-
* in `adonisrc.ts` resolves to a
|
|
57
|
+
/** The default export is the hook function itself, so `() => import('@adonis-agora/durable/hooks/workflows')`
|
|
58
|
+
* in `adonisrc.ts` resolves to a handler the assembler can call directly. */
|
|
55
59
|
export default workflowsHook();
|
|
56
60
|
//# sourceMappingURL=workflows.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../../src/hooks/workflows.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,gCAAgC,CAAC;AAe3E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,aAAa,CAAC,OAAO,GAAyB,EAAE;IAC9D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,eAAe,CAAC;IACjD,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,YAAY,CAAC;IACxD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,0BAA0B,CAAC;IAE5D,
|
|
1
|
+
{"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../../src/hooks/workflows.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,gCAAgC,CAAC;AAe3E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,aAAa,CAAC,OAAO,GAAyB,EAAE;IAC9D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,eAAe,CAAC;IACjD,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,YAAY,CAAC;IACxD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,0BAA0B,CAAC;IAE5D,oFAAoF;IACpF,gEAAgE;IAChE,yFAAyF;IACzF,0FAA0F;IAC1F,0FAA0F;IAC1F,oFAAoF;IACpF,OAAO,SAAS,uBAAuB,CACrC,OAAgB,EAChB,MAAe,EACf,cAA8B;QAE9B,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE;YAC9B,MAAM;YACN,EAAE,EAAE,YAAY;YAChB,UAAU,EAAE,WAAW;YACvB,WAAW;YACX,8FAA8F;YAC9F,mGAAmG;YACnG,YAAY,EAAE,UAAU;YACxB,YAAY,EAAE,CAAC,WAAW,CAAC;YAC3B,MAAM;YACN,OAAO,EAAE,IAAI;SACd,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED;8EAC8E;AAC9E,eAAe,aAAa,EAAE,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Keep in sync with this package's `version` in package.json. */
|
|
2
|
-
export declare const VERSION = "0.31.
|
|
2
|
+
export declare const VERSION = "0.31.2";
|
|
3
3
|
export { configure } from '../configure.js';
|
|
4
4
|
export * from './admission.js';
|
|
5
5
|
export type { AdmissionContext, AdmissionFactory, RedisAdmissionConfig, } from './admissions/factory.js';
|
package/dist/src/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Keep in sync with this package's `version` in package.json. */
|
|
2
|
-
export const VERSION = '0.31.
|
|
2
|
+
export const VERSION = '0.31.2';
|
|
3
3
|
// Re-export the configure hook from the package root so `node ace configure` finds it.
|
|
4
4
|
// AdonisJS imports the package MAIN and reads `configure` off the module namespace —
|
|
5
5
|
// the `./configure` subpath alone is never consulted.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonis-agora/durable",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.2",
|
|
4
4
|
"description": "Durable cross-app workflows for AdonisJS — deterministic replay engine, AdonisJS binding, ace commands, dashboard, OpenTelemetry, Telescope, testing harness and Redis admission, all in one package. Part of the Agora ecosystem.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -160,6 +160,7 @@
|
|
|
160
160
|
"@opentelemetry/api": "1.9.1",
|
|
161
161
|
"@opentelemetry/context-async-hooks": "2.10.0",
|
|
162
162
|
"@opentelemetry/sdk-trace-base": "2.10.0",
|
|
163
|
+
"@poppinss/hooks": "7.3.1",
|
|
163
164
|
"@tanstack/intent": "^0.3.7",
|
|
164
165
|
"@types/better-sqlite3": "9.6.0",
|
|
165
166
|
"@types/node": "26.4.0",
|