@tui-sandbox/library 11.7.0 → 11.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tui-sandbox/library",
3
- "version": "11.7.0",
3
+ "version": "11.7.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mikavilpas/tui-sandbox"
@@ -6,25 +6,31 @@ import { updateTestdirectorySchemaFile } from "../../server/updateTestdirectoryS
6
6
  import { cwd } from "../tui.js"
7
7
 
8
8
  export async function commandTuiStart(config: TestServerConfig): Promise<void> {
9
+ await Promise.allSettled([updateSchemaFile(config), createSupportFile()])
10
+
9
11
  try {
10
- await createCypressSupportFile({
11
- cypressSupportDirectoryPath: path.join(cwd, "cypress", "support"),
12
- supportFileName: "tui-sandbox.ts",
13
- })
12
+ console.log(`🚀 Starting test server in ${cwd} - this should be the root of your integration-tests directory 🤞🏻`)
13
+ await startTestServer(config)
14
14
  } catch (e) {
15
- console.error("Failed to createCypressSupportFile", e)
15
+ console.error("Failed to startTestServer", e)
16
16
  }
17
+ }
17
18
 
19
+ async function updateSchemaFile(config: TestServerConfig): Promise<void> {
18
20
  try {
19
21
  await updateTestdirectorySchemaFile(config.directories)
20
22
  } catch (e) {
21
23
  console.error("Failed to updateTestdirectorySchemaFile", e)
22
24
  }
25
+ }
23
26
 
27
+ async function createSupportFile(): Promise<void> {
24
28
  try {
25
- console.log(`🚀 Starting test server in ${cwd} - this should be the root of your integration-tests directory 🤞🏻`)
26
- await startTestServer(config)
29
+ await createCypressSupportFile({
30
+ cypressSupportDirectoryPath: path.join(cwd, "cypress", "support"),
31
+ supportFileName: "tui-sandbox.ts",
32
+ })
27
33
  } catch (e) {
28
- console.error("Failed to startTestServer", e)
34
+ console.error("Failed to createCypressSupportFile", e)
29
35
  }
30
36
  }
@@ -1,4 +1,5 @@
1
1
  import assert from "node:assert"
2
+ import type { TestServerConfig } from "../server/updateTestdirectorySchemaFile.js"
2
3
  import type { TestResultExitCode } from "./commands/commandRun.js"
3
4
  import { commandRun } from "./commands/commandRun.js"
4
5
  import { commandTuiNeovimExec } from "./commands/commandTuiNeovimExec.js"
@@ -31,20 +32,20 @@ if (configResult.error) {
31
32
 
32
33
  // the arguments passed to this script start at index 2
33
34
  const args = process.argv.slice(2)
34
-
35
+ const config: TestServerConfig = configResult.result
35
36
  const command = await parseArguments(args)
36
37
 
37
38
  switch (command?.action) {
38
39
  case "neovim prepare": {
39
- await commandTuiNeovimPrepare(configResult.result)
40
+ await commandTuiNeovimPrepare(config)
40
41
  break
41
42
  }
42
43
  case "neovim exec": {
43
- await commandTuiNeovimExec(command, configResult.result)
44
+ await commandTuiNeovimExec(command, config)
44
45
  break
45
46
  }
46
47
  case "start": {
47
- await commandTuiStart(configResult.result)
48
+ await commandTuiStart(config)
48
49
  break
49
50
  }
50
51
  case "run": {
@@ -3,7 +3,7 @@ import { debuglog } from "util"
3
3
  import * as z from "zod"
4
4
  import { buildTestDirectorySchema } from "./dirtree/index.js"
5
5
 
6
- const log = debuglog("tui-sandbox.updateTestdirectorySchemaFile")
6
+ const log = debuglog(`tui-sandbox.${updateTestdirectorySchemaFile.name}`)
7
7
 
8
8
  export type DirectoriesConfig = TestServerConfig["directories"]
9
9