Skip to content

Commit

Permalink
chore(ci): fix CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nfroidure committed Aug 11, 2023
1 parent ab9114e commit 9936d33
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 27 deletions.
14 changes: 7 additions & 7 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ It is designed to have a low footprint on services code.
at all since they are just simple functions with annotations
set as a property.

[See in context](./src/index.ts#L155-L171)
[See in context](./src/index.ts#L156-L172)



Expand All @@ -49,7 +49,7 @@ A service provider is full of state since its concern is
[encapsulate](https://en.wikipedia.org/wiki/Encapsulation_(computer_programming))
your application global states.

[See in context](./src/index.ts#L173-L182)
[See in context](./src/index.ts#L174-L183)



Expand All @@ -75,7 +75,7 @@ A service provider is full of state since its concern is
`Knifecycle` provides a set of decorators that allows you to simply
create new initializers.

[See in context](./src/util.ts#L8-L29)
[See in context](./src/util.ts#L9-L30)



Expand All @@ -89,7 +89,7 @@ The `?` flag indicates an optional dependency.
It allows to write generic services with fixed
dependencies and remap their name at injection time.

[See in context](./src/util.ts#L1301-L1310)
[See in context](./src/util.ts#L1302-L1311)



Expand Down Expand Up @@ -117,7 +117,7 @@ Initializers can be of three types:
executions silos using them (we will cover this
topic later on).

[See in context](./src/index.ts#L249-L272)
[See in context](./src/index.ts#L250-L273)



Expand All @@ -133,7 +133,7 @@ Depending on your application design, you could run it
in only one execution silo or into several ones
according to the isolation level your wish to reach.

[See in context](./src/index.ts#L536-L546)
[See in context](./src/index.ts#L537-L547)



Expand Down Expand Up @@ -169,5 +169,5 @@ Sadly TypeScript does not allow to add generic types
For more details, see:
https://stackoverflow.com/questions/64948037/generics-type-loss-while-infering/64950184#64950184

[See in context](./src/util.ts#L1371-L1382)
[See in context](./src/util.ts#L1372-L1383)

39 changes: 19 additions & 20 deletions src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,34 +136,33 @@ export async function initialize(services = {}) {${batches
(batch, index) => `
// Initialization batch #${index}
const batch${index} = {${batch
.map((name) => {
if (
'constant' ===
dependenciesHash[name].__initializer[SPECIAL_PROPS.TYPE]
) {
return `
.map((name) => {
if (
'constant' === dependenciesHash[name].__initializer[SPECIAL_PROPS.TYPE]
) {
return `
${name}: Promise.resolve(${name}),`;
}
return `
}
return `
${name}: ${dependenciesHash[name].__initializerName}({${
dependenciesHash[name].__inject
? `${dependenciesHash[name].__inject
.map(parseDependencyDeclaration)
.map(
({ serviceName, mappedName }) =>
`
dependenciesHash[name].__inject
? `${dependenciesHash[name].__inject
.map(parseDependencyDeclaration)
.map(
({ serviceName, mappedName }) =>
`
${serviceName}: services['${mappedName}'],`,
)
.join('')}`
: ''
}
)
.join('')}`
: ''
}
})${
'provider' === dependenciesHash[name].__type
? '.then(provider => provider.service)'
: ''
},`;
})
.join('')}
})
.join('')}
};
await Promise.all(
Expand Down
1 change: 1 addition & 0 deletions src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint max-nested-callbacks:0 */
import { describe, beforeEach, test } from '@jest/globals';
import assert from 'assert';
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint max-len: ["warn", { "ignoreComments": true }] @typescript-eslint/no-this-alias: "warn" */
import {
SPECIAL_PROPS,
Expand Down
2 changes: 2 additions & 0 deletions src/util.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { describe, test } from '@jest/globals';
import assert from 'assert';
import sinon from 'sinon';
Expand Down
1 change: 1 addition & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint @typescript-eslint/ban-types:0 */

import { YError } from 'yerror';
Expand Down

0 comments on commit 9936d33

Please sign in to comment.