-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some long-needed renaming and consolidation (#90)Co-authored-by: Null…
…VoxPopuli <[email protected]> This commit holistic renames, consolidates, and cleans up internal concepts. * Rename "internal" concepts to Tag and Tagged * Simplify and improve the notion of subscriptions ## Created new packages - @starbeam/runtime - @starbeam/tags - @starbeam/reactive - @starbeam/resource - @starbeam/service ### Created `@starbeam/tags` Previously, the implementation of tags lived in `TIMELINE`, which has a whole bunch of other unrelated stuff. So the abstraction went directly from the interfaces defined in `@starbeam/interfaces` to the full-fledged timeline definition in `@starbeam/timeline`. This created an awkward situation where tags ought to have been real objects (so they can share utility code), but we had utility function instead that worked with the interfaces to avoid dragging all of TIMELINE into the definition of tags. This commit separates tags into their own package which clearly defines the semantics of tags and provides concrete implementations for them. This simplifies the code considerably, and also more clearly communicates what tags are for. ## Notes from the implementation of resources The third attempt to reimplement resource on top of the new primitives worked beautifully. It supports `ResourceList`, but where the previous implementation worked by implicitly adopting resources across runs, the new implementation of `ResourceList` manages the lifetimes of its child resources explicitly. The code is nearly as compact, in part because the new resource implementation is more honest about separating entire-resource state from per-run state. The new resource primitive adds support for resource metadata (state that lives for the entire lifetime of the resource and can be used for cross-run state). --- Co-authored-by: NullVoxPopuli <[email protected]>
- Loading branch information
Showing
416 changed files
with
13,134 additions
and
14,013 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"root": false, | ||
"overrides": [ | ||
{ | ||
"extends": ["plugin:@starbeam/commonjs"], | ||
"files": ["index.d.ts", "src/**/*.d.ts"], | ||
"parserOptions": { | ||
"project": "@types/ansicolor/tsconfig.json" | ||
} | ||
} | ||
] | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never; | ||
|
||
type Colors = | ||
| "Black" | ||
| "Red" | ||
| "Green" | ||
| "Yellow" | ||
| "Blue" | ||
| "Magenta" | ||
| "Cyan" | ||
| "White" | ||
| "Default"; | ||
|
||
type Styles = "bright" | "dim" | "italic" | "underline" | "inverse"; | ||
|
||
type Bg = `bg${"Bright" | ""}${Colors}`; | ||
|
||
type BgColor = Expand<{ | ||
[key in Colors]: Color; | ||
}>; | ||
|
||
type FgColor = Expand<{ | ||
bright: Color; | ||
dim: Color; | ||
italic: Color; | ||
underline: Color; | ||
inverse: Color; | ||
dim: Color; | ||
magenta: Color; | ||
black: Color; | ||
red: Color; | ||
green: Color; | ||
yellow: Color; | ||
blue: Color; | ||
magenta: Color; | ||
cyan: Color; | ||
white: Color; | ||
default: Color; | ||
}>; | ||
|
||
interface Methods { | ||
strip: Color; | ||
} | ||
|
||
export type Color = Methods & BgColor & FgColor & ((text: string) => string); | ||
|
||
const DEFAULT: Color; | ||
export default DEFAULT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"private": true, | ||
"name": "@types/ansicolor", | ||
"version": "1.0.0", | ||
"type": "module", | ||
"types": "index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./index.d.ts" | ||
} | ||
}, | ||
"publishConfig": { | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts" | ||
} | ||
}, | ||
"types": "dist/index.d.ts" | ||
}, | ||
"starbeam": { | ||
"source": "d.ts", | ||
"type": "library:upstream-types" | ||
}, | ||
"scripts": { | ||
"test:lint": "eslint", | ||
"test:types": "tsc -b" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"extends": "../../.config/tsconfig/tsconfig.shared.json", | ||
"compilerOptions": { | ||
"declarationMap": true, | ||
"declarationDir": "../../dist/types", | ||
"declaration": true, | ||
"outDir": "../../dist/packages", | ||
"composite": true, | ||
"types": ["../../packages/env", "node"] | ||
}, | ||
"exclude": ["dist/**/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.