ddd-ts-kit 0.92.0 → 0.93.0
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 +36 -0
- package/README.fr.md +12 -7
- package/README.md +9 -5
- package/dist/acceptance/check-locked-files.d.ts +25 -0
- package/dist/acceptance/check-locked-files.d.ts.map +1 -0
- package/dist/acceptance/check-locked-files.js +84 -0
- package/dist/acceptance/check-locked-files.js.map +1 -0
- package/dist/acceptance/scenarios-in.d.ts +4 -0
- package/dist/acceptance/scenarios-in.d.ts.map +1 -1
- package/dist/acceptance/scenarios-in.js +2 -2
- package/dist/acceptance/scenarios-in.js.map +1 -1
- package/dist/commands/acceptance.d.ts.map +1 -1
- package/dist/commands/acceptance.js +14 -0
- package/dist/commands/acceptance.js.map +1 -1
- package/dist/commands/generate.js +2 -0
- package/dist/commands/generate.js.map +1 -1
- package/dist/commit/run-git.d.ts +5 -1
- package/dist/commit/run-git.d.ts.map +1 -1
- package/dist/commit/run-git.js +19 -2
- package/dist/commit/run-git.js.map +1 -1
- package/dist/controllers/finish-migration.js +4 -2
- package/dist/controllers/finish-migration.js.map +1 -1
- package/dist/docs/behaviour-page.d.ts.map +1 -1
- package/dist/docs/behaviour-page.js +9 -1
- package/dist/docs/behaviour-page.js.map +1 -1
- package/dist/generate/kind.d.ts +2 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/job/job-vars.d.ts +4 -1
- package/dist/generate/kinds/job/job-vars.d.ts.map +1 -1
- package/dist/generate/kinds/job/job-vars.js +11 -1
- package/dist/generate/kinds/job/job-vars.js.map +1 -1
- package/dist/generate/kinds/job-kind.js +20 -3
- package/dist/generate/kinds/job-kind.js.map +1 -1
- package/dist/generate/kinds/service-kind.d.ts.map +1 -1
- package/dist/generate/kinds/service-kind.js +30 -3
- package/dist/generate/kinds/service-kind.js.map +1 -1
- package/dist/init/files/inert-persistence-file.d.ts +5 -0
- package/dist/init/files/inert-persistence-file.d.ts.map +1 -0
- package/dist/init/files/inert-persistence-file.js +16 -0
- package/dist/init/files/inert-persistence-file.js.map +1 -0
- package/dist/init/files/platform-files.js +6 -1
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/measures/branch-commits.d.ts +4 -2
- package/dist/measures/branch-commits.d.ts.map +1 -1
- package/dist/measures/branch-commits.js +32 -8
- package/dist/measures/branch-commits.js.map +1 -1
- package/dist/measures/timeline-of.d.ts +3 -2
- package/dist/measures/timeline-of.d.ts.map +1 -1
- package/dist/measures/timeline-of.js +37 -8
- package/dist/measures/timeline-of.js.map +1 -1
- package/dist/platform-layout/platform-layout.d.ts +2 -0
- package/dist/platform-layout/platform-layout.d.ts.map +1 -1
- package/dist/platform-layout/platform-layout.js +2 -0
- package/dist/platform-layout/platform-layout.js.map +1 -1
- package/dist/presets/no-flags.d.ts.map +1 -1
- package/dist/presets/no-flags.js +1 -0
- package/dist/presets/no-flags.js.map +1 -1
- package/dist/progress/build-next-of.d.ts +9 -0
- package/dist/progress/build-next-of.d.ts.map +1 -0
- package/dist/progress/build-next-of.js +22 -0
- package/dist/progress/build-next-of.js.map +1 -0
- package/dist/progress/format-progress.d.ts.map +1 -1
- package/dist/progress/format-progress.js +3 -0
- package/dist/progress/format-progress.js.map +1 -1
- package/dist/progress/progress.d.ts +3 -1
- package/dist/progress/progress.d.ts.map +1 -1
- package/dist/progress/read-progress.d.ts.map +1 -1
- package/dist/progress/read-progress.js +7 -2
- package/dist/progress/read-progress.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/templates/architecture/extractable.declared.spec.ts.tpl +2 -2
- package/templates/architecture/extractable.manual.spec.ts.tpl +2 -2
- package/templates/architecture/extractable.tsyringe.spec.ts.tpl +2 -2
- package/templates/architecture/hosting.declared.spec.ts.tpl +69 -0
- package/templates/architecture/hosting.manual.spec.ts.tpl +57 -0
- package/templates/architecture/hosting.tsyringe.spec.ts.tpl +69 -0
- package/templates/init/docker/env.example.tpl +8 -0
- package/templates/init/gitignore.tpl +3 -0
- package/templates/init/main.ts.tpl +27 -20
- package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +11 -3
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +25 -4
- package/templates/init/platform/composition/compose-application.tsyringe.ts.tpl +47 -65
- package/templates/init/platform/composition/context-selection.tsyringe.ts.tpl +17 -0
- package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +15 -0
- package/templates/init/platform/composition/platform-options.manual.ts.tpl +9 -0
- package/templates/init/platform/composition/routes-of.tsyringe.ts.tpl +51 -0
- package/templates/init/platform/config/app-config.ts.tpl +7 -0
- package/templates/init/platform/config/load-config.ts.tpl +25 -0
- package/templates/init/platform/files/files.module.tsyringe.ts.tpl +6 -2
- package/templates/init/platform/jobs/job-settings.ts.tpl +13 -3
- package/templates/init/platform/privacy/privacy.module.tsyringe.ts.tpl +9 -6
- package/templates/init/platform/redis/open-redis.ts.tpl +13 -8
- package/templates/job/job.declared.ts.tpl +1 -1
- package/templates/job/job.spec.buses.ts.tpl +3 -0
- package/templates/job/job.spec.tsyringe.ts.tpl +29 -1
- package/templates/job/wiring.manual.tpl +3 -0
- package/templates/job/wiring.tsyringe.tpl +1 -1
- package/templates/pipeline/biome.json.tpl +7 -0
- package/templates/pipeline/knip.json.tpl +1 -0
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/service/compose.tpl +1 -1
- package/templates/service/extracted-name.tpl +2 -0
- package/templates/service/extracted.declared.tpl +6 -0
- package/templates/service/extracted.manual.tpl +2 -0
- package/templates/service/extracted.tsyringe.tpl +6 -0
- package/templates/service/main.ts.tpl +5 -1
- package/templates/worker/main.ts.tpl +20 -13
package/dist/generate/kind.d.ts
CHANGED
|
@@ -54,6 +54,8 @@ export interface KindFlags {
|
|
|
54
54
|
readonly kind?: string;
|
|
55
55
|
/** The adapter carries its resilience policy as standard decorators on its class. */
|
|
56
56
|
readonly decorators: boolean;
|
|
57
|
+
/** A job works across tenants, in none of them: `--global`, where a job of a multi-tenant project runs once per tenant by default. */
|
|
58
|
+
readonly global: boolean;
|
|
57
59
|
/** What an ADR deviates from, as a config key such as `rules.clean/stepdown`. */
|
|
58
60
|
readonly deviation?: string;
|
|
59
61
|
readonly reason?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kind.d.ts","sourceRoot":"","sources":["../../src/generate/kind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,yFAAyF;IACzF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,0GAA0G;IAC1G,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,0DAA0D;IAC1D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CA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MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,4FAA4F;IAC5F,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjD,8KAA8K;IAC9K,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,+GAA+G;IAC/G,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,GAAG,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;CACjC"}
|
|
@@ -2,12 +2,15 @@ import type { Name } from '../../../naming/index.js';
|
|
|
2
2
|
import type { RenderContext } from '../../../templating/index.js';
|
|
3
3
|
import type { Scope } from '../../scope.js';
|
|
4
4
|
import type { SentCommand } from './sent-command.js';
|
|
5
|
+
/** Which tenants a run is for, as the source of the job says it; empty where the project has no tenant. */
|
|
6
|
+
export type JobTenancy = 'per-tenant' | 'global' | undefined;
|
|
5
7
|
export interface JobParts {
|
|
6
8
|
readonly name: Name;
|
|
7
9
|
/** The schedule as the source writes it. */
|
|
8
10
|
readonly schedule: string;
|
|
9
11
|
readonly command: SentCommand;
|
|
12
|
+
readonly tenancy: JobTenancy;
|
|
10
13
|
}
|
|
11
14
|
/** What the templates of a job read; the grant of its system actor is written on the way, where the model allows. */
|
|
12
|
-
export declare function jobVars(scope: Scope, { name, schedule, command }: JobParts): RenderContext;
|
|
15
|
+
export declare function jobVars(scope: Scope, { name, schedule, command, tenancy }: JobParts): RenderContext;
|
|
13
16
|
//# sourceMappingURL=job-vars.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-vars.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/job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 @@ import { grantSystemActor } from './grant-system-actor.js';
|
|
|
2
2
|
import { grantedInSpec } from './granted-in-spec.js';
|
|
3
3
|
const PERIOD = 'which period the work is for is said by `execution.scheduledAt`, never by the clock: an occurrence may run late, or twice';
|
|
4
4
|
/** What the templates of a job read; the grant of its system actor is written on the way, where the model allows. */
|
|
5
|
-
export function jobVars(scope, { name, schedule, command }) {
|
|
5
|
+
export function jobVars(scope, { name, schedule, command, tenancy }) {
|
|
6
6
|
const jobName = `${scope.context.kebab}.${name.kebab}`;
|
|
7
7
|
const actor = command.isProtected ? [`systemActor('${jobName}')`] : [];
|
|
8
8
|
const grant = command.isProtected ? grantSystemActor(scope, jobName, command) : undefined;
|
|
9
9
|
return {
|
|
10
10
|
name: jobName,
|
|
11
11
|
schedule,
|
|
12
|
+
...tenancyVars(schedule, tenancy),
|
|
12
13
|
switch: `JOB_${scope.context.constant}_${name.constant}_ENABLED`,
|
|
13
14
|
command: command.name.pascal,
|
|
14
15
|
commandKebab: command.name.kebab,
|
|
@@ -26,6 +27,15 @@ export function jobVars(scope, { name, schedule, command }) {
|
|
|
26
27
|
grant: grant?.todo ?? '',
|
|
27
28
|
};
|
|
28
29
|
}
|
|
30
|
+
function tenancyVars(schedule, tenancy) {
|
|
31
|
+
return {
|
|
32
|
+
tenancy: tenancy ?? '',
|
|
33
|
+
perTenant: tenancy === 'per-tenant',
|
|
34
|
+
tenanted: tenancy !== undefined,
|
|
35
|
+
// Where the source writes the schedule and the options of the job together (the decorator, the builder).
|
|
36
|
+
scheduled: tenancy === undefined ? schedule : `${schedule.slice(0, -2)}, tenancy: '${tenancy}' }`,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
29
39
|
function todoOf(command) {
|
|
30
40
|
const message = `${command.name.pascal}Command`;
|
|
31
41
|
return command.takesInstant
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-vars.js","sourceRoot":"","sources":["../../../../src/generate/kinds/job/job-vars.ts"],"names":[],"mappings":"AAGA,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AC;AAClI,CAAC"}
|
|
@@ -17,8 +17,8 @@ import { platformPath } from '../platform-path.js';
|
|
|
17
17
|
export const jobKind = {
|
|
18
18
|
name: 'job',
|
|
19
19
|
aliases: [],
|
|
20
|
-
usage: 'job <context> <Name> (--every <duration> | --cron "<expression>" [--time-zone <zone>]) --command <UseCaseName> [--term "<Term>=<meaning>"]...',
|
|
21
|
-
summary: 'A job run by time that sends one command as its own system actor, its spec, its registration, its switch in the job settings of the platform and, where the authorization model makes it one line, the grant of that actor.',
|
|
20
|
+
usage: 'job <context> <Name> (--every <duration> | --cron "<expression>" [--time-zone <zone>]) --command <UseCaseName> [--global] [--term "<Term>=<meaning>"]...',
|
|
21
|
+
summary: 'A job run by time (once per tenant under tenancy, or `--global`) that sends one command as its own system actor, its spec, its registration, its switch in the job settings of the platform and, where the authorization model makes it one line, the grant of that actor.',
|
|
22
22
|
positionals: ['context', 'Name'],
|
|
23
23
|
writesShared: true,
|
|
24
24
|
textFlags: ['command'],
|
|
@@ -31,11 +31,28 @@ export const jobKind = {
|
|
|
31
31
|
const context = vars(scope, {
|
|
32
32
|
name: named(name),
|
|
33
33
|
spec: specVars(scope, { protected: false }),
|
|
34
|
-
job: jobVars(scope, { name, schedule, command }),
|
|
34
|
+
job: jobVars(scope, { name, schedule, command, tenancy: tenancyOf(scope, name) }),
|
|
35
35
|
});
|
|
36
36
|
writeJob(scope, name, context);
|
|
37
37
|
},
|
|
38
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* Under tenancy a job runs once per tenant unless `--global` says it works across them: a global job
|
|
41
|
+
* runs in no tenant, and a tenant-scoped repository refuses to be read there.
|
|
42
|
+
*/
|
|
43
|
+
function tenancyOf(scope, name) {
|
|
44
|
+
const { global } = scope.flags;
|
|
45
|
+
if (scope.config.stack.tenancy === 'none') {
|
|
46
|
+
if (global) {
|
|
47
|
+
throw new CliError('--global means nothing in a project without tenancy.', `Every job runs once there: drop --global from \`generate job ${scope.context.kebab} ${name.pascal}\`.`);
|
|
48
|
+
}
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
scope.ws.note(global
|
|
52
|
+
? `${name.pascal}Job is global (\`tenancy: 'global'\`): it runs once per occurrence, in no tenant, so a tenant-scoped repository refuses it. Drop --global for a job that works one tenant at a time.`
|
|
53
|
+
: `${name.pascal}Job runs per tenant (\`tenancy: 'per-tenant'\`): once per tenant of the TenantDirectory (TENANTS) for each occurrence, each run in the scope of its tenant. Pass --global for work across tenants.`);
|
|
54
|
+
return global ? 'global' : 'per-tenant';
|
|
55
|
+
}
|
|
39
56
|
function commandNamed(scope, name) {
|
|
40
57
|
const { commandName } = scope.flags;
|
|
41
58
|
if (commandName !== undefined && commandName.trim() !== '') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/job-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"job-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/job-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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,CAAC,GAAG,IAAI,CAAC,MAAM,oMAAoM,CACvN,CAAC;IAEF,OAAO,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC;AAC1C,CAAC;AAED,SAAS,YAAY,CAAC,KAAY,EAAE,IAAU;IAC5C,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC;IAEpC,IAAI,WAAW,KAAK,SAAS,IAAI,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC3D,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,MAAM,IAAI,QAAQ,CAChB,wBAAwB,EACxB,oGAAoG,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,yCAAyC,CAChL,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,KAAY,EAAE,IAAU,EAAE,OAAsB;IAChE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE;QACnB,CAAC,gBAAgB,EAAE,0BAA0B,IAAI,CAAC,KAAK,SAAS,CAAC;QACjE;YACE,gBAAgB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,SAAS;YACpF,aAAa,IAAI,CAAC,KAAK,cAAc;SACtC;KACF,CAAC,CAAC;IAEH,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAC5B,WAAW,CAAC,KAAK,CAAC,EAAE,EAAE,YAAY,CAAC,KAAK,EAAE,sBAAsB,CAAC,EAAE,cAAc,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC,CAAC;AAClH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/service-kind.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/service-kind.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAepC,eAAO,MAAM,WAAW,EAAE,IAgCzB,CAAC"}
|
|
@@ -1,32 +1,59 @@
|
|
|
1
1
|
import { CONFIG_FILE } from '../../config/index.js';
|
|
2
|
+
import { inertPersistenceFile } from '../../init/files/inert-persistence-file.js';
|
|
2
3
|
import { renderTemplate } from '../../templating/index.js';
|
|
3
4
|
import { openScope } from '../open-scope.js';
|
|
5
|
+
import { applyWiring } from '../apply-wiring.js';
|
|
6
|
+
import { platformPath } from '../platform-path.js';
|
|
4
7
|
import { vars } from '../vars.js';
|
|
8
|
+
import { wiringFamily } from '../wiring-family.js';
|
|
5
9
|
import { addComposeService } from './extraction/add-compose-service.js';
|
|
6
10
|
import { editJson } from './extraction/edit-json.js';
|
|
7
11
|
import { EntryPoint } from './extraction/entry-point.js';
|
|
8
12
|
import { recordOf } from './extraction/record-of.js';
|
|
9
13
|
import { serviceSelection } from './extraction/service-selection.js';
|
|
14
|
+
const HOSTING_PROOF = 'test/architecture/hosting.spec.ts';
|
|
10
15
|
export const serviceKind = {
|
|
11
16
|
name: 'service',
|
|
12
17
|
aliases: [],
|
|
13
18
|
usage: 'service <context>',
|
|
14
|
-
summary: 'The context run alone, with its scheduled jobs: its entry point under apps/, a start script, a compose service,
|
|
19
|
+
summary: 'The context run alone, with its scheduled jobs: its entry point under apps/, a start script, a compose service, `deployable` in the config, and its departure from the whole application (consumers, processes and jobs run once).',
|
|
15
20
|
positionals: ['context'],
|
|
16
21
|
writesShared: true,
|
|
17
22
|
run: (request) => {
|
|
18
23
|
const scope = openScope(request);
|
|
19
24
|
const { ws, config, context } = scope;
|
|
20
25
|
const entry = new EntryPoint(config, context.kebab);
|
|
21
|
-
const service = { ...serviceSelection(scope), portVariable:
|
|
26
|
+
const service = { ...serviceSelection(scope), portVariable: `\${${context.constant}_PORT:-3001}` };
|
|
22
27
|
ws.create(entry.source, renderTemplate('service/main.ts.tpl', vars(scope, { service })));
|
|
23
28
|
entry.declareIn(ws);
|
|
24
29
|
editJson(ws, CONFIG_FILE, (raw) => markDeployable(raw, context.kebab));
|
|
25
30
|
addComposeService(ws, context.kebab, renderTemplate('service/compose.tpl', vars(scope, { service })));
|
|
31
|
+
leaveTheWholeApplication(scope);
|
|
26
32
|
ws.note(`Build the image of the service with \`docker build --build-arg ENTRY=${entry.compiled} .\`, or start it with \`docker compose --profile services up ${context.kebab}\`.`);
|
|
27
|
-
ws.note(`The service takes the scheduled jobs of ${context.kebab} with it: it runs them unless RUN_JOBS=false, and no job of another context.`);
|
|
33
|
+
ws.note(`The service takes the scheduled jobs of ${context.kebab} with it: it runs them unless RUN_JOBS=false, and no job of another context nor of the platform (audit.archive, privacy.purge-expired stay with the whole application).`);
|
|
34
|
+
ws.note(`${context.pascal} leaves the application of src/main.ts and the worker: \`hostedContexts\` of the composition root omits it, so its consumers, its processes, its jobs and its routes run in the service only. \`everyContext\` stays the full list for the contracts and the end-to-end tests. Set the same DEPLOYMENT_NAME in every container, and a different OTEL_SERVICE_NAME.`);
|
|
28
35
|
},
|
|
29
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* The context stops being hosted by the whole application: the root of `main.ts` and of the worker
|
|
39
|
+
* composes `hostedContexts`, the settings of its jobs leave the whole application, and a proof
|
|
40
|
+
* composes both roots and checks that nothing is registered twice.
|
|
41
|
+
*/
|
|
42
|
+
function leaveTheWholeApplication(scope) {
|
|
43
|
+
const { ws, config } = scope;
|
|
44
|
+
const rendered = vars(scope, {});
|
|
45
|
+
applyWiring(ws, platformPath(scope, 'composition/compose-application.ts'), renderTemplate(`service/extracted.${wiringFamily(config)}.tpl`, rendered));
|
|
46
|
+
applyWiring(ws, platformPath(scope, 'jobs/job-settings.ts'), renderTemplate('service/extracted-name.tpl', rendered));
|
|
47
|
+
const inert = inertPersistenceFile(config);
|
|
48
|
+
// A project without HTTP on tsyringe composes nothing without a database until now: the proof needs the inert one.
|
|
49
|
+
if (inert !== undefined && !ws.exists(inert[0])) {
|
|
50
|
+
ws.create(inert[0], renderTemplate(inert[1], rendered));
|
|
51
|
+
}
|
|
52
|
+
if (!ws.exists(HOSTING_PROOF)) {
|
|
53
|
+
ws.create(HOSTING_PROOF, renderTemplate(`architecture/hosting.${wiringFamily(config)}.spec.ts.tpl`, rendered));
|
|
54
|
+
}
|
|
55
|
+
applyWiring(ws, HOSTING_PROOF, renderTemplate('service/extracted-name.tpl', rendered));
|
|
56
|
+
}
|
|
30
57
|
function markDeployable(raw, context) {
|
|
31
58
|
const contexts = recordOf(raw['contexts']);
|
|
32
59
|
raw['contexts'] = { ...contexts, [context]: { ...recordOf(contexts[context]), deployable: true } };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/service-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"service-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/service-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EA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AAC,EAAE,CAAC;QAC9B,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC,wBAAwB,YAAY,CAAC,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC;IACjH,CAAC;IAED,WAAW,CAAC,EAAE,EAAE,aAAa,EAAE,cAAc,CAAC,4BAA4B,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzF,CAAC;AAED,SAAS,cAAc,CAAC,GAA4B,EAAE,OAAe;IACnE,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;IAE3C,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;AACrG,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Config } from '../../config/index.js';
|
|
2
|
+
import type { InitFile } from './init-file.js';
|
|
3
|
+
/** The inert persistence of the project's ORM, for what composes the application later than `init` (a service and its proof). */
|
|
4
|
+
export declare function inertPersistenceFile(config: Config): InitFile | undefined;
|
|
5
|
+
//# sourceMappingURL=inert-persistence-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inert-persistence-file.d.ts","sourceRoot":"","sources":["../../../src/init/files/inert-persistence-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAa5C,iIAAiI;AACjI,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAIzE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { platformFile } from './platform-file.js';
|
|
2
|
+
/** How each ORM opens a connection that is never used: the variant of the template of its inert persistence. */
|
|
3
|
+
const OPENING = {
|
|
4
|
+
none: 'memory',
|
|
5
|
+
custom: 'memory',
|
|
6
|
+
drizzle: 'pooled',
|
|
7
|
+
knex: 'pooled',
|
|
8
|
+
prisma: 'prisma',
|
|
9
|
+
typeorm: 'typeorm',
|
|
10
|
+
};
|
|
11
|
+
/** The inert persistence of the project's ORM, for what composes the application later than `init` (a service and its proof). */
|
|
12
|
+
export function inertPersistenceFile(config) {
|
|
13
|
+
const opening = OPENING[config.stack.orm];
|
|
14
|
+
return opening === undefined ? undefined : platformFile(config, 'database/inert-persistence.ts', opening);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=inert-persistence-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inert-persistence-file.js","sourceRoot":"","sources":["../../../src/init/files/inert-persistence-file.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,gHAAgH;AAChH,MAAM,OAAO,GAAqC;IAChD,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF,iIAAiI;AACjI,MAAM,UAAU,oBAAoB,CAAC,MAAc;IACjD,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE1C,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,+BAA+B,EAAE,OAAO,CAAC,CAAC;AAC5G,CAAC"}
|
|
@@ -49,7 +49,11 @@ function fileStorageFiles(config) {
|
|
|
49
49
|
...when(http !== 'none', [file('files/file-routes.ts')]),
|
|
50
50
|
];
|
|
51
51
|
}
|
|
52
|
-
const TSYRINGE = [
|
|
52
|
+
const TSYRINGE = [
|
|
53
|
+
'composition/platform.module.ts',
|
|
54
|
+
'composition/platform-test.module.ts',
|
|
55
|
+
'composition/context-selection.ts',
|
|
56
|
+
];
|
|
53
57
|
const MANUAL = ['composition/platform.ts', 'composition/platform-options.ts', 'composition/create-platform.ts'];
|
|
54
58
|
/** The same map in both families: what exists before anything else, and the chain around each bus. */
|
|
55
59
|
const BOTH = ['composition/lay-foundations.ts', 'buses/create-command-bus.ts', 'buses/create-query-bus.ts'];
|
|
@@ -63,6 +67,7 @@ function compositionFiles(config) {
|
|
|
63
67
|
...BOTH.map((name) => file(name, family)),
|
|
64
68
|
...own.map((name) => file(name, family)),
|
|
65
69
|
...when(config.stack.http !== 'none', [file('composition/platform-error-mapper.ts')]),
|
|
70
|
+
...when(family !== 'manual' && config.stack.http !== 'none', [file('composition/routes-of.ts', family)]),
|
|
66
71
|
...when(family === 'manual', [
|
|
67
72
|
file('events/platform-events.ts'),
|
|
68
73
|
file('jobs/configured-job-scheduler.ts'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-files.js","sourceRoot":"","sources":["../../../src/init/files/platform-files.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,iJAAiJ;AACjJ,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,OAAgB,EAAY,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAE/F,OAAO;QACL,CAAC,GAAG,MAAM,CAAC,UAAU,UAAU,EAAE,kBAAkB,CAAC;QACpD,IAAI,CAAC,0BAA0B,CAAC;QAChC,IAAI,CAAC,sBAAsB,CAAC;QAC5B,GAAG;YACD,sBAAsB;YACtB,u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ACF,GAAG,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;KACrE,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,MAAc;IAC/B,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC;IACrE,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,OAAgB,EAAY,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAE/F,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO;QACL,IAAI,CAAC,2BAA2B,EAAE,IAAI,CAAC;QACvC,GAAG,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,CAAC;QAC7D,GAAG,IAAI,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,CAAC;QAChE,GAAG,IAAI,CAAC,KAAK,KAAK,OAAO,EAAE,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC,CAAC;QACnE,GAAG,IAAI,CAAC,eAAe,KAAK,YAAY,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC;QAC9F,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;KACtD,CAAC;AACJ,CAAC"}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
/** Ranges written to the generated package.json; bumped together with the kit. */
|
|
2
2
|
export const VERSIONS = {
|
|
3
|
-
'@ddd-ts-kit/kernel': '^0.
|
|
4
|
-
'@ddd-ts-kit/validation': '^0.
|
|
5
|
-
'@ddd-ts-kit/http': '^0.
|
|
6
|
-
'@ddd-ts-kit/tracing': '^0.
|
|
7
|
-
'@ddd-ts-kit/di': '^0.
|
|
8
|
-
'@ddd-ts-kit/events': '^0.
|
|
9
|
-
'@ddd-ts-kit/testing': '^0.
|
|
10
|
-
'@ddd-ts-kit/drizzle': '^0.
|
|
11
|
-
'@ddd-ts-kit/knex': '^0.
|
|
12
|
-
'@ddd-ts-kit/prisma': '^0.
|
|
13
|
-
'@ddd-ts-kit/typeorm': '^0.
|
|
14
|
-
'@ddd-ts-kit/auth': '^0.
|
|
15
|
-
'@ddd-ts-kit/rabbitmq': '^0.
|
|
16
|
-
'@ddd-ts-kit/aspects': '^0.
|
|
17
|
-
'@ddd-ts-kit/audit': '^0.
|
|
18
|
-
'@ddd-ts-kit/redis': '^0.
|
|
19
|
-
'@ddd-ts-kit/kafka': '^0.
|
|
20
|
-
'@ddd-ts-kit/nats': '^0.
|
|
21
|
-
'@ddd-ts-kit/scheduling': '^0.
|
|
22
|
-
'@ddd-ts-kit/sentry': '^0.
|
|
23
|
-
'@ddd-ts-kit/s3': '^0.
|
|
3
|
+
'@ddd-ts-kit/kernel': '^0.93.0',
|
|
4
|
+
'@ddd-ts-kit/validation': '^0.93.0',
|
|
5
|
+
'@ddd-ts-kit/http': '^0.93.0',
|
|
6
|
+
'@ddd-ts-kit/tracing': '^0.93.0',
|
|
7
|
+
'@ddd-ts-kit/di': '^0.93.0',
|
|
8
|
+
'@ddd-ts-kit/events': '^0.93.0',
|
|
9
|
+
'@ddd-ts-kit/testing': '^0.93.0',
|
|
10
|
+
'@ddd-ts-kit/drizzle': '^0.93.0',
|
|
11
|
+
'@ddd-ts-kit/knex': '^0.93.0',
|
|
12
|
+
'@ddd-ts-kit/prisma': '^0.93.0',
|
|
13
|
+
'@ddd-ts-kit/typeorm': '^0.93.0',
|
|
14
|
+
'@ddd-ts-kit/auth': '^0.93.0',
|
|
15
|
+
'@ddd-ts-kit/rabbitmq': '^0.93.0',
|
|
16
|
+
'@ddd-ts-kit/aspects': '^0.93.0',
|
|
17
|
+
'@ddd-ts-kit/audit': '^0.93.0',
|
|
18
|
+
'@ddd-ts-kit/redis': '^0.93.0',
|
|
19
|
+
'@ddd-ts-kit/kafka': '^0.93.0',
|
|
20
|
+
'@ddd-ts-kit/nats': '^0.93.0',
|
|
21
|
+
'@ddd-ts-kit/scheduling': '^0.93.0',
|
|
22
|
+
'@ddd-ts-kit/sentry': '^0.93.0',
|
|
23
|
+
'@ddd-ts-kit/s3': '^0.93.0',
|
|
24
24
|
'@aws-sdk/client-s3': '^3.1150.0',
|
|
25
25
|
'@aws-sdk/lib-storage': '^3.1150.0',
|
|
26
26
|
'@aws-sdk/s3-request-presigner': '^3.1150.0',
|
|
27
27
|
busboy: '^1.6.0',
|
|
28
28
|
'@sentry/node': '^11.6.0',
|
|
29
|
-
'@ddd-ts-kit/pino': '^0.
|
|
29
|
+
'@ddd-ts-kit/pino': '^0.93.0',
|
|
30
30
|
pino: '^10.4.0',
|
|
31
31
|
'pino-pretty': '^13.2.0',
|
|
32
|
-
'@ddd-ts-kit/winston': '^0.
|
|
32
|
+
'@ddd-ts-kit/winston': '^0.93.0',
|
|
33
33
|
winston: '^3.19.0',
|
|
34
34
|
'@confluentinc/kafka-javascript': '^1.11.0',
|
|
35
35
|
'@nats-io/jetstream': '^3.4.0',
|
|
@@ -40,7 +40,7 @@ export const VERSIONS = {
|
|
|
40
40
|
'passport-jwt': '^4.0.1',
|
|
41
41
|
'@types/passport-jwt': '^4.0.1',
|
|
42
42
|
amqplib: '^2.2.0',
|
|
43
|
-
'ddd-ts-kit': '^0.
|
|
43
|
+
'ddd-ts-kit': '^0.93.0',
|
|
44
44
|
tsx: '^4.23.15',
|
|
45
45
|
vitest: '^5.0.3',
|
|
46
46
|
'fast-check': '^4.10.2',
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { BranchCommit } from './branch-commit.js';
|
|
2
2
|
import type { Repository } from './repository.js';
|
|
3
3
|
/**
|
|
4
|
-
* Every commit of the current branch,
|
|
5
|
-
*
|
|
4
|
+
* Every commit of the current branch, parents first, with the files each one changed under the
|
|
5
|
+
* folders the measures read: one `git log` for the commits, one for their files, so that a store
|
|
6
|
+
* versioned once in the history does not weigh on the answer. Empty outside a repository, or when
|
|
7
|
+
* git is not installed.
|
|
6
8
|
*/
|
|
7
9
|
export declare function branchCommits({ root, git }: Repository): BranchCommit[];
|
|
8
10
|
//# sourceMappingURL=branch-commits.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branch-commits.d.ts","sourceRoot":"","sources":["../../src/measures/branch-commits.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"branch-commits.d.ts","sourceRoot":"","sources":["../../src/measures/branch-commits.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO/C;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,UAAU,GAAG,YAAY,EAAE,CAqBvE"}
|
|
@@ -1,17 +1,41 @@
|
|
|
1
|
+
import { ACCEPTANCE_DIR } from '../acceptance/acceptance-file-of.js';
|
|
1
2
|
const FORMAT = '--format=%x1e%H%x1f%P%x1f%cI%x1f%an%x1f%s%x1f%(trailers:key=Slice,valueonly,separator=%x2C)';
|
|
3
|
+
/** The folders whose files the measures read: the stories, their reviews, the incidents, the acceptance specs and locks. */
|
|
4
|
+
const READ_FOLDERS = ['docs/architecture', ACCEPTANCE_DIR];
|
|
2
5
|
/**
|
|
3
|
-
* Every commit of the current branch,
|
|
4
|
-
*
|
|
6
|
+
* Every commit of the current branch, parents first, with the files each one changed under the
|
|
7
|
+
* folders the measures read: one `git log` for the commits, one for their files, so that a store
|
|
8
|
+
* versioned once in the history does not weigh on the answer. Empty outside a repository, or when
|
|
9
|
+
* git is not installed.
|
|
5
10
|
*/
|
|
6
11
|
export function branchCommits({ root, git }) {
|
|
7
|
-
const
|
|
8
|
-
|
|
12
|
+
const commits = git(root, ['log', FORMAT, '--topo-order', '--reverse', 'HEAD']) ?? '';
|
|
13
|
+
const named = git(root, [
|
|
14
|
+
'log',
|
|
15
|
+
'--format=%x1e%H',
|
|
16
|
+
'--name-only',
|
|
17
|
+
'--no-renames',
|
|
18
|
+
'--full-history',
|
|
19
|
+
'HEAD',
|
|
20
|
+
'--',
|
|
21
|
+
...READ_FOLDERS,
|
|
22
|
+
]) ?? '';
|
|
23
|
+
const files = filesByCommit(named);
|
|
24
|
+
return commits
|
|
9
25
|
.split('\x1e')
|
|
10
|
-
.map((record) => commitOf(record))
|
|
26
|
+
.map((record) => commitOf(record, files))
|
|
11
27
|
.filter((commit) => commit !== undefined);
|
|
12
28
|
}
|
|
13
|
-
function
|
|
14
|
-
const
|
|
29
|
+
function filesByCommit(output) {
|
|
30
|
+
const files = new Map();
|
|
31
|
+
for (const record of output.split('\x1e')) {
|
|
32
|
+
const [sha = '', ...lines] = record.split('\n');
|
|
33
|
+
files.set(sha.trim(), lines.map((line) => line.trim()).filter((line) => line !== ''));
|
|
34
|
+
}
|
|
35
|
+
return files;
|
|
36
|
+
}
|
|
37
|
+
function commitOf(record, files) {
|
|
38
|
+
const [header = ''] = record.split('\n');
|
|
15
39
|
const [sha = '', parents = '', date = '', author = '', subject = '', trailers = ''] = header.split('\x1f');
|
|
16
40
|
if (sha === '') {
|
|
17
41
|
return undefined;
|
|
@@ -26,7 +50,7 @@ function commitOf(record) {
|
|
|
26
50
|
.split(',')
|
|
27
51
|
.map((slice) => slice.trim().replace(/^#/, ''))
|
|
28
52
|
.filter((slice) => slice !== ''),
|
|
29
|
-
files:
|
|
53
|
+
files: [...(files.get(sha) ?? [])],
|
|
30
54
|
};
|
|
31
55
|
}
|
|
32
56
|
//# sourceMappingURL=branch-commits.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branch-commits.js","sourceRoot":"","sources":["../../src/measures/branch-commits.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"branch-commits.js","sourceRoot":"","sources":["../../src/measures/branch-commits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAIlE,MAAM,MAAM,GAAG,6FAA6F,CAAC;AAE7G,4HAA4H;AAC5H,MAAM,YAAY,GAAG,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,IAAI,EAAE,GAAG,EAAc;IACrD,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IAEtF,MAAM,KAAK,GACT,GAAG,CAAC,IAAI,EAAE;QACR,KAAK;QACL,iBAAiB;QACjB,aAAa;QACb,cAAc;QACd,gBAAgB;QAChB,MAAM;QACN,IAAI;QACJ,GAAG,YAAY;KAChB,CAAC,IAAI,EAAE,CAAC;IAEX,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAEnC,OAAO,OAAO;SACX,KAAK,CAAC,MAAM,CAAC;SACb,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;SACxC,MAAM,CAAC,CAAC,MAAM,EAA0B,EAAE,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,aAAa,CAAC,MAAc;IACnC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAoB,CAAC;IAE1C,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1C,MAAM,CAAC,GAAG,GAAG,EAAE,EAAE,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CA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,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;KACnC,CAAC;AACJ,CAAC"}
|
|
@@ -4,8 +4,9 @@ import type { StoryHistory } from './story-history.js';
|
|
|
4
4
|
import type { Timeline } from './timeline.js';
|
|
5
5
|
/**
|
|
6
6
|
* Design: the first commit of the story file to the commit of its lock. Build: the lock to the
|
|
7
|
-
* first commit whose `## Report` holds text. Lead: the first commit to the
|
|
8
|
-
*
|
|
7
|
+
* first commit whose `## Report` holds text. Lead: the first commit to the close, the first commit
|
|
8
|
+
* of the first-parent history of the branch that contains the last commit of the story, whatever
|
|
9
|
+
* its subject (a merge, a squash); a story with no report is not closed.
|
|
9
10
|
*/
|
|
10
11
|
export declare function timelineOf(repository: Repository, history: StoryHistory, branch: readonly BranchCommit[]): Timeline;
|
|
11
12
|
//# sourceMappingURL=timeline-of.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-of.d.ts","sourceRoot":"","sources":["../../src/measures/timeline-of.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C
|
|
1
|
+
{"version":3,"file":"timeline-of.d.ts","sourceRoot":"","sources":["../../src/measures/timeline-of.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,QAAQ,CAmBnH"}
|
|
@@ -3,8 +3,9 @@ import { fileAt } from './file-at.js';
|
|
|
3
3
|
import { hours } from './hours.js';
|
|
4
4
|
/**
|
|
5
5
|
* Design: the first commit of the story file to the commit of its lock. Build: the lock to the
|
|
6
|
-
* first commit whose `## Report` holds text. Lead: the first commit to the
|
|
7
|
-
*
|
|
6
|
+
* first commit whose `## Report` holds text. Lead: the first commit to the close, the first commit
|
|
7
|
+
* of the first-parent history of the branch that contains the last commit of the story, whatever
|
|
8
|
+
* its subject (a merge, a squash); a story with no report is not closed.
|
|
8
9
|
*/
|
|
9
10
|
export function timelineOf(repository, history, branch) {
|
|
10
11
|
const { files, commits } = history;
|
|
@@ -14,7 +15,7 @@ export function timelineOf(repository, history, branch) {
|
|
|
14
15
|
}
|
|
15
16
|
const lock = commits.lock;
|
|
16
17
|
const report = commits.ofStoryFile.find((commit) => reported(repository, commit, files.file));
|
|
17
|
-
const merged =
|
|
18
|
+
const merged = report === undefined ? undefined : closeOf(history.commits.all, branch);
|
|
18
19
|
return {
|
|
19
20
|
opened: new Date(first.at).toISOString(),
|
|
20
21
|
author: first.author,
|
|
@@ -27,10 +28,38 @@ export function timelineOf(repository, history, branch) {
|
|
|
27
28
|
function reported(repository, commit, file) {
|
|
28
29
|
return (sectionOf(fileAt(repository, commit.sha, file) ?? '', 'Report') ?? '').trim() !== '';
|
|
29
30
|
}
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
/**
|
|
32
|
+
* The first commit of the first-parent history of the branch that has the last commit of the story
|
|
33
|
+
* among its ancestors (or is it). Parents come first in `branch`, so one pass marks every commit
|
|
34
|
+
* that contains it. A merge of the trunk into the story branch never contains it before the story
|
|
35
|
+
* ends, and a squash merge, which carries the files of the story itself, is the last commit.
|
|
36
|
+
*/
|
|
37
|
+
function closeOf(own, branch) {
|
|
38
|
+
const last = own.at(-1);
|
|
39
|
+
const head = branch.at(-1);
|
|
40
|
+
if (last === undefined || head === undefined) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
const containing = containingSet(last, branch);
|
|
44
|
+
const bySha = new Map(branch.map((commit) => [commit.sha, commit]));
|
|
45
|
+
let close;
|
|
46
|
+
for (let at = containing.has(head.sha) ? head : undefined; at !== undefined;) {
|
|
47
|
+
close = at;
|
|
48
|
+
at = bySha.get(at.parents[0] ?? '');
|
|
49
|
+
if (at !== undefined && !containing.has(at.sha)) {
|
|
50
|
+
at = undefined;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return close;
|
|
54
|
+
}
|
|
55
|
+
/** The shas of the commits that are `last` or have it among their ancestors; parents come first in `branch`. */
|
|
56
|
+
function containingSet(last, branch) {
|
|
57
|
+
const containing = new Set();
|
|
58
|
+
for (const commit of branch) {
|
|
59
|
+
if (commit.sha === last.sha || commit.parents.some((parent) => containing.has(parent))) {
|
|
60
|
+
containing.add(commit.sha);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return containing;
|
|
35
64
|
}
|
|
36
65
|
//# sourceMappingURL=timeline-of.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-of.js","sourceRoot":"","sources":["../../src/measures/timeline-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKhC
|
|
1
|
+
{"version":3,"file":"timeline-of.js","sourceRoot":"","sources":["../../src/measures/timeline-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,KAAK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CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAEpC,IAAI,EAAE,KAAK,SAAS,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;YAChD,EAAE,GAAG,SAAS,CAAC;QACjB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,gHAAgH;AAChH,SAAS,aAAa,CAAC,IAAkB,EAAE,MAA+B;IACxE,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IAErC,KAAK,MAAM,MAAM,IAAI,MAAM,EAAE,CAAC;QAC5B,IAAI,MAAM,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;YACvF,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -37,6 +37,8 @@ export declare const PLATFORM_LAYOUT: readonly [{
|
|
|
37
37
|
readonly anchor: 'compose-application.ts';
|
|
38
38
|
readonly files: {
|
|
39
39
|
readonly 'compose-application.ts': 'composition/compose-application.ts';
|
|
40
|
+
readonly 'context-selection.ts': 'composition/context-selection.ts';
|
|
41
|
+
readonly 'routes-of.ts': 'composition/routes-of.ts';
|
|
40
42
|
readonly 'platform.module.ts': 'composition/platform.module.ts';
|
|
41
43
|
readonly 'platform-test.module.ts': 'composition/platform-test.module.ts';
|
|
42
44
|
readonly 'platform-error-mapper.ts': 'composition/platform-error-mapper.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-layout.d.ts","sourceRoot":"","sources":["../../src/platform-layout/platform-layout.ts"],"names":[],"mappings":"AAA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