Skip to content

Commit 1d8019a

Browse files
authored
adjust line width and correct typo in whitepaper (#6)
1 parent c835193 commit 1d8019a

5 files changed

Lines changed: 25 additions & 34 deletions

File tree

deno.jsonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
},
2929
"fmt": {
3030
"indentWidth": 4,
31+
"lineWidth": 100,
3132
"useTabs": true,
3233
"singleQuote": true,
3334
"proseWrap": "never"

skill/example/BaseModule.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import type { Container } from '@needle-di/core';
22
import type { BaseOptions } from './index.ts';
3-
import type {
4-
General,
5-
GeneralObject,
6-
ModuleInput as MI,
7-
Orchestratable,
8-
} from './types.ts';
3+
import type { General, GeneralObject, ModuleInput as MI, Orchestratable } from './types.ts';
94
import type { Hook } from './utilities.ts';
105

116
type ModuleInput = MI<GeneralModuleCtor>;

skill/example/types.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ export type GeneralArray = ReadonlyArray<General>;
55
export type GeneralObject = object;
66
export type GeneralConstructor = new (...args: General[]) => General;
77

8-
type UnionToIntersection<U> =
9-
(U extends General ? (k: U) => void : never) extends (
10-
k: infer I,
11-
) => void ? I
12-
: never;
8+
type UnionToIntersection<U> = (U extends General ? (k: U) => void : never) extends (
9+
k: infer I,
10+
) => void ? I
11+
: never;
1312

1413
type GeneralModuleInput =
1514
| ReadonlyArray<GeneralConstructor>
@@ -19,8 +18,9 @@ export type ModuleInput<T extends GeneralConstructor> =
1918
| ReadonlyArray<T>
2019
| ReadonlyArray<InstanceType<T>>;
2120

22-
type Instances<T extends GeneralModuleInput> = T extends
23-
ReadonlyArray<GeneralConstructor> ? InstanceType<T[number]> : T[number];
21+
type Instances<T extends GeneralModuleInput> = T extends ReadonlyArray<GeneralConstructor>
22+
? InstanceType<T[number]>
23+
: T[number];
2424

2525
export type Orchestratable<
2626
T extends GeneralModuleInput,

skill/start.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ export type GeneralArray = ReadonlyArray<General>;
6262
export type GeneralObject = object;
6363
export type GeneralConstructor = new (...args: General[]) => General;
6464

65-
type UnionToIntersection<U> =
66-
(U extends General ? (k: U) => void : never) extends (
67-
k: infer I,
68-
) => void ? I
69-
: never;
65+
type UnionToIntersection<U> = (U extends General ? (k: U) => void : never) extends (
66+
k: infer I,
67+
) => void ? I
68+
: never;
7069

7170
type GeneralModuleInput =
7271
| ReadonlyArray<GeneralConstructor>
@@ -76,8 +75,9 @@ export type ModuleInput<T extends GeneralConstructor> =
7675
| ReadonlyArray<T>
7776
| ReadonlyArray<InstanceType<T>>;
7877

79-
type Instances<T extends GeneralModuleInput> = T extends
80-
ReadonlyArray<GeneralConstructor> ? InstanceType<T[number]> : T[number];
78+
type Instances<T extends GeneralModuleInput> = T extends ReadonlyArray<GeneralConstructor>
79+
? InstanceType<T[number]>
80+
: T[number];
8181

8282
export type Orchestratable<
8383
T extends GeneralModuleInput,
@@ -170,12 +170,7 @@ Create `BaseModule.ts` per the file system convention and write following code,
170170

171171
```TypeScript
172172
import type { BaseOptions } from './index.ts'; // change or delete this to the path to `index.ts` (the loader) according to real base orchestration needs
173-
import type {
174-
General,
175-
GeneralObject,
176-
ModuleInput as MI,
177-
Orchestratable,
178-
} from './types.ts'; // change this to the real path of `types.ts`
173+
import type { General, GeneralObject, ModuleInput as MI, Orchestratable } from './types.ts'; // change this to the real path of `types.ts`
179174
import type { Hook } from './utilities.ts'; // change this to the real hook type you are using (question 5)
180175
import type { Container } from '@needle-di/core'; // change or delete this according to your DI container needs (question)
181176

whitepaper.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"\n",
7474
"Highly modularized and extensible application often embodies poorly managed types, SynthKernel breaks the hell by declarative type orchestration via advanced generics.\n",
7575
"\n",
76-
"For example, it is common for a module to define some configurable fields that can change the module's runtime behavior. Traditional application often uses a centralized configuration file to store these fields, which breaks the modularity by forcing modules to depend on a centralized configuration file. In SynthKernel, each module contribute their own atomic slices of configuration declaratively to the loader. Then the it merges these slices into a single object.\n",
76+
"For example, it is common for a module to define some configurable fields that can change the module's runtime behavior. Traditional application often uses a centralized configuration file to store these fields, which breaks the modularity by forcing modules to depend on a centralized configuration file. In SynthKernel, each module contribute their own atomic slices of configuration declaratively to the loader. Then it merges these slices into a single object.\n",
7777
"\n",
7878
"For example, module A can declare a configuration field like this:\n",
7979
"\n",
@@ -208,11 +208,10 @@
208208
"type GeneralObject = object;\n",
209209
"type GeneralConstructor = new (...args: General[]) => General;\n",
210210
"\n",
211-
"type UnionToIntersection<U> =\n",
212-
"\t(U extends General ? (k: U) => void : never) extends (\n",
213-
"\t\tk: infer I,\n",
214-
"\t) => void ? I\n",
215-
"\t\t: never;\n",
211+
"type UnionToIntersection<U> = (U extends General ? (k: U) => void : never) extends (\n",
212+
"\tk: infer I,\n",
213+
") => void ? I\n",
214+
"\t: never;\n",
216215
"\n",
217216
"type GeneralModuleInput =\n",
218217
"\t| ReadonlyArray<GeneralConstructor>\n",
@@ -222,8 +221,9 @@
222221
"\t| ReadonlyArray<T>\n",
223222
"\t| ReadonlyArray<InstanceType<T>>;\n",
224223
"\n",
225-
"type Instances<T extends GeneralModuleInput> = T extends\n",
226-
"\tReadonlyArray<GeneralConstructor> ? InstanceType<T[number]> : T[number];\n",
224+
"type Instances<T extends GeneralModuleInput> = T extends ReadonlyArray<GeneralConstructor>\n",
225+
"\t? InstanceType<T[number]>\n",
226+
"\t: T[number];\n",
227227
"\n",
228228
"type Orchestratable<\n",
229229
"\tT extends GeneralModuleInput,\n",

0 commit comments

Comments
 (0)