Skip to content

Commit

Permalink
refactor(files): moves files in a cleaner structure
Browse files Browse the repository at this point in the history
The structure is corresponding to the one used for Whook's plugins which allows to load services automatically.
  • Loading branch information
nfroidure committed Feb 24, 2024
1 parent cc5a5e1 commit 81a795f
Show file tree
Hide file tree
Showing 25 changed files with 1,364 additions and 2,166 deletions.
9 changes: 4 additions & 5 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,10 @@ Instantiate the logging service
**Kind**: global function
**Returns**: <code>Promise.&lt;function()&gt;</code> - A promise of the logging function
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> | | The services to inject |
| services.logger | <code>Object</code> | | The logger object that output the logs |
| [services.debug] | <code>function</code> | <code>noop</code> | A debugging function |
| Param | Type | Description |
| --- | --- | --- |
| services | <code>Object</code> | The services to inject |
| services.logger | <code>Object</code> | The logger object that output the logs |
**Example**
```js
Expand Down
21 changes: 12 additions & 9 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ I prefer using a unique function with the `log` type
If provided, I route debug messages to the `debug`
node module.

[See in context](./src/log.ts#L53-L63)
[See in context](./src/services/log.ts#L53-L63)



Expand All @@ -55,7 +55,7 @@ The `time` service is just proxying [`Date.now`
](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/now)
in a stubbable manner.

[See in context](./src/time.ts#L12-L17)
[See in context](./src/services/time.ts#L9-L14)



Expand All @@ -65,7 +65,7 @@ The `random` service is just proxying [`Math.random`
](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Math/random)
in a stubbable manner.

[See in context](./src/random.ts#L12-L17)
[See in context](./src/services/random.ts#L9-L14)



Expand All @@ -74,7 +74,7 @@ The `random` service is just proxying [`Math.random`
The `delay` service is `setTimeout` like I would like it
to be.

[See in context](./src/delay.ts#L18-L22)
[See in context](./src/services/delay.ts#L15-L19)



Expand All @@ -84,7 +84,7 @@ The `resolve` service is just proxying [`import.meta.resolve`
](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Operators/import.meta/resolve)
in a stubbable manner.

[See in context](./src/resolve.ts#L8-L13)
[See in context](./src/services/resolve.ts#L5-L10)



Expand All @@ -94,7 +94,7 @@ The `importer` service is just proxying [`import`
](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Operators/import)
in a stubbable manner.

[See in context](./src/importer.ts#L9-L14)
[See in context](./src/services/importer.ts#L6-L11)



Expand All @@ -105,7 +105,10 @@ The `codeGenerator` service provide a service
a character set that avoid recognition
mistake by humans.

[See in context](./src/codeGenerator.ts#L20-L26)
It generates codes that contains only easily
recognizable chars (by example, no `0` nor `O`).

[See in context](./src/services/codeGenerator.ts#L17-L26)



Expand All @@ -121,7 +124,7 @@ The release is done by its key and the current lock is removed. There
said, it should not be hard to handle since the actual behavior of
the library makes your code run sequentially.

[See in context](./src/lock.ts#L28-L39)
[See in context](./src/services/lock.ts#L27-L38)



Expand All @@ -135,5 +138,5 @@ The count are returned asynchronously in order
if needed later via another service with the same
surface API.

[See in context](./src/counter.ts#L23-L32)
[See in context](./src/services/counter.ts#L20-L29)

9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,10 @@ Instantiate the logging service
**Kind**: global function
**Returns**: <code>Promise.&lt;function()&gt;</code> - A promise of the logging function
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> | | The services to inject |
| services.logger | <code>Object</code> | | The logger object that output the logs |
| [services.debug] | <code>function</code> | <code>noop</code> | A debugging function |
| Param | Type | Description |
| --- | --- | --- |
| services | <code>Object</code> | The services to inject |
| services.logger | <code>Object</code> | The logger object that output the logs |
**Example**
```js
Expand Down
Loading

0 comments on commit 81a795f

Please sign in to comment.