mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-03 23:12:20 +02:00
update loose files and add vitest
This commit is contained in:
parent
ff7258d9b6
commit
0d8f9b85ef
@ -1,6 +0,0 @@
|
||||
# don't ever lint node_modules
|
||||
node_modules
|
||||
# don't lint build output (make sure it's set to your correct build folder name)
|
||||
dist
|
||||
index.html
|
||||
.eslintrc.cjs
|
17
.eslintrc
Normal file
17
.eslintrc
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["src/**/*.ts"],
|
||||
"extends": "eslint:recommended"
|
||||
}
|
||||
],
|
||||
"rules": {}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
browser: true,
|
||||
es2021: true,
|
||||
},
|
||||
extends: 'eslint:recommended',
|
||||
overrides: [],
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
},
|
||||
rules: {},
|
||||
}
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -32,3 +32,5 @@ public/images/pokemon/icons/input/output/*
|
||||
public/images/character/*/
|
||||
src/data/battle-anim-raw-data*.ts
|
||||
src/data/battle-anim-data.ts
|
||||
|
||||
src/**/*.js
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "ES2020",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"checkJs": true,
|
||||
"esModuleInterop": true,
|
||||
"strictNullChecks": false
|
||||
}
|
||||
}
|
1887
package-lock.json
generated
1887
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@ -6,17 +6,20 @@
|
||||
"scripts": {
|
||||
"start": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
"preview": "vite preview",
|
||||
"test": "vitest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^1.6.2",
|
||||
"axios-cache-interceptor": "^1.3.2",
|
||||
"eslint": "^8.25.0",
|
||||
"happy-dom": "^14.3.9",
|
||||
"json-beautify": "^1.1.1",
|
||||
"pokenode-ts": "^1.20.0",
|
||||
"typescript": "^5.0.3",
|
||||
"vite": "^4.5.0",
|
||||
"vite-plugin-fs": "^0.4.4"
|
||||
"vite-plugin-fs": "^0.4.4",
|
||||
"vitest": "^1.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@material/material-color-utilities": "^0.2.7",
|
||||
@ -24,5 +27,12 @@
|
||||
"json-stable-stringify": "^1.1.0",
|
||||
"phaser": "^3.70.0",
|
||||
"phaser3-rex-plugins": "^1.1.84"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"imports": {
|
||||
"#app": "./src/main.js",
|
||||
"#app/*": "./src/*"
|
||||
}
|
||||
}
|
||||
|
11
src/utils.test.ts
Normal file
11
src/utils.test.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { expect, describe, it } from "vitest";
|
||||
import { randomString } from "./utils";
|
||||
|
||||
describe("utils", () => {
|
||||
describe("randomString", () => {
|
||||
it("should return a string of the specified length", () => {
|
||||
const str = randomString(10);
|
||||
expect(str.length).toBe(10);
|
||||
});
|
||||
});
|
||||
});
|
19
tsconfig.json
Normal file
19
tsconfig.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "ES2020",
|
||||
"moduleResolution": "Bundler",
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"strictNullChecks": false,
|
||||
"sourceMap": true,
|
||||
"rootDir": "./src",
|
||||
"baseUrl": "./src",
|
||||
"paths": {
|
||||
"#app/*": ["*.ts"],
|
||||
"#app": ["."]
|
||||
},
|
||||
"outDir": "./build",
|
||||
"noEmit": true
|
||||
}
|
||||
}
|
@ -8,10 +8,11 @@ export default defineConfig(({ mode }) => {
|
||||
clearScreen: false,
|
||||
build: {
|
||||
minify: 'esbuild',
|
||||
sourcemap: true
|
||||
},
|
||||
esbuild: {
|
||||
pure: mode === 'production' ? [ 'console.log' ] : [],
|
||||
keepNames: true,
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
|
21
vitest.config.js
Normal file
21
vitest.config.js
Normal file
@ -0,0 +1,21 @@
|
||||
import { defineConfig } from 'vite';
|
||||
// import fs from 'vite-plugin-fs';
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
return {
|
||||
test: {
|
||||
environment: 'happy-dom',
|
||||
},
|
||||
plugins: [/*fs()*/],
|
||||
server: { host: '0.0.0.0', port: 8000 },
|
||||
clearScreen: false,
|
||||
build: {
|
||||
minify: 'esbuild',
|
||||
sourcemap: true
|
||||
},
|
||||
esbuild: {
|
||||
pure: mode === 'production' ? [ 'console.log' ] : [],
|
||||
keepNames: true,
|
||||
},
|
||||
}
|
||||
})
|
Loading…
Reference in New Issue
Block a user