mirror of
https://github.com/smogon/sprites.git
synced 2026-03-21 17:35:13 -05:00
add @smogon/sprite-data
This commit is contained in:
parent
f2020b8a57
commit
40f3925638
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -3,3 +3,4 @@ build/
|
|||
node_modules
|
||||
pnpm-debug.log
|
||||
tup.config
|
||||
dist/
|
||||
|
|
|
|||
27
data/lib/index.ts
Normal file
27
data/lib/index.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import fs from 'fs';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
const libdir = path.join(__dirname, "../..");
|
||||
|
||||
export type Type = {
|
||||
num: number,
|
||||
formeNum: number,
|
||||
base: string,
|
||||
forme: string,
|
||||
sid: number
|
||||
};
|
||||
|
||||
const species : Record<number, Type> = JSON.parse(fs.readFileSync(path.join(libdir, "species.json"), 'utf8'));
|
||||
|
||||
const result = new Map<number, Type>();
|
||||
|
||||
for (const entry of Object.values(species)) {
|
||||
result.set(entry.sid, entry);
|
||||
}
|
||||
|
||||
export default result;
|
||||
|
||||
12
data/lib/package.json
Normal file
12
data/lib/package.json
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"name": "@smogon/sprite-data",
|
||||
"private": "true",
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"typescript": "^3.9.7"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": "^14.0.23"
|
||||
},
|
||||
"main": "./dist/index.js"
|
||||
}
|
||||
6
data/lib/tsconfig.json
Normal file
6
data/lib/tsconfig.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"extends": "../../tsconfig-base",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,12 @@
|
|||
importers:
|
||||
data/lib:
|
||||
dependencies:
|
||||
'@types/node': 14.0.23
|
||||
devDependencies:
|
||||
typescript: 3.9.7
|
||||
specifiers:
|
||||
'@types/node': ^14.0.23
|
||||
typescript: ^3.9.7
|
||||
tools/deflopt:
|
||||
specifiers: {}
|
||||
tools/deploy:
|
||||
|
|
@ -31,6 +39,10 @@ importers:
|
|||
debug: ^4.1.1
|
||||
lockfileVersion: 5.1
|
||||
packages:
|
||||
/@types/node/14.0.23:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-Z4U8yDAl5TFkmYsZdFPdjeMa57NOvnaf1tljHzhouaPEp7LCj2JKkejpI1ODviIAQuW4CcQmxkQ77rnLsOOoKw==
|
||||
/ajv/6.12.0:
|
||||
dependencies:
|
||||
fast-deep-equal: 3.1.1
|
||||
|
|
@ -1026,6 +1038,13 @@ packages:
|
|||
dev: false
|
||||
resolution:
|
||||
integrity: sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||
/typescript/3.9.7:
|
||||
dev: true
|
||||
engines:
|
||||
node: '>=4.2.0'
|
||||
hasBin: true
|
||||
resolution:
|
||||
integrity: sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==
|
||||
/uniq/1.0.1:
|
||||
dev: false
|
||||
resolution:
|
||||
|
|
|
|||
|
|
@ -4,3 +4,4 @@ packages:
|
|||
- 'tools/deploy'
|
||||
- 'tools/deflopt'
|
||||
- 'tools/trim'
|
||||
- "data/lib"
|
||||
|
|
|
|||
14
tsconfig-base.json
Normal file
14
tsconfig-base.json
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"incremental": true,
|
||||
"target": "es2018",
|
||||
"lib": ["es2018"],
|
||||
"module": "esnext",
|
||||
"jsx": "react",
|
||||
"strict": true,
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"isolatedModules": true,
|
||||
"composite": true
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user