-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jadon Fowler <[email protected]>
- Loading branch information
Showing
10 changed files
with
8,888 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.DS_Store | ||
node_modules | ||
/dist | ||
|
||
# local env files | ||
.env.local | ||
.env.*.local | ||
|
||
# Log files | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# viewer | ||
|
||
## Project setup | ||
``` | ||
yarn install | ||
``` | ||
|
||
### Compiles and hot-reloads for development | ||
``` | ||
yarn run serve | ||
``` | ||
|
||
### Compiles and minifies for production | ||
``` | ||
yarn run build | ||
``` | ||
|
||
### Run your tests | ||
``` | ||
yarn run test | ||
``` | ||
|
||
### Lints and fixes files | ||
``` | ||
yarn run lint | ||
``` | ||
|
||
### Customize configuration | ||
See [Configuration Reference](https://cli.vuejs.org/config/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
presets: [ | ||
'@vue/app' | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "viewer", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"serve": "vue-cli-service serve", | ||
"build": "vue-cli-service build" | ||
}, | ||
"dependencies": { | ||
"core-js": "^2.6.5", | ||
"fuzzaldrin-plus": "^0.6.0", | ||
"vue": "^2.6.10", | ||
"vue-router": "^3.0.3" | ||
}, | ||
"devDependencies": { | ||
"@vue/cli-plugin-babel": "^3.7.0", | ||
"@vue/cli-service": "^3.7.0", | ||
"vue-template-compiler": "^2.5.21" | ||
}, | ||
"postcss": { | ||
"plugins": { | ||
"autoprefixer": {} | ||
} | ||
}, | ||
"browserslist": [ | ||
"> 1%", | ||
"last 2 versions" | ||
], | ||
"gitHooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> | ||
<title>viewer</title> | ||
</head> | ||
<body> | ||
<noscript> | ||
<strong>We're sorry but viewer doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> | ||
</noscript> | ||
<div id="app"></div> | ||
<!-- built files will be auto injected --> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<template> | ||
<div id="app"> | ||
<label> | ||
Search {{version}} Mappings: | ||
<input v-model="query"/> | ||
</label> | ||
<table> | ||
<thead> | ||
<th class="kind">Kind</th> | ||
<th>Obfuscated</th> | ||
<th>Searge</th> | ||
<th>MCP</th> | ||
<th>Spigot</th> | ||
<th>Yarn</th> | ||
</thead> | ||
<tbody> | ||
<tr v-for="mappings of queryEverything"> | ||
<td v-for="mapping in mappings">{{mapping}}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</template> | ||
<script> | ||
/* eslint-disable */ | ||
import fz from 'fuzzaldrin-plus'; | ||
import mappings from '../../mappings/1.14/1.14.json'; | ||
function querySet(query, set, kind) { | ||
if (!query) return []; | ||
const preparedQuery = fz.prepareQuery(query); | ||
const scores = {}; | ||
return set | ||
.map((mapping) => { | ||
const scorableFields = Object.values(mapping).map(toScore => fz.score(toScore, query, {preparedQuery})); | ||
scores[mapping.obf] = Math.max(...scorableFields); | ||
return mapping; | ||
}) | ||
.filter(mapping => scores[mapping.obf] > 1) | ||
.sort((a, b) => scores[b.obf] - scores[a.obf]) | ||
.map(map => Object.assign({kind}, map)) | ||
.map(mapping => [mapping, scores[mapping.obf]]) | ||
.slice(0, 20); | ||
} | ||
export default { | ||
name: 'app', | ||
data() { | ||
return { | ||
query: '', | ||
version: mappings.minecraftVersion, | ||
classes: mappings.classes, | ||
fields: mappings.fields, | ||
methods: mappings.methods | ||
} | ||
}, | ||
computed: { | ||
queryEverything() { | ||
const queriedClasses = querySet(this.query, this.classes, "Class"); | ||
const queriedFields = querySet(this.query, this.fields, "Field"); | ||
const queriedMethods = querySet(this.query, this.methods, "Method"); | ||
let combination = []; | ||
let x = 0; | ||
for (let j = 0; j < queriedClasses.length; j++) combination[x++] = queriedClasses[j]; | ||
for (let j = 0; j < queriedFields.length; j++) combination[x++] = queriedFields[j]; | ||
for (let j = 0; j < queriedMethods.length; j++) combination[x++] = queriedMethods[j]; | ||
return combination | ||
.sort((a, b) => b[1] - a[1]) | ||
.map(a => a[0]); | ||
} | ||
} | ||
} | ||
</script> | ||
<style> | ||
#app { | ||
font-family: Helvetica, Arial, sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
text-align: center; | ||
width: 95%; | ||
margin-left: auto; | ||
margin-right: auto; | ||
color: #2c3e50; | ||
} | ||
.kind { | ||
width: 5%; | ||
} | ||
table, td, th { | ||
border: 1px solid #ddd; | ||
text-align: left; | ||
} | ||
table { | ||
/*table-layout: fixed;*/ | ||
border-collapse: collapse; | ||
width: 100%; | ||
} | ||
th, td { | ||
padding: 5px; | ||
/*white-space: nowrap;*/ | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Vue from 'vue' | ||
import App from './App.vue' | ||
import router from './router' | ||
|
||
Vue.config.productionTip = false | ||
|
||
new Vue({ | ||
router, | ||
render: h => h(App) | ||
}).$mount('#app') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Vue from 'vue' | ||
import Router from 'vue-router' | ||
|
||
Vue.use(Router) | ||
|
||
export default new Router({ | ||
mode: 'history', | ||
base: process.env.BASE_URL, | ||
routes: [] | ||
}) |
Oops, something went wrong.