@evitcastudio/kit 1.1.3 → 1.1.5

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.
@@ -1,75 +0,0 @@
1
- import { describe, beforeEach, afterEach, test, expect } from 'bun:test';
2
- import { writeFile, rm, readdir, mkdir } from 'fs/promises';
3
- import { join } from 'path';
4
- import { KitCLI } from '../bin/index.ts';
5
-
6
- const tempDir = join(process.cwd(), 'tests/temp');
7
- const outDir = join(process.cwd(), 'tests/temp/dist');
8
-
9
- async function createFile(pName: string, pExtension: string): Promise<string> {
10
- const filePath = join(tempDir, `${pName}.${pExtension}`);
11
- await writeFile(filePath, '');
12
- return filePath;
13
- }
14
-
15
- async function cleanUpDirectory(pDirectory: string): Promise<void> {
16
- try {
17
- await rm(pDirectory, { recursive: true, force: true });
18
- } catch (pError) {
19
- console.error(`Error cleaning up directory: ${pError}`);
20
- }
21
- }
22
-
23
- async function ensureDirectoryExists(pDirectory: string): Promise<void> {
24
- try {
25
- await mkdir(pDirectory, { recursive: true });
26
- } catch (pError) {
27
- console.error(`Error creating directory: ${pError}`);
28
- }
29
- }
30
-
31
- describe('Kit CLI', () => {
32
- const testFiles = [
33
- { name: 'file1', extension: 'txt' },
34
- { name: 'file2', extension: 'json' },
35
- { name: 'file3', extension: 'vyint' },
36
- { name: 'file4', extension: 'vyi' },
37
- { name: 'file5', extension: 'vym' },
38
- { name: 'file6', extension: 'vymac' },
39
- { name: 'file7', extension: 'mp3' },
40
- { name: 'file8', extension: 'wav' },
41
- { name: 'file9', extension: 'm4a' },
42
- { name: 'file10', extension: 'ogg' },
43
- { name: 'file11', extension: 'aac' },
44
- { name: 'file12', extension: 'flac' },
45
- ];
46
-
47
- beforeEach(async () => {
48
- await cleanUpDirectory(tempDir);
49
- await ensureDirectoryExists(tempDir);
50
- await ensureDirectoryExists(outDir);
51
- await Promise.all(
52
- testFiles.map(({ name, extension }) => createFile(name, extension))
53
- );
54
- });
55
-
56
- afterEach(async () => {
57
- await cleanUpDirectory(tempDir);
58
- });
59
-
60
- test('should process resources with KitCLI', async () => {
61
- await KitCLI.processResources({
62
- inDirectory: tempDir,
63
- outDirectory: outDir,
64
- ignoreSound: false,
65
- verbose: true,
66
- });
67
-
68
- const filesAfterBuild = await readdir(join(outDir, 'resources'));
69
- const expectedFiles = ['icon', 'interface', 'macros', 'map', 'sound'];
70
-
71
- expectedFiles.forEach((expectedFile) => {
72
- expect(filesAfterBuild).toContain(expectedFile);
73
- });
74
- });
75
- });
package/tests/kit.test.ts DELETED
@@ -1,33 +0,0 @@
1
- import { describe, expect, test, beforeEach, mock } from "bun:test";
2
- import { Kit } from '../src/kit';
3
-
4
- describe('Kit Framework', () => {
5
- let kit: typeof Kit;
6
-
7
- // Reset Kit for each test
8
- beforeEach(() => {
9
- kit = Kit;
10
- });
11
-
12
- test('should listen for an event and remove the listener', () => {
13
- const mockListener = mock(() => {});
14
- const pluginName = 'FakePlugin';
15
- const eventName = 'testEvent';
16
-
17
- kit.on(pluginName, eventName, mockListener);
18
- kit.off(pluginName, eventName, mockListener);
19
- /** @ts-ignore (accessing private field)*/
20
- expect(kit.events[`${pluginName}-${eventName}`].length).toBe(0);
21
- });
22
-
23
- test('should listen for an event and should not remove the listener due to a different func being passed.', () => {
24
- const mockListener = mock(() => {});
25
- const pluginName = 'FakePlugin';
26
- const eventName = 'testEvent';
27
-
28
- kit.on(pluginName, eventName, mockListener);
29
- kit.off(pluginName, eventName, ()=>{});
30
- /** @ts-ignore (accessing private field)*/
31
- expect(kit.events[`${pluginName}-${eventName}`].length).toBe(1);
32
- });
33
- });
package/tsconfig.json DELETED
@@ -1,37 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "forceConsistentCasingInFileNames": true,
4
- "declaration": true, // Generate .d.ts files
5
- "declarationMap": true, // Generate .d.ts.map files for debugging
6
- "emitDeclarationOnly": false, // Only emit type declarations
7
- "outDir": "./lib", // Output folder for compiled files
8
- "baseUrl": ".", // Base URL for module resolution
9
- "esModuleInterop": true, // Enable ES module interop
10
- // Enable latest features
11
- "lib": ["ESNext", "DOM"],
12
- "target": "ESNext",
13
- "module": "ESNext",
14
- "moduleDetection": "force",
15
- "jsx": "react-jsx",
16
- "allowJs": true,
17
- "resolveJsonModule": true,
18
-
19
- // Bundler mode
20
- "moduleResolution": "bundler",
21
- // "allowImportingTsExtensions": true,
22
- "verbatimModuleSyntax": true,
23
- // "noEmit": true,
24
-
25
- // Best practices
26
- "strict": true,
27
- "skipLibCheck": true,
28
- "noFallthroughCasesInSwitch": true,
29
-
30
- // Some stricter flags (disabled by default)
31
- "noUnusedLocals": false,
32
- "noUnusedParameters": false,
33
- "noPropertyAccessFromIndexSignature": false
34
- },
35
- "include": ["src/**/*"],
36
- "exclude": ["node_modules", "lib", "dist"]
37
- }