diff --git a/packages/test-acts/.eslintrc.cjs b/packages/test-acts/.eslintrc.cjs deleted file mode 100644 index 986818e..0000000 --- a/packages/test-acts/.eslintrc.cjs +++ /dev/null @@ -1,38 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es2021": true - }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - ], - "overrides": [ - { - "env": { - "node": true - }, - "files": [ - ".eslintrc.{js,cjs}" - ], - "parserOptions": { - "sourceType": "script" - } - } - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - ], - "rules": { - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/no-explicit-any": "off", - }, - "settings": { - - } -} diff --git a/packages/test-acts/LICENSE.md b/packages/test-acts/LICENSE.md deleted file mode 100644 index 24d8d47..0000000 --- a/packages/test-acts/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2023 Bo An - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/test-acts/package.json b/packages/test-acts/package.json deleted file mode 100644 index e5528af..0000000 --- a/packages/test-acts/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "cantos", - "private": false, - "version": "0.0.1", - "type": "module", - "main": "./dist/cantos.umd.cjs", - "module": "./dist/cantos.js", - "types": "./dist/cantos.d.ts", - "exports": { - ".": { - "import": "./dist/cantos.js", - "require": "./dist/cantos.umd.cjs" - } - }, - "files": [ - "dist" - ], - "scripts": { - "dev": "vite", - "build": "tsc --project tsconfig.build.json && vite build", - "preview": "vite preview", - "test": "vitest", - "test:ui": "vitest --ui", - "mermaid": "^10.6.1" - }, - "devDependencies": { - "@types/node": "^20.9.0", - "@types/uuid": "^9.0.7", - "@typescript-eslint/eslint-plugin": "^6.10.0", - "@typescript-eslint/parser": "^6.10.0", - "@vitest/coverage-v8": "^0.34.6", - "@vitest/ui": "^1.0.0-beta.4", - "eslint": "^8.53.0", - "type-fest": "^4.7.1", - "typescript": "^5", - "vite": "^4.4.5", - "vite-plugin-dts": "^3.6.3", - "vite-plugin-eslint": "^1.8.1", - "vitest": "^1.0.0-beta.4", - "yaml": "^2.3.4" - }, - "dependencies": { - "mermaid": "^10.6.1", - "uuid": "^9.0.1" - }, - "peerDependencies": { - "typescript": "^5" - }, - "license": "MIT" -} diff --git a/packages/test-acts/src/act/interfaces.ts b/packages/test-acts/src/act/interfaces.ts deleted file mode 100644 index 8e75e1d..0000000 --- a/packages/test-acts/src/act/interfaces.ts +++ /dev/null @@ -1,106 +0,0 @@ -import {Story, TestKind} from "@src/act/stories.ts"; -import {Genres} from "@src/act/story-kinds.ts"; -import {Scenes} from "@src/entrance.ts"; -import {IStoryScripts} from "@src/act/story-types.ts"; -import {StoryStatus} from "@src/act/status.ts"; -import {StoryOptions} from "@src/act/story-options.ts"; - -export interface Test { - /** - * The type of tests. - */ - kind: TestKind; - /** - * The condition when the test is considered done. - */ - doneWhen?: string; - /** - * The issues that this test it closes. - */ - closeIssues?: string[]; - -} - -export interface StoryActor { - role?: string; - roleBio?: string; - /** - * The name of the role. - */ - actor?: string; - actorBio?: string; -} - -export const EmptyCast = {} as const; -type KeysOfConst = T extends Record ? keyof T : never; -export type CastProfiles = Record; - -/** - * Bare Act is the base structure for any entity or behavior without methods or nested entities. - */ -export interface IStoryScript { - scenes?: IStoryScripts; - /** - * The order of the story among its sibling stories. - */ - order?: number; - cast?: Cast; - /** - * The short version of the story. - */ - story: string; - /** - * Story-by-Story options that can override the global story options. - */ - options?: StoryOptions; - genre?: Genres; - tests?: Record - parentPath?: string; - explain?: string; - /** - * The condition when the story is considered done. - */ - done?: string; - /** - * The current status of the story - */ - status?: StoryStatus | string; - lastUpdate?: string; - - priority?: number; - - context?: IStoryScript[]; - - when?: IStoryScript[]; - - then?: IStoryScript[]; - - who?: KeysOfConst[]; - - - tellAs?: (fn: (entity: Story) => string) => string; -} - -export interface IStory extends IStoryScript { - scenes: Scenes; - readonly testId: () => string; - path: () => string; - nextActToDo: () => Story | undefined; - - /** - * Simply tell the story, using teller preference {@link StoryTellingOptions} to decide whether to tell the short or long version. - */ - tell: () => string; - - /** - * Tell the shorter version of the story using the story text. - */ - short: () => string; - /** - * Tell the longer version of the story using the `contexts`, `when`, and `then`, in the form of, for example, `Given ... When ... Then ...`. - * - * @remarks - * If a long description is not provided, it will fallback to the short version. - */ - long: () => string; -} diff --git a/packages/test-acts/src/act/status.ts b/packages/test-acts/src/act/status.ts deleted file mode 100644 index b215578..0000000 --- a/packages/test-acts/src/act/status.ts +++ /dev/null @@ -1,9 +0,0 @@ -export enum StoryStatus { - NO_STATUS = 'NO_STATUS', - BACKLOG = 'BACKLOG', - DESIGN = 'DESIGN', - IN_PROGRESS = 'IN_PROGRESS', - REVIEW = 'REVIEW', - DONE = 'DONE', - ARCHIVED = 'ARCHIVED', -} diff --git a/packages/test-acts/src/act/stories.ts b/packages/test-acts/src/act/stories.ts deleted file mode 100644 index 3b12ee7..0000000 --- a/packages/test-acts/src/act/stories.ts +++ /dev/null @@ -1,144 +0,0 @@ -import {PartialDeep, ReadonlyDeep} from "type-fest"; -import {ACT_DEFAULT_DESCRIPTIONS} from "@src/consts.ts"; -import {Scenes} from "@src/entrance.ts"; - -import {CastProfiles, EmptyCast, IStory, IStoryScript, Test} from "@src/act/interfaces.ts"; -import {Genres} from "@src/act/story-kinds.ts"; -import {getPath, populateActPath} from "@src/act/utils.ts"; -import {TestKind} from "@src/act/test-kinds.ts"; -import {printTag, printTestTags, tellStory} from "@src/act/storyteller.ts"; -import {IStoryScripts} from "@src/act/story-types.ts"; -import {NameList} from "@src/util-types.ts"; -import {StoryOptions, StoryVersion} from "@src/act/story-options.ts"; -import {StoryStatus} from "@src/act/status.ts"; - - - -class StoryScript implements IStoryScript { - story: string = ACT_DEFAULT_DESCRIPTIONS.DEFAULT_NARRATIVE; - parentPath?: string | undefined; - genre?: Genres = Genres.ACT; - implemented?: boolean = false; - protagonist?: string = "it"; - explain?: string; - options?: StoryOptions; - - constructor( - entity: Partial, - opt?: StoryOptions, - ) { - if (opt?.defaultKind) { - this.genre = opt.defaultKind; - } - Object.assign(this, entity); - - - } -} - - -export class Story extends StoryScript implements IStory { - options?: StoryOptions; - scenes: Scenes = {}; - context?: StoryScript[]; - when?: StoryScript[]; - then?: StoryScript[]; - status?: StoryStatus | string; - priority?: number; - - path = () => getPath(this.story, this.parentPath) - // get a getter to get test id - testId = this.path; - tellAs: (fn: (entity: Story) => string) => string; - - nextActToDo(): Story | undefined { - return undefined - } - - long = () => tellStory(this, StoryVersion.LONG); - - short = () => tellStory(this, StoryVersion.SHORT) - tell = () => tellStory(this, StoryVersion.NO_PREFERENCE); - - /** - * Tell the story but with test kinds as tag prefixes, e.g. `[UNIT] [E2E] Story` - * @param tests - */ - tellForTest = (tests: Test[]) => [printTestTags(tests), tellStory(this, StoryVersion.NO_PREFERENCE)].join(' '); - - /** - * Print test's kinds as tags, e.g. `[UNIT] [E2E]` - */ - printTestTags = (tests: Test[]) => printTestTags(tests); - - /** - * Print the story as a tag, e.g. `[STORY]` - * - */ - printAsTag = () => printTag(this.tell()); - - // Get the next act according to the priority and the implementation status of the act. - - - constructor( - entity: PartialDeep, - opt?: StoryOptions, - ) { - // if the provided story script has individual options set, use it to override the global options for this story - const storyOptions = entity.options || opt; - - super(entity, storyOptions); - Object.assign(this, entity); - - // store options - this.options = storyOptions; - - // populate entity - populateActPath(this); - - // Use describeAs function if provided - this.tellAs = (fn) => fn(this); - - } - - -} - -/** - * Type for acts created with user-defined act records. - * - * @remarks - * Represents an enhanced version of an `IActRecord` with additional methods from the `Act` class. - * This type recursively applies itself to each nested act within the `acts` property, ensuring that - * each nested act also receives the benefit of intellisense. - * - * The `acts` property is a mapped type that iterates over each key in the original `acts` property - * of the provided `IActRecord`. For each key, it checks if the corresponding value extends `IActRecord`. - * If it does, the type is recursively applied to this value, enhancing it with `Act` methods. - * If it does not extend `IActRecord`, the type for that key is set to `never`, indicating an invalid type. - * - * This approach allows the `UserAct` type to maintain the original structure of the `IActRecord`, - * including any nested acts, while also adding the methods and properties defined in the `Act` class. - * As a result, instances of `ActWithMethods` have both the data structure defined by their specific `IActRecord` - * implementation and the functionality provided by `Act`. - * - * @template T - A type extending `IActRecord` that represents the structure of the act record. - * This generic type allows `ActWithMethods` to be applied to any specific implementation - * of `IActRecord`, preserving its unique structure. - */ -export type UserStory, CAST extends CastProfiles > = ReadonlyDeep & Story & { - scenes: { [K in keyof T['scenes']]: T['scenes'][K] extends IStoryScript ? ReadonlyDeep> : never }; -}; - -export type UserCast = ReadonlyDeep; - -export type UserStories, CAST extends CastProfiles> = ReadonlyDeep<{ [K in keyof T]: ReadonlyDeep> }>; - -export type UserNameList = ReadonlyDeep<{ - [K in keyof T]: ReadonlyDeep> -}>; - -export {TestKind}; - diff --git a/packages/test-acts/src/act/story-kinds.ts b/packages/test-acts/src/act/story-kinds.ts deleted file mode 100644 index cbce61b..0000000 --- a/packages/test-acts/src/act/story-kinds.ts +++ /dev/null @@ -1,41 +0,0 @@ - - - -/** - * Types for Act kinds. - */ -export enum GenreEntity { - ACT = "ACT", - ENTITY = "ENTITY", - BEHAVIOR = "BEHAVIOR", - DOMAIN = "DOMAIN", - BACKGROUND = "BACKGROUND", -} - - -export enum GenreGherkin { - SCENARIO = "SCENARIO", - GIVEN = "GIVEN", - WHEN = "WHEN", - THEN = "THEN", -} - -export enum GenreUserStory { - EPIC = "EPIC", - STORY = "STORY", - FEATURE = "FEAT", - STEP = "STEP", - AS_A_USER = "AS A USER", - I_WANT_TO = "I WANT TO", - SO_THAT = "SO THAT", -} - -export type GenreBDD = GenreGherkin | GenreUserStory; - -export const Genres = { - ...GenreEntity, - ...GenreGherkin, - ...GenreUserStory, -} - -export type Genres = GenreEntity | GenreBDD; diff --git a/packages/test-acts/src/act/story-options.ts b/packages/test-acts/src/act/story-options.ts deleted file mode 100644 index f289cd3..0000000 --- a/packages/test-acts/src/act/story-options.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {Genres} from "@src/act/story-kinds.ts"; - -export enum StoryVersion { - NO_PREFERENCE = "NO_PREFERENCE", - SHORT = "SHORT", - LONG = "LONG", -} - -export enum StoryTag { - Genre = "Genre", - Status = "Status", - Priority = "Priority", -} - -export interface StoryTellingOptions { - /** - * Whether to tell the story in short or long version when unspecified, i.e. when calling `tell()` - */ - prefer?: StoryVersion - tags?: StoryTag[] -} - -export interface StoryOptions { - defaultKind?: Genres - capitalizeKeywords?: boolean - teller?: StoryTellingOptions -} diff --git a/packages/test-acts/src/act/story-types.ts b/packages/test-acts/src/act/story-types.ts deleted file mode 100644 index ddb5d4e..0000000 --- a/packages/test-acts/src/act/story-types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {CastProfiles, EmptyCast, IStoryScript} from "@src/act/interfaces.ts"; - - -/** - * Export type alises for easier use for user-defined data. - */ -type IStoryScripts = Record>; - -/** - * Type for used defined input data for an Act. - */ -type StoryScript = IStoryScript; - - -export type {StoryScript, IStoryScripts} - diff --git a/packages/test-acts/src/act/storyteller.ts b/packages/test-acts/src/act/storyteller.ts deleted file mode 100644 index e89751d..0000000 --- a/packages/test-acts/src/act/storyteller.ts +++ /dev/null @@ -1,134 +0,0 @@ -import {StoryScript} from "@src/index.ts"; -import {ACT_DEFAULT_DESCRIPTIONS, GWT_DESCRIPTIONS, STORY_TELLER} from "@src/consts.ts"; -import {Story} from "@src/act/stories.ts"; -import {StoryTag, StoryVersion} from "@src/act/story-options.ts"; -import {Test} from "@src/act/interfaces.ts"; - -enum STATEMENT_TYPE { - GIVEN, - WHEN, - THEN, -} - -export const printTag = (tagText: string) => STORY_TELLER.LEFT_BRACKET + tagText.toUpperCase() + STORY_TELLER.RIGHT_BRACKET; - -export const printTags = (tags: string[]) => tags.map(tag => printTag(tag)).join(STORY_TELLER.SPACE); - -export const printTestTags = (tests: Test[]) => { - const tags = tests.map(test => test.kind); - return tags.length > 0 ? printTags(tags) : ''; -} - -function gatherTags(story: Story, tags: StoryTag[]): string { - const allTags: string [] = []; - - for (const tag of tags) { - let tagText = ''; - switch (tag) { - case StoryTag.Genre: - tagText = story.genre ? story.genre : ''; - break; - case StoryTag.Status: - tagText = story.status ? story.status : ''; - break; - case StoryTag.Priority: - tagText = story.priority ? story.priority.toString() : ''; - break; - } - - const tagTextTrimmed = tagText.trim(); - - if (tagTextTrimmed.length > 0) { - allTags.push(tagTextTrimmed); - - } - - } - - return allTags.length > 0 ? printTags(allTags) : ''; -} - -export function tellStory(story: Story, version: StoryVersion): string { - const opt = story.options; - let storyText = ''; - switch (version) { - case StoryVersion.SHORT: - storyText = story.story; - break; - case StoryVersion.LONG: - storyText = gatherAllActsStatements(story); - break; - // if no preference specified, use the option preference or default to short - case StoryVersion.NO_PREFERENCE: - default: - storyText = opt?.teller?.prefer === StoryVersion.LONG ? gatherAllActsStatements(story) : story.story; - break; - } - if (opt?.teller?.tags) { - storyText = gatherTags(story, opt?.teller?.tags) + STORY_TELLER.SPACE + storyText; - } - return storyText; - - -} - -export function getActStatements(acts: StoryScript[] | undefined, prefixType: STATEMENT_TYPE, actName?: string): string | undefined { - if (!acts) { - return undefined; - } - - const actsLength = acts.length; - if (actsLength === 0) { - return undefined; - } - - let prefix = ""; - switch (prefixType) { - case STATEMENT_TYPE.GIVEN: - prefix = GWT_DESCRIPTIONS.GIVEN - break; - case STATEMENT_TYPE.WHEN: - prefix = GWT_DESCRIPTIONS.WHEN - break; - case STATEMENT_TYPE.THEN: - prefix = GWT_DESCRIPTIONS.THEN - break; - default: - break; - } - - const statement = acts.map((given, index) => { - let statement = given.story.trim(); - // there are more than one given - if (actsLength > 1) { - // if it's not the first given, add a comma - statement = index === 0 ? statement : `, ${statement}`; - // if it's the second last given, add an "and" after the comma - statement = index === actsLength - 2 ? `${statement} and` : statement; - // if it's the last given, add a period after the comma - statement = index === actsLength - 1 ? `${statement}.` : statement; - } - return statement.trim(); - }).join(); - - return `${prefix.toLowerCase()} ${actName ? actName + ' ' : ''}${statement}`; -} - -export function gatherAllActsStatements(entity: Story): string { - const actName = entity.protagonist ?? ACT_DEFAULT_DESCRIPTIONS.DEFAULT_ACT_NAME; - const statements = [ - getActStatements(entity.context, STATEMENT_TYPE.GIVEN), - getActStatements(entity.when, STATEMENT_TYPE.WHEN), - getActStatements(entity.then, STATEMENT_TYPE.THEN, actName), - ] - - const collectedStatements = statements.filter(statement => statement).join(", ").trim(); - // if no collect statement or the statement is empty, fallback to description - if (!collectedStatements || collectedStatements === "") { - return entity.story; - } else { - // return with first letter capitalized - return collectedStatements.charAt(0).toUpperCase() + collectedStatements.slice(1); - } - -} diff --git a/packages/test-acts/src/act/test-kinds.ts b/packages/test-acts/src/act/test-kinds.ts deleted file mode 100644 index bdaae27..0000000 --- a/packages/test-acts/src/act/test-kinds.ts +++ /dev/null @@ -1,25 +0,0 @@ -export enum TestKinds { - /** - * Quick and dirty way to determine whether something works at all. - */ - SMOKE = 'SMOKE', - /** - * Default kind for an Act. - */ - CORNER_CASE = 'CORNER', - UNIT = 'UNIT', - INTEGRATION = 'INTEGRATE', - END_TO_END = 'E2E', - PERFORMANCE = 'PERF', - REGRESSION = 'REGRESS', - SECURITY = 'SECURITY', - STRESS = 'STRESS', - ACCEPTANCE = 'ACCEPTANCE', -} - -export const TestKind = { - ...TestKinds, -} - -export type TestKind = TestKinds; - diff --git a/packages/test-acts/src/act/utils.ts b/packages/test-acts/src/act/utils.ts deleted file mode 100644 index 97de794..0000000 --- a/packages/test-acts/src/act/utils.ts +++ /dev/null @@ -1,31 +0,0 @@ -import {IStory} from "@src/act/interfaces.ts"; - -export function populatePath>(entity: T, parentPath?: string): T { - // Add name to parentPath if any - return { - ...entity, - path: getPath(entity.story, parentPath), - } -} - - -export function populateActPath(actor: IStory): IStory { - const actorPath = actor.story; - // populate entity acts - for (const actKey in actor.scenes) { - actor.scenes[actKey] = populatePath(actor.scenes[actKey], actorPath); - } - return populatePath(actor); -} - - -/** - * Util classes - * @param entityDescribe - * @param parentPath - */ - -export function getPath(entityDescribe: string, parentPath: string | undefined): string { - return parentPath ? `${parentPath}.${entityDescribe}` : entityDescribe; -} - diff --git a/packages/test-acts/src/commons.ts b/packages/test-acts/src/commons.ts deleted file mode 100644 index bcc1ae3..0000000 --- a/packages/test-acts/src/commons.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {COMMON_TEST_DESCRIPTIONS, COMMON_TEST_TAGS} from "@src/consts.ts"; -import {IStoryScripts} from "@src/act/story-types.ts"; -import {loadList} from "@src/entrance.ts"; - -/** - * - */ -export const CommonScences = loadList(COMMON_TEST_DESCRIPTIONS); - -export const CommonTest = loadList(COMMON_TEST_TAGS) - -export const customizeCommonTests = >(behaviors: T) => { - return { - ...CommonScences, - ...behaviors, - } -} - - - - diff --git a/packages/test-acts/src/consts.ts b/packages/test-acts/src/consts.ts deleted file mode 100644 index 57a8f8b..0000000 --- a/packages/test-acts/src/consts.ts +++ /dev/null @@ -1,40 +0,0 @@ -import {TestKinds} from "@src/act/test-kinds.ts"; - -export const ACT_DEFAULT_DESCRIPTIONS = { - DEFAULT_NARRATIVE: "The story goes", - DEFAULT_ACT_NAME: "it", -} - -export const STORY_TELLER = { - LEFT_BRACKET: "[", - RIGHT_BRACKET: "]", - SPACE : " ", -} - -export const GWT_DESCRIPTIONS = { - GIVEN: "Given that", - WHEN: "When", - THEN: "Then", -} - -export const COMMON_TEST_DESCRIPTIONS = { - SHOULD_WORK: "should work", - SHOULD_FAIL: "should fail", - SHOULD_BE_TRUTHY: "should be truthy", - SHOULD_BE_FALSY: "should be falsy", - SHOULD_RENDER: "should render", - SHOULD_NOT_RENDER: "should not render", - SHOULD_PROVIDE_RESULT: "should provide result", - SHOULD_NOT_PROVIDE_RESULT: "should not provide result", -} -export const COMMON_TEST_TAGS = { - INTEGRATION: TestKinds.INTEGRATION, - UNIT: TestKinds.UNIT, - SMOKE: TestKinds.SMOKE, - END_TO_END: TestKinds.END_TO_END, - PERFORMANCE: TestKinds.PERFORMANCE, - REGRESSION: TestKinds.REGRESSION, - SECURITY: TestKinds.SECURITY, - STRESS: TestKinds.STRESS, - -} diff --git a/packages/test-acts/src/diagram.ts b/packages/test-acts/src/diagram.ts deleted file mode 100644 index 892bbe7..0000000 --- a/packages/test-acts/src/diagram.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Story } from "./act/stories"; - -export const drawEntity = (entity: Story) : string => { - let mermaidCode = `graph LR\n`; - mermaidCode += ` ${entity.story.replace(/\s+/g, '_')}["${entity.story}"]\n`; - - for (const actKey in entity.scenes) { - if (Object.prototype.hasOwnProperty.call(entity.scenes, actKey)) { - const act = entity.scenes[actKey]; - mermaidCode += ` ${entity.story.replace(/\s+/g, '_')} --> ${actKey.replace(/\s+/g, '_')}["${act.story}"]\n`; - } - } - - return mermaidCode; -} diff --git a/packages/test-acts/src/entrance.ts b/packages/test-acts/src/entrance.ts deleted file mode 100644 index d2c72ee..0000000 --- a/packages/test-acts/src/entrance.ts +++ /dev/null @@ -1,64 +0,0 @@ -// Utility function to map descriptions to act records -// Utility function to map descriptions to act records -import {NameList} from "@src/util-types.ts"; -import {Story, UserNameList, UserStories, UserStory} from "@src/act/stories.ts"; - -import {CastProfiles, IStory, IStoryScript} from "@src/act/interfaces.ts"; -import {IStoryScripts} from "@src/act/story-types.ts"; -import {StoryOptions} from "@src/act/story-options.ts"; - -type StoryField = { story: string } - -function mapNameList(tell: T): Record { - return Object.keys(tell).reduce((acc, key) => { - acc[key as keyof T] = {story: tell[key as keyof T]}; - return acc; - }, {} as Record); -} - -export function loadList(descriptions: T): UserNameList { - const result = mapNameList(descriptions); - return loadScriptRecord(result) as UserNameList; -} - -/** - * This function creates an Act from a PartialAct. - * @param partialEntity - The PartialAct to be converted into an Act. - * @param opt - Optional parameters. - * @returns A ReadonlyDeep Act. - */ -export function loadScript