chore: charlie 20

This commit is contained in:
BluJ
2023-04-14 11:44:00 -06:00
parent f8382b3638
commit 3052bbe85d
6 changed files with 38 additions and 29 deletions

View File

@@ -103,7 +103,7 @@ export class List<A extends ValueSpecList> extends IBuilder<A> {
description?: string | null;
warning?: string | null;
/** Default [] */
default?: Record<string, unknown>[];
default?: [];
/** Default = "(\*,\*)" */
range?: string;
},

View File

@@ -2,34 +2,38 @@ import * as C from "./configTypesRaw";
export type ValueType = C.ValueType;
export type InputSpec = Record<string, Required<C.ValueSpec>>;
export type RequiredDeep<A> = A extends {}
? { [K in keyof A]-?: RequiredDeep<A[K]> }
: Required<A>;
export type ValueSpec = Required<C.ValueSpec>;
export type InputSpec = Record<string, RequiredDeep<C.ValueSpec>>;
export type ValueSpec = RequiredDeep<C.ValueSpec>;
/** core spec types. These types provide the metadata for performing validations */
export type ValueSpecOf<T extends ValueType> = Required<C.ValueSpecOf<T>>;
export type ValueSpecOf<T extends ValueType> = RequiredDeep<C.ValueSpecOf<T>>;
export type ValueSpecString = Required<C.ValueSpecString>;
export type ValueSpecTextarea = Required<C.ValueSpecTextarea>;
export type ValueSpecNumber = Required<C.ValueSpecNumber>;
export type ValueSpecSelect = Required<C.ValueSpecSelect>;
export type ValueSpecMultiselect = Required<C.ValueSpecMultiselect>;
export type ValueSpecBoolean = Required<C.ValueSpecBoolean>;
export type ValueSpecUnion = Required<C.ValueSpecUnion>;
export type ValueSpecFile = Required<C.ValueSpecFile>;
export type ValueSpecObject = Required<C.ValueSpecObject>;
export type WithStandalone = Required<C.WithStandalone>;
export type SelectBase = Required<C.SelectBase>;
export type ListValueSpecType = Required<C.ListValueSpecType>;
export type ValueSpecString = RequiredDeep<C.ValueSpecString>;
export type ValueSpecTextarea = RequiredDeep<C.ValueSpecTextarea>;
export type ValueSpecNumber = RequiredDeep<C.ValueSpecNumber>;
export type ValueSpecSelect = RequiredDeep<C.ValueSpecSelect>;
export type ValueSpecMultiselect = RequiredDeep<C.ValueSpecMultiselect>;
export type ValueSpecBoolean = RequiredDeep<C.ValueSpecBoolean>;
export type ValueSpecUnion = RequiredDeep<C.ValueSpecUnion>;
export type ValueSpecFile = RequiredDeep<C.ValueSpecFile>;
export type ValueSpecObject = RequiredDeep<C.ValueSpecObject>;
export type WithStandalone = RequiredDeep<C.WithStandalone>;
export type SelectBase = RequiredDeep<C.SelectBase>;
export type ListValueSpecType = RequiredDeep<C.ListValueSpecType>;
/** represents a spec for the values of a list */
export type ListValueSpecOf<T extends ListValueSpecType> = Required<
export type ListValueSpecOf<T extends ListValueSpecType> = RequiredDeep<
C.ListValueSpecOf<T>
>;
/** represents a spec for a list */
export type ValueSpecList = Required<C.ValueSpecList>;
export type ValueSpecListOf<T extends ListValueSpecType> = Required<
export type ValueSpecList = RequiredDeep<C.ValueSpecList>;
export type ValueSpecListOf<T extends ListValueSpecType> = RequiredDeep<
C.ValueSpecListOf<T>
>;
@@ -40,11 +44,11 @@ export function isValueSpecListOf<S extends ListValueSpecType>(
): t is ValueSpecListOf<S> & { spec: ListValueSpecOf<S> } {
return t.spec.type === s;
}
export type ListValueSpecString = Required<C.ListValueSpecString>;
export type ListValueSpecNumber = Required<C.ListValueSpecNumber>;
export type ListValueSpecObject = Required<C.ListValueSpecObject>;
export type UniqueBy = Required<C.UniqueBy>;
export type DefaultString = Required<C.DefaultString>;
export type ListValueSpecString = RequiredDeep<C.ListValueSpecString>;
export type ListValueSpecNumber = RequiredDeep<C.ListValueSpecNumber>;
export type ListValueSpecObject = RequiredDeep<C.ListValueSpecObject>;
export type UniqueBy = RequiredDeep<C.UniqueBy>;
export type DefaultString = RequiredDeep<C.DefaultString>;
export const unionSelectKey = "unionSelectKey" as const;
export type UnionSelectKey = typeof unionSelectKey;

View File

@@ -6,7 +6,9 @@ export { PropertyObject } from "./PropertyObject";
export { PropertyString } from "./PropertyString";
export const test = "";
export type UnionToIntersection<T> = ((x: T) => any) extends (x: infer R) => any ? R : never;
export type UnionToIntersection<T> = ((x: T) => any) extends (x: infer R) => any
? R
: never;
/**
* This is used during creating the type of properties fn in the service package.

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "start-sdk",
"version": "0.4.0-lib0.charlie19",
"version": "0.4.0-lib0.charlie20",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "start-sdk",
"version": "0.4.0-lib0.charlie19",
"version": "0.4.0-lib0.charlie20",
"license": "MIT",
"dependencies": {
"@iarna/toml": "^2.2.5",

View File

@@ -1,6 +1,6 @@
{
"name": "start-sdk",
"version": "0.4.0-lib0.charlie19",
"version": "0.4.0-lib0.charlie20",
"description": "For making the patterns that are wanted in making services for the startOS.",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",

View File

@@ -217,7 +217,10 @@ export default async function makeFileContent(
const values = Object.fromEntries(
Array.from(allValueNames)
.filter(string.test)
.map((key) => [key, value?.spec?.["value-names"]?.[key] || key])
.map((key: string) => [
key,
value?.spec?.["value-names"]?.[key] || key,
])
);
return `Value.multiselect(${JSON.stringify(
{