add sql client, make test suffix *.spec.ts instead

main
Mari 2 years ago
parent 3faf045af1
commit ee6390f7cc
  1. 2
      jest.config.ts
  2. 32
      package-lock.json
  3. 4
      package.json
  4. 107
      script.md
  5. 0
      src/main.spec.ts
  6. 3
      tsconfig.json

@ -20,7 +20,7 @@ export default {
collectCoverage: true,
// An array of glob patterns indicating a set of files for which coverage information should be collected
collectCoverageFrom: ["src/**.{js,ts}", "!node_modules/**", "!src/*.test.{js,ts}"],
collectCoverageFrom: ["src/**.{js,ts}", "!node_modules/**", "!src/*.spec.{js,ts}"],
// The directory where Jest should output its coverage files
coverageDirectory: "coverage",

32
package-lock.json generated

@ -10,7 +10,8 @@
"license": "ISC",
"dependencies": {
"@reduxjs/toolkit": "^1.8.5",
"discord.js": "^14.5.0"
"discord.js": "^14.5.0",
"ts-postgres": "^1.3.0"
},
"devDependencies": {
"@tsconfig/node18": "^1.0.1",
@ -3833,6 +3834,22 @@
}
}
},
"node_modules/ts-postgres": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/ts-postgres/-/ts-postgres-1.3.0.tgz",
"integrity": "sha512-YQY6omZM9RiMeJpzyVn36ankicZnTbSTkHaq+NTkqrLHSRYigsNW9JsPwrZXxLt1es3mV+V6/VUj0eOVcYXq1g==",
"dependencies": {
"ts-typed-events": "^3.0.0"
},
"engines": {
"node": ">=10.7.0"
}
},
"node_modules/ts-typed-events": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ts-typed-events/-/ts-typed-events-3.0.0.tgz",
"integrity": "sha512-+2FZ0XPX+UPR7PO8ZQjuvnuDMYRhzrDaCRaNHaBG1xSL//0oPa3XMU5yxgDTzW67VzkE33fQpx1YxWBdkaF7Zw=="
},
"node_modules/tslib": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
@ -6933,6 +6950,19 @@
"yn": "3.1.1"
}
},
"ts-postgres": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/ts-postgres/-/ts-postgres-1.3.0.tgz",
"integrity": "sha512-YQY6omZM9RiMeJpzyVn36ankicZnTbSTkHaq+NTkqrLHSRYigsNW9JsPwrZXxLt1es3mV+V6/VUj0eOVcYXq1g==",
"requires": {
"ts-typed-events": "^3.0.0"
}
},
"ts-typed-events": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ts-typed-events/-/ts-typed-events-3.0.0.tgz",
"integrity": "sha512-+2FZ0XPX+UPR7PO8ZQjuvnuDMYRhzrDaCRaNHaBG1xSL//0oPa3XMU5yxgDTzW67VzkE33fQpx1YxWBdkaF7Zw=="
},
"tslib": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",

@ -5,13 +5,15 @@
"private": true,
"main": "index.js",
"scripts": {
"build": "tsc",
"test": "jest"
},
"author": "",
"license": "ISC",
"dependencies": {
"@reduxjs/toolkit": "^1.8.5",
"discord.js": "^14.5.0"
"discord.js": "^14.5.0",
"ts-postgres": "^1.3.0"
},
"devDependencies": {
"@tsconfig/node18": "^1.0.1",

@ -1,107 +0,0 @@
> `# (comment)`
A comment. Comments must always be at the start (barring indentation) of their line; inline comments are not allowed.
> `!> (text with Handlebars expansions)`
Clears the NVL mode buffer and prints (text with Handlebars expansions) as a NVL mode message, passing it through the Handlebars parser in order to apply variables. (The Handlebars parser also handles formatting.) The script does not advance until the user presses the Advance button, unless an auto-advance character is in the text. Ignored if currently in battle.
> `> (text with Handlebars expansions)`
Prints (text with Handlebars expansions) as a NVL mode message appended to the current NVL mode buffer. The script does not advance until the user presses the Advance button, unless an auto-advance character is in the text. Ignored if currently in battle.
> `[(character)] (text with Handlebars expansions)`
Prints (text with Handlebars expansions) as a VN mode message attributed to (character), who must be defined as a speaker in the game's data. If the line starts with just [], it will be a VN mode message with no attribution. The script does not advance until the user presses the Advance button, unless an auto-advance character is in the text. Ignored if currently _not_ in battle.
> `[[(character)]] (text with Handlebars expansions)`
Prints (text with Handlebars expansions) as a skit message attributed to (character) once previous skit messages have auto-advanced.
> `![[(character)]] (text with Handlebars expansions)`
Immediately dumps all previous skit messages into the transcript without displaying any that were queued up and prints (text with Handlebars expansions) as a skit message attributed to (character).
> `% (text with Handlebars expansions)`
Prints (text with Handlebars expansions) as a battle log message. Ignored if currently _not_ in battle.
> `select (text with Handlebars expansions)`
>
> `[cancel] [default] choice (text with Handlebars expansions)`
>
> `show when (Angu script expression)`
>
> `enable when (Angu script expression)`
>
> `default when (Angu script expression)`
>
> `cancel`
>
> `selected`
Displays a set of choices on the screen, with the prompt given in the `select` statement, each having the given text in its `choice` statement. When the user selects a `choice`, all code up to the next `choice`, `when`, `cancel`, `default`, or `selected` statement will be executed.
A `choice` may have the `cancel` and/or `default` keywords preceding it. If it does, that choice will be selected when the user presses the Cancel key/highlighted when the choices are displayed, respectively.
A `cancel` statement is not a displayed choice. Instead, it is the "choice selected" when the user presses the Cancel key, closing the menu.
A `choice` (but not a `cancel`) may be preceded by a `show when` and/or `enable when` and/or `default when` statement. A `show when` statement's expression must evaluate to true or the associated `choice` will be hidden. An `enable when` statement's expression must evaluate to true or the associated `choice` will be unselectable. If a `default when` statement's expression is true, and the `choice` is both shown and enabled, the choice will be selected by default.
The first choice to be all of (visible and enabled and default) will be the highlighted choice when the choices are displayed. Similarly, the first `cancel` or (visible and enabled) `cancel choice` statement will be the behavior when the cancel key is pressed.
If no choice is default, no choice will be highlighted when the menu is displayed. In this case, the cursor is treated as if it's positioned between the first and last choice - pressing Up moves the cursor to the last choice, while pressing Down moves the cursor to the first choice.
If no choice is `cancel` and no `cancel` statement exists, the Cancel key does nothing and does not exit the choice.
If no choices are both shown and enabled, and no `cancel` exists, the menu is not shown at all, and control continues to the next statement after the `selected`.
> `if (Angu script expression)`
>
> `else if (Angu script expression)`
>
> `else`
>
> `fi`
If statement flow. There's no requirement that the contents be indented, but indentation will be stripped away if present, allowing for indentation to be present for readability.
> `while (Angu script expression)`
>
> `done`
While loop flow, with the condition evaluated for the first time before the first loop cycle.
> `do`
>
> `repeat while (Angu script expression)`
Alternate-order while-loop flow, with the condition evaluated for the first time after the first loop cycle.
> `break`
Exits a `do`...`repeat while` or `while`...`done` loop.
> `continue`
Skips to the next iteration of a `do`...`repeat while` or `while`...`done` loop.
> `return`
Exits this layer of the stack and goes up to the previous, or returns to the normal game flow if this was the bottom layer of the stack.
> `call (Angu script expression)`
Pushes the label that the expression evaluates to onto the stack. Fails if the label does not exist. The special value `""` causes `call` to do nothing.
> `goto (Angu script expression)`
Replaces the current stack frame with the label that the expression evaluates to. The special value `""` causes `goto` to do nothing.
> `: (text)`
Indicates a label that can be referred to in game data or jumped or called to from the script.
> `$ (Angu script expression)`
Evaluates the given expression for its side effects.

@ -22,6 +22,7 @@
"src"
],
"exclude": [
"node_modules"
"node_modules/**",
"**.spec.ts"
]
}

Loading…
Cancel
Save