Skip to content

Commit 0d6322e

Browse files
committed
Imropve copilot and AI prompts
1 parent dfa55f1 commit 0d6322e

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

.github/copilot-instructions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Project Overview
22

3-
This public project, called videomail-client, is a web-based npm package for reuse in any other web applications and also in a separate WordPress plugin, see [videomail-for-ninja-forms](https://github.com/binarykitchen/videomail-for-ninja-forms).
3+
This public project, called videomail-client, is a web-based npm package for reuse in any other web applications and also in a separate WordPress plugin, see (videomail-for-ninja-forms)[https://github.com/binarykitchen/videomail-for-ninja-forms].
44

55
The most important consumer of this package is (Videomail)[https://www.videomail.io] itself which heavily relies on this package and resides in another, but private repository. Videomail's goal is to enable Sign Language in emails. Deaf users are our main audience.
66

@@ -22,7 +22,7 @@ The root `/README.md` file has further general information for you, the GitHub C
2222

2323
- All runs on Node.js, the used version is defined in the `.nvmrc` file. Presently it's v22
2424
- We do not use React nor any frameworks. All is raw, in Vanilla JavaScript.
25-
- For video recording, we grab images with the deprecated getUserMedia API, send them through WebSocket streams, using the [websocket-stream package](https://www.npmjs.com/package/websocket-stream) and once the user presses the stop button, the server side which is [Videomail](https://www.videomail.io) itself, compiles these image frames into a video and sends them out within an email. That's the big idea.
25+
- For video recording, we grab images with the deprecated getUserMedia API, send them through WebSocket streams, using the (websocket-stream package)[https://www.npmjs.com/package/websocket-stream] and once the user presses the stop button, the server side which is (Videomail)[https://www.videomail.io] itself, compiles these image frames into a video and sends them out within an email. That's the big idea.
2626
- We are aware that the getUserMedia API is deprecated, but we have no time to migrate this to the new MediaDevices API. All still works well, so we can ignore this for now.
2727
- Most source code is written in TypeScript.
2828
- Security checks using the audit-ci package are included and configured. Security is important.
@@ -31,7 +31,7 @@ The root `/README.md` file has further general information for you, the GitHub C
3131

3232
## Browsers and mobile devices
3333

34-
The bare minimum is to support those browsers who support the getUserMedia API. Not the older ones. To check if a browser supports this API, you can use the [caniuse.com](https://caniuse.com/?search=getUserMedia) website.
34+
The bare minimum is to support those browsers who support the getUserMedia API. Not the older ones. To check if a browser supports this API, you can use the (caniuse.com)[https://caniuse.com/?search=getUserMedia] website.
3535

3636
Regarding network issues, we already have mechanisms in place to lower the FPS before encoding these videos on the Videomail server side.
3737

@@ -69,15 +69,15 @@ But here are the default specs for the main Videomail website itself:
6969

7070
### Unit Tests
7171

72-
- For unit tests we use the next generation [Vitest](https://vitest.dev/) framework.
72+
- For unit tests we use the next generation (Vitest)[https://vitest.dev] framework.
7373
- Vitest was chosen because it is fast, has a great API and is compatible with other testing frameworks like Jest.
7474
- The unit tests are located in the `__tests__` subdirectory of each source code
7575

7676
### Visual Tests
7777

78-
For visual tests, we use [Storybook](https://storybook.js.org/). It is configured in the `.storybook` folder. The Storybook is used to visually test components and their states.
78+
For visual tests, we use (Storybook)[https://storybook.js.org]. It is configured in the `.storybook` folder. The Storybook is used to visually test components and their states.
7979

80-
In addition, we also use [Chromatic](https://www.chromatic.com/) to catch any visual differences between git commits.
80+
In addition, we also use (Chromatic)[https://www.chromatic.com] to catch any visual differences between git commits.
8181

8282
## Accessibility
8383

.github/prompts/generate-unit-tests-for-selected-file.prompt.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@ When generating unit tests, please follow these guidelines:
1010

1111
1. For the selected file, generate a corresponding test file in the `__tests__` directory using the same name as the source file but ending with `.test.ts`.
1212
2. If the __tests__ directory does not exist, create it. Or else just generate the test file in the same directory as the source file.
13-
3. Ensure the test file imports the necessary functions or classes from the source file.
14-
4. Use the Vitest framework for writing tests.
15-
5. Write tests that cover the functionality of the source file, including edge cases and error handling.
16-
6. Honour the global Vitest configuration found in the root folder at `vitest.config.ts`.
17-
7. There is no need to import Vitest's `expect` or `describe` as they are globally available.
18-
8. Whenever you generate the unit test code, ensure it produces no TypeError or ESLint errors.
13+
3. If there are already unit tests presents, please do not override these but amend those you are suggesting in the same describe block.
14+
4. Ensure the test file imports the necessary functions or classes from the source file.
15+
5. Use the Vitest framework for writing tests.
16+
6. Make sure to use the latest features of the Vitest package defined in the package.json
17+
7. Write tests that cover the functionality of the source file, including edge cases and error handling.
18+
8. When generating imports, ensure their paths are correct and not broken and that the imports are sorted.
19+
9. Do not mock any functions or modules. Accept anything the file to be tested imports.
20+
10. Any values to be tested should be types constants defined in the top parent describe block and reused.
21+
11. Group unit test cases in subsequent describe blocks based on the subject to be tested.
22+
- For example, if the function to be tested, returns only false or true, group these in two describe blocks.
23+
12. Honour the global Vitest configuration found in the root folder at `vitest.config.ts`.
24+
13. There is no need to import Vitest's `expect` or `describe` as they are globally available.
25+
14. Whenever you generate the unit test code, ensure it produces no TypeError or ESLint errors.
1926

2027
## Preferred Test Structure
2128

rslib.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import path from "node:path";
2+
13
import { pluginNodePolyfill } from "@rsbuild/plugin-node-polyfill";
24
import { pluginStylus } from "@rsbuild/plugin-stylus";
35
import { RsdoctorRspackPlugin } from "@rsdoctor/rspack-plugin";
46
import { defineConfig } from "@rslib/core";
5-
import path from "path";
67

78
import { NodeEnvType } from "./src/types/env";
89
import isProductionMode from "./src/util/isProductionMode";

0 commit comments

Comments
 (0)