From 1635eb22ec3fcbfedcbaf0e0ac0539cbf64e77d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?He=CC=84sperus?= Date: Tue, 24 Feb 2026 14:45:16 +0800 Subject: [PATCH] adjust line width and correct typo in whitepaper --- deno.jsonc | 1 + skill/example/BaseModule.ts | 7 +------ skill/example/types.ts | 14 +++++++------- skill/start.md | 21 ++++++++------------- whitepaper.ipynb | 16 ++++++++-------- 5 files changed, 25 insertions(+), 34 deletions(-) diff --git a/deno.jsonc b/deno.jsonc index 46f0318..eb14964 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -28,6 +28,7 @@ }, "fmt": { "indentWidth": 4, + "lineWidth": 100, "useTabs": true, "singleQuote": true, "proseWrap": "never" diff --git a/skill/example/BaseModule.ts b/skill/example/BaseModule.ts index cca46e8..4047adc 100644 --- a/skill/example/BaseModule.ts +++ b/skill/example/BaseModule.ts @@ -1,11 +1,6 @@ import type { Container } from '@needle-di/core'; import type { BaseOptions } from './index.ts'; -import type { - General, - GeneralObject, - ModuleInput as MI, - Orchestratable, -} from './types.ts'; +import type { General, GeneralObject, ModuleInput as MI, Orchestratable } from './types.ts'; import type { Hook } from './utilities.ts'; type ModuleInput = MI; diff --git a/skill/example/types.ts b/skill/example/types.ts index f679e65..6a6e66a 100644 --- a/skill/example/types.ts +++ b/skill/example/types.ts @@ -5,11 +5,10 @@ export type GeneralArray = ReadonlyArray; export type GeneralObject = object; export type GeneralConstructor = new (...args: General[]) => General; -type UnionToIntersection = - (U extends General ? (k: U) => void : never) extends ( - k: infer I, - ) => void ? I - : never; +type UnionToIntersection = (U extends General ? (k: U) => void : never) extends ( + k: infer I, +) => void ? I + : never; type GeneralModuleInput = | ReadonlyArray @@ -19,8 +18,9 @@ export type ModuleInput = | ReadonlyArray | ReadonlyArray>; -type Instances = T extends - ReadonlyArray ? InstanceType : T[number]; +type Instances = T extends ReadonlyArray + ? InstanceType + : T[number]; export type Orchestratable< T extends GeneralModuleInput, diff --git a/skill/start.md b/skill/start.md index 630d0ad..42a7c0b 100644 --- a/skill/start.md +++ b/skill/start.md @@ -62,11 +62,10 @@ export type GeneralArray = ReadonlyArray; export type GeneralObject = object; export type GeneralConstructor = new (...args: General[]) => General; -type UnionToIntersection = - (U extends General ? (k: U) => void : never) extends ( - k: infer I, - ) => void ? I - : never; +type UnionToIntersection = (U extends General ? (k: U) => void : never) extends ( + k: infer I, +) => void ? I + : never; type GeneralModuleInput = | ReadonlyArray @@ -76,8 +75,9 @@ export type ModuleInput = | ReadonlyArray | ReadonlyArray>; -type Instances = T extends - ReadonlyArray ? InstanceType : T[number]; +type Instances = T extends ReadonlyArray + ? InstanceType + : T[number]; export type Orchestratable< T extends GeneralModuleInput, @@ -170,12 +170,7 @@ Create `BaseModule.ts` per the file system convention and write following code, ```TypeScript import type { BaseOptions } from './index.ts'; // change or delete this to the path to `index.ts` (the loader) according to real base orchestration needs -import type { - General, - GeneralObject, - ModuleInput as MI, - Orchestratable, -} from './types.ts'; // change this to the real path of `types.ts` +import type { General, GeneralObject, ModuleInput as MI, Orchestratable } from './types.ts'; // change this to the real path of `types.ts` import type { Hook } from './utilities.ts'; // change this to the real hook type you are using (question 5) import type { Container } from '@needle-di/core'; // change or delete this according to your DI container needs (question) diff --git a/whitepaper.ipynb b/whitepaper.ipynb index 7dbac84..5f48cda 100644 --- a/whitepaper.ipynb +++ b/whitepaper.ipynb @@ -73,7 +73,7 @@ "\n", "Highly modularized and extensible application often embodies poorly managed types, SynthKernel breaks the hell by declarative type orchestration via advanced generics.\n", "\n", - "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", + "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", "\n", "For example, module A can declare a configuration field like this:\n", "\n", @@ -208,11 +208,10 @@ "type GeneralObject = object;\n", "type GeneralConstructor = new (...args: General[]) => General;\n", "\n", - "type UnionToIntersection =\n", - "\t(U extends General ? (k: U) => void : never) extends (\n", - "\t\tk: infer I,\n", - "\t) => void ? I\n", - "\t\t: never;\n", + "type UnionToIntersection = (U extends General ? (k: U) => void : never) extends (\n", + "\tk: infer I,\n", + ") => void ? I\n", + "\t: never;\n", "\n", "type GeneralModuleInput =\n", "\t| ReadonlyArray\n", @@ -222,8 +221,9 @@ "\t| ReadonlyArray\n", "\t| ReadonlyArray>;\n", "\n", - "type Instances = T extends\n", - "\tReadonlyArray ? InstanceType : T[number];\n", + "type Instances = T extends ReadonlyArray\n", + "\t? InstanceType\n", + "\t: T[number];\n", "\n", "type Orchestratable<\n", "\tT extends GeneralModuleInput,\n",