Skip to content

Commit 6638fb1

Browse files
committed
feat(command-flow): extract sub modules as secondary package entries
1 parent ed20a0e commit 6638fb1

44 files changed

Lines changed: 138 additions & 70 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
3+
"lib": {
4+
"entryFile": "src/public-api.ts"
5+
}
6+
}

packages/command-flow/src/lib/debugger/debugger.ts renamed to packages/command-flow/debugger/src/debugger.ts

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
/* eslint-disable no-console */
2+
import * as core from '@angular/core';
23
import {
3-
APP_INITIALIZER,
4-
EnvironmentProviders,
5-
inject,
6-
Injectable,
7-
InjectionToken,
8-
makeEnvironmentProviders,
9-
} from '@angular/core';
4+
Command,
5+
COMMAND_EVENT_META,
6+
CommandBus,
7+
CommandEventBus,
8+
} from '@angularity/command-flow';
109
import { provideMulti } from '@angularity/core';
1110

12-
import { CommandBus, CommandEventBus } from '../core/buses';
13-
import { Command, COMMAND_EVENT_META } from '../core/core';
14-
15-
@Injectable({ providedIn: 'root' })
11+
@core.Injectable({ providedIn: 'root' })
1612
export class CommandIdWeakMap extends WeakMap<Command, string> {}
1713

18-
export const COMMAND_ID_GENERATOR = new InjectionToken<
14+
export const COMMAND_ID_GENERATOR = new core.InjectionToken<
1915
(target: Command) => string
2016
>('COMMAND_ID_GENERATOR', {
2117
factory: () => {
@@ -24,22 +20,22 @@ export const COMMAND_ID_GENERATOR = new InjectionToken<
2420
},
2521
});
2622

27-
export const COMMAND_FLOW_DEBUGGER_FILTER = new InjectionToken<
23+
export const COMMAND_FLOW_DEBUGGER_FILTER = new core.InjectionToken<
2824
(command: Command) => boolean
2925
>('COMMAND_FLOW_DEBUGGER_FILTER', {
3026
factory: () => () => true,
3127
});
3228

33-
export function provideCommandFlowDebugger(): EnvironmentProviders {
34-
return makeEnvironmentProviders([
29+
export function provideCommandFlowDebugger(): core.EnvironmentProviders {
30+
return core.makeEnvironmentProviders([
3531
provideMulti({
36-
token: APP_INITIALIZER,
32+
token: core.APP_INITIALIZER,
3733
useFactory: () => {
38-
const commands$ = inject(CommandBus);
39-
const events$ = inject(CommandEventBus);
40-
const idMap = inject(CommandIdWeakMap);
41-
const idGenerator = inject(COMMAND_ID_GENERATOR);
42-
const commandFilter = inject(COMMAND_FLOW_DEBUGGER_FILTER);
34+
const commands$ = core.inject(CommandBus);
35+
const events$ = core.inject(CommandEventBus);
36+
const idMap = core.inject(CommandIdWeakMap);
37+
const idGenerator = core.inject(COMMAND_ID_GENERATOR);
38+
const commandFilter = core.inject(COMMAND_FLOW_DEBUGGER_FILTER);
4339
return () => {
4440
commands$.subscribe((c) => {
4541
if (!commandFilter(c)) return;
File renamed without changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
3+
"lib": {
4+
"entryFile": "src/public-api.ts"
5+
}
6+
}
File renamed without changes.
File renamed without changes.

packages/command-flow/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
"@angular/common": "17.x.x",
66
"@angular/core": "17.x.x",
77
"@angularity/core": "*",
8-
"rxjs": "7.x.x"
8+
"@angularity/command-flow": "*",
9+
"rxjs": "7.x.x",
10+
"ts-pattern": "5.x.x"
11+
},
12+
"devDependencies": {
13+
"ts-pattern": "5.x.x"
914
},
1015
"dependencies": {
11-
"ts-pattern": "^5.1.1",
1216
"tslib": "^2.3.0"
1317
},
1418
"sideEffects": false
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
3+
"lib": {
4+
"entryFile": "src/public-api.ts"
5+
}
6+
}

packages/command-flow/src/lib/process-flow/core.ts renamed to packages/command-flow/process-flow/src/core.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { Command, COMMAND_META, CommandMetadata } from '../core';
1+
import {
2+
Command,
3+
COMMAND_META,
4+
CommandMetadata,
5+
} from '@angularity/command-flow';
26

37
export interface ProcessMetadata<Result> extends CommandMetadata {
48
process: { $generics?: [Result] };

0 commit comments

Comments
 (0)