mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 02:11:56 +00:00
chore: Update name
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
{
|
{
|
||||||
startSdk: "start-sdk/lib",
|
StartSdk: "start-sdk/lib",
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ type AnyNeverCond<T extends any[], Then, Else> =
|
|||||||
T extends [any, ...infer U] ? AnyNeverCond<U,Then, Else> :
|
T extends [any, ...infer U] ? AnyNeverCond<U,Then, Else> :
|
||||||
never
|
never
|
||||||
|
|
||||||
export class StartSDK<Manifest extends SDKManifest, Store> {
|
export class StartSdk<Manifest extends SDKManifest, Store> {
|
||||||
private constructor() {}
|
private constructor() {}
|
||||||
private anyOf<A>(
|
private anyOf<A>(
|
||||||
a: A,
|
a: A,
|
||||||
@@ -65,13 +65,13 @@ export class StartSDK<Manifest extends SDKManifest, Store> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static of() {
|
static of() {
|
||||||
return new StartSDK<never, never>()
|
return new StartSdk<never, never>()
|
||||||
}
|
}
|
||||||
withManifest<Manifest extends SDKManifest = never>() {
|
withManifest<Manifest extends SDKManifest = never>() {
|
||||||
return new StartSDK<Manifest, Store>()
|
return new StartSdk<Manifest, Store>()
|
||||||
}
|
}
|
||||||
withStore<Store extends Record<string, any>>() {
|
withStore<Store extends Record<string, any>>() {
|
||||||
return new StartSDK<Manifest, Store>()
|
return new StartSdk<Manifest, Store>()
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
|||||||
@@ -423,6 +423,6 @@ oldSpecToBuilder(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
// convert this to `start-sdk/lib` for conversions
|
// convert this to `start-sdk/lib` for conversions
|
||||||
startSdk: "./output.sdk",
|
StartSdk: "./output.sdk",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { StartSDK } from "../StartSdk"
|
import { StartSdk } from "../StartSdk"
|
||||||
|
|
||||||
export type Manifest = any
|
export type Manifest = any
|
||||||
export const sdk = StartSDK.of()
|
export const sdk = StartSdk.of()
|
||||||
.withManifest<Manifest>()
|
.withManifest<Manifest>()
|
||||||
.withStore<{ storeRoot: { storeLeaf: "value" } }>()
|
.withStore<{ storeRoot: { storeLeaf: "value" } }>()
|
||||||
.build()
|
.build()
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ function isString(x: unknown): x is string {
|
|||||||
|
|
||||||
export default async function makeFileContentFromOld(
|
export default async function makeFileContentFromOld(
|
||||||
inputData: Promise<any> | any,
|
inputData: Promise<any> | any,
|
||||||
{ startSdk = "start-sdk", nested = true } = {},
|
{ StartSdk = "start-sdk", nested = true } = {},
|
||||||
) {
|
) {
|
||||||
const outputLines: string[] = []
|
const outputLines: string[] = []
|
||||||
outputLines.push(`
|
outputLines.push(`
|
||||||
import { sdk } from "${startSdk}"
|
import { sdk } from "${StartSdk}"
|
||||||
const {Config, List, Value, Variants} = sdk
|
const {Config, List, Value, Variants} = sdk
|
||||||
`)
|
`)
|
||||||
const data = await inputData
|
const data = await inputData
|
||||||
|
|||||||
Reference in New Issue
Block a user