text stringlengths 1 2.83M | id stringlengths 16 152 | metadata dict | __index_level_0__ int64 0 949 |
|---|---|---|---|
export default { foo: 'bar' };
| modernweb-dev/web/packages/config-loader/test/fixtures/package-cjs/module-in-.mjs/my-project.config.mjs/0 | {
"file_path": "modernweb-dev/web/packages/config-loader/test/fixtures/package-cjs/module-in-.mjs/my-project.config.mjs",
"repo_id": "modernweb-dev",
"token_count": 10
} | 182 |
/**
* @license
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
export * from './modification.js';
export * from './predicates.js';
export * from './util.js';
export * from './walking.js';
| modernweb-dev/web/packages/dev-server-core/src/dom5/index.ts/0 | {
"file_path": "modernweb-dev/web/packages/dev-server-core/src/dom5/index.ts",
"repo_id": "modernweb-dev",
"token_count": 196
} | 183 |
import { Middleware } from 'koa';
import path from 'path';
import { Logger } from '../logger/Logger';
import { Plugin } from '../plugins/Plugin';
/**
* Sets up a middleware which allows plugins to serve files instead of looking it up in the file system.
*/
export function pluginServeMiddleware(logger: Logger, plugins: Plugin[]): Middleware {
const servePlugins = plugins.filter(p => 'serve' in p);
if (servePlugins.length === 0) {
// nothing to serve
return (ctx, next) => next();
}
return async (context, next) => {
for (const plugin of servePlugins) {
const response = await plugin.serve?.(context);
if (typeof response === 'object') {
if (response.body == null) {
throw new Error(
'A serve result must contain a body. Use the transform hook to change only the mime type.',
);
}
context.body = response.body;
if (response.type != null) {
context.type = response.type;
} else {
context.type = path.extname(path.basename(context.path));
}
if (response.headers) {
for (const [k, v] of Object.entries(response.headers)) {
context.response.set(k, v);
}
}
logger.debug(`Plugin ${plugin.name} served ${context.path}.`);
context.status = 200;
return;
} else if (typeof response === 'string') {
context.body = response;
context.type = path.extname(path.basename(context.path));
logger.debug(`Plugin ${plugin.name} served ${context.path}.`);
context.status = 200;
return;
}
}
return next();
};
}
| modernweb-dev/web/packages/dev-server-core/src/middleware/pluginServeMiddleware.ts/0 | {
"file_path": "modernweb-dev/web/packages/dev-server-core/src/middleware/pluginServeMiddleware.ts",
"repo_id": "modernweb-dev",
"token_count": 667
} | 184 |
import { Server } from 'net';
import WebSocket from 'ws';
import { EventEmitter } from './EventEmitter.js';
export const NAME_WEB_SOCKET_IMPORT = '/__web-dev-server__web-socket.js';
export const NAME_WEB_SOCKET_API = 'wds';
export type WebSocketData = { type: string } & Record<string, unknown>;
export interface Events {
message: { webSocket: WebSocket; data: WebSocketData };
}
/**
* Manages web sockets. When the browser opens a web socket connection, the socket is stored
* until it is disconnected. The dev server or plugins can then send messages to the browser.
*/
export class WebSocketsManager extends EventEmitter<Events> {
public webSocketImport = NAME_WEB_SOCKET_IMPORT;
public webSocketServer: WebSocket.Server;
private openSockets = new Set<WebSocket>();
constructor(server: Server) {
super();
this.webSocketServer = new WebSocket.Server({
noServer: true,
path: `/${NAME_WEB_SOCKET_API}`,
});
this.webSocketServer.on('connection', webSocket => {
this.openSockets.add(webSocket);
webSocket.on('close', () => {
this.openSockets.delete(webSocket);
});
webSocket.on('message', rawData => {
try {
const data = JSON.parse(rawData.toString());
if (!data.type) {
throw new Error('Missing property "type".');
}
this.emit('message', { webSocket, data });
} catch (error) {
console.error('Failed to parse websocket event received from the browser: ', rawData);
console.error(error);
}
});
});
server.on('upgrade', (request, socket, head) => {
if (request.url === this.webSocketServer.options.path) {
this.webSocketServer.handleUpgrade(request, socket, head, ws => {
this.webSocketServer.emit('connection', ws, request);
});
}
});
}
/**
* Imports the given path, executing the module as well as a default export if it exports a function.
*
* This is a built-in web socket message and will be handled automatically.
*
* @param importPath the path to import
* @param args optional args to pass to the function that is called.
*/
sendImport(importPath: string, args: unknown[] = []) {
this.send(JSON.stringify({ type: 'import', data: { importPath, args } }));
}
/**
* Logs a message to the browser console of all connected web sockets.
*
* This is a built-in web socket message and will be handled automatically.
*
* @param text message to send
*/
sendConsoleLog(text: string) {
this.sendImport(`data:text/javascript,console.log(${JSON.stringify(text)});`);
}
/**
* Sends messages to all connected web sockets.
*
* @param message
*/
send(message: string) {
for (const socket of this.openSockets) {
if (socket.readyState === socket.OPEN) {
socket.send(message);
}
}
}
}
| modernweb-dev/web/packages/dev-server-core/src/web-sockets/WebSocketsManager.ts/0 | {
"file_path": "modernweb-dev/web/packages/dev-server-core/src/web-sockets/WebSocketsManager.ts",
"repo_id": "modernweb-dev",
"token_count": 1054
} | 185 |
import { expect } from 'chai';
import path from 'path';
import fs from 'fs';
import { nanoid } from 'nanoid';
import { createTestServer, timeout } from '../helpers.js';
import { DevServer } from '../../src/server/DevServer.js';
const fixtureDir = path.resolve(__dirname, '..', 'fixtures', 'basic');
const testFileAName = '/cached-file-a.js';
const testFileBName = '/cached-file-b.js';
const testFileAPath = path.join(fixtureDir, testFileAName);
const testFileBPath = path.join(fixtureDir, testFileBName);
describe('etag cache middleware', () => {
let host: string;
let server: DevServer;
beforeEach(async () => {
({ host, server } = await createTestServer());
});
afterEach(() => {
server.stop();
});
context('', () => {
beforeEach(() => {
fs.writeFileSync(testFileAPath, '// this file is cached', 'utf-8');
});
afterEach(() => {
fs.unlinkSync(testFileAPath);
});
it("returns 304 responses if file hasn't changed", async () => {
const initialResponse = await fetch(`${host}${testFileAName}`);
const etag = initialResponse.headers.get('etag')!;
expect(initialResponse.status).to.equal(200);
expect(await initialResponse.text()).to.equal('// this file is cached');
expect(etag).to.be.a('string');
const cachedResponse = await fetch(`${host}${testFileAName}`, {
headers: { 'If-None-Match': etag, 'Cache-Control': 'max-age=3600' },
});
expect(cachedResponse.status).to.equal(304);
expect(await cachedResponse.text()).to.equal('');
});
});
context('', () => {
beforeEach(() => {
fs.writeFileSync(testFileBPath, '// this file is cached', 'utf-8');
});
afterEach(() => {
fs.unlinkSync(testFileBPath);
});
it('returns 200 responses if file changed', async () => {
fs.writeFileSync(testFileBPath, '// this file is cached', 'utf-8');
const initialResponse = await fetch(`${host}${testFileBName}`);
const etag = initialResponse.headers.get('etag');
expect(initialResponse.status).to.equal(200);
expect(await initialResponse.text()).to.equal('// this file is cached');
expect(etag).to.be.a('string');
await timeout(10);
const fileContent = `// the cache is busted${nanoid()}`;
fs.writeFileSync(testFileBPath, fileContent, 'utf-8');
server.fileWatcher.emit('change', testFileBPath);
const headers = { headers: { 'if-none-match': etag } as Record<string, string> };
const cachedResponse = await fetch(`${host}${testFileBName}`, headers);
expect(cachedResponse.status).to.equal(200);
expect(await cachedResponse.text()).to.equal(fileContent);
});
});
});
| modernweb-dev/web/packages/dev-server-core/test/middleware/etagCacheMiddleware.test.ts/0 | {
"file_path": "modernweb-dev/web/packages/dev-server-core/test/middleware/etagCacheMiddleware.test.ts",
"repo_id": "modernweb-dev",
"token_count": 1010
} | 186 |
import { h, render } from 'preact';
render(
<main>
<h1>Hello World!</h1>
</main>,
document.body,
);
| modernweb-dev/web/packages/dev-server-esbuild/demo/jsx/app.jsx/0 | {
"file_path": "modernweb-dev/web/packages/dev-server-esbuild/demo/jsx/app.jsx",
"repo_id": "modernweb-dev",
"token_count": 49
} | 187 |
export { esbuildPlugin } from './esbuildPluginFactory.js';
| modernweb-dev/web/packages/dev-server-esbuild/src/index.ts/0 | {
"file_path": "modernweb-dev/web/packages/dev-server-esbuild/src/index.ts",
"repo_id": "modernweb-dev",
"token_count": 17
} | 188 |
import { expect } from 'chai';
import { createTestServer, expectIncludes } from '@web/dev-server-core/test-helpers';
import { esbuildPlugin } from '../src/index.js';
const modernJs = `
class MyClass {
static myStaticField = 'foo';
#myPrivateField = 'bar';
myField = 'x';
}
const myClass = new MyClass();
const optionalChaining = window.bar?.foo;
try {
// do something
} catch {
// catch it
}
const spread = {
...foo,
...bar
};
async function myFunction() {
await foo;
await bar;
}
`;
const syntax = {
classes: 'class MyClass {',
classFields: ["static myStaticField = 'foo';", "#myPrivateField = 'bar';", "myField = 'x';"],
optionalChaining: 'const optionalChaining = window.bar?.foo;',
optionalCatch: '} catch {',
objectSpread: ['...foo,', '...bar'],
asyncFunctions: ['async function myFunction() {', 'await foo;', 'await bar;'],
};
const transformedSyntax = {
classFields: [
'var __publicField =',
'__privateAdd(this, _myPrivateField, "bar");',
'__publicField(this, "myField", "x");',
'__publicField(MyClass, "myStaticField", "foo");',
],
optionalChaining: 'const optionalChaining = (_a = window.bar) == null ? void 0 : _a.foo;',
optionalCatch: '} catch (e) {',
objectSpread: 'const spread = __spreadValues(__spreadValues({}, foo), bar)',
asyncFunctions: [
'var __async = (__this, __arguments, generator) => {',
'return __async(this, null, function* () {',
'yield foo;',
'yield bar;',
],
};
describe('esbuildPlugin target', function () {
it('does not transform anything when set to esnext', async () => {
const { server, host } = await createTestServer({
rootDir: __dirname,
plugins: [
{
name: 'test',
serve(context) {
if (context.path === '/foo.js') {
return modernJs;
}
},
},
esbuildPlugin({ target: 'esnext' }),
],
});
try {
const response = await fetch(`${host}/foo.js`);
const text = await response.text();
expect(response.status).to.equal(200);
expect(response.headers.get('content-type')).to.equal(
'application/javascript; charset=utf-8',
);
expectIncludes(text, syntax.classes);
for (const e of syntax.classFields) {
expectIncludes(text, e);
}
expectIncludes(text, syntax.optionalChaining);
expectIncludes(text, syntax.optionalCatch);
for (const e of syntax.objectSpread) {
expectIncludes(text, e);
}
for (const e of syntax.asyncFunctions) {
expectIncludes(text, e);
}
} finally {
server.stop();
}
});
it('can transform to es2020', async () => {
const { server, host } = await createTestServer({
rootDir: __dirname,
plugins: [
{
name: 'test',
serve(context) {
if (context.path === '/foo.js') {
return modernJs;
}
},
},
esbuildPlugin({ js: true, target: 'es2020' }),
],
});
try {
const response = await fetch(`${host}/foo.js`);
const text = await response.text();
expect(response.status).to.equal(200);
expect(response.headers.get('content-type')).to.equal(
'application/javascript; charset=utf-8',
);
expectIncludes(text, syntax.classes);
for (const e of transformedSyntax.classFields) {
expectIncludes(text, e);
}
expectIncludes(text, syntax.optionalChaining);
expectIncludes(text, syntax.optionalCatch);
for (const e of syntax.objectSpread) {
expectIncludes(text, e);
}
for (const e of syntax.asyncFunctions) {
expectIncludes(text, e);
}
} finally {
server.stop();
}
});
it('can transform to es2019', async () => {
const { server, host } = await createTestServer({
rootDir: __dirname,
plugins: [
{
name: 'test',
serve(context) {
if (context.path === '/foo.js') {
return modernJs;
}
},
},
esbuildPlugin({ js: true, target: 'es2019' }),
],
});
try {
const response = await fetch(`${host}/foo.js`);
const text = await response.text();
expect(response.status).to.equal(200);
expect(response.headers.get('content-type')).to.equal(
'application/javascript; charset=utf-8',
);
expectIncludes(text, syntax.classes);
for (const e of transformedSyntax.classFields) {
expectIncludes(text, e);
}
expectIncludes(text, transformedSyntax.optionalChaining);
expectIncludes(text, syntax.optionalCatch);
for (const e of syntax.objectSpread) {
expectIncludes(text, e);
}
for (const e of syntax.asyncFunctions) {
expectIncludes(text, e);
}
} finally {
server.stop();
}
});
it('can transform to es2018', async () => {
const { server, host } = await createTestServer({
rootDir: __dirname,
plugins: [
{
name: 'test',
serve(context) {
if (context.path === '/foo.js') {
return modernJs;
}
},
},
esbuildPlugin({ js: true, target: 'es2018' }),
],
});
try {
const response = await fetch(`${host}/foo.js`);
const text = await response.text();
expect(response.status).to.equal(200);
expect(response.headers.get('content-type')).to.equal(
'application/javascript; charset=utf-8',
);
expectIncludes(text, syntax.classes);
for (const e of transformedSyntax.classFields) {
expectIncludes(text, e);
}
expectIncludes(text, transformedSyntax.optionalChaining);
expectIncludes(text, transformedSyntax.optionalCatch);
for (const e of syntax.objectSpread) {
expectIncludes(text, e);
}
for (const e of syntax.asyncFunctions) {
expectIncludes(text, e);
}
} finally {
server.stop();
}
});
it('can transform to es2017', async () => {
const { server, host } = await createTestServer({
rootDir: __dirname,
plugins: [
{
name: 'test',
serve(context) {
if (context.path === '/foo.js') {
return modernJs;
}
},
},
esbuildPlugin({ js: true, target: 'es2017' }),
],
});
try {
const response = await fetch(`${host}/foo.js`);
const text = await response.text();
expect(response.status).to.equal(200);
expect(response.headers.get('content-type')).to.equal(
'application/javascript; charset=utf-8',
);
expectIncludes(text, syntax.classes);
for (const e of transformedSyntax.classFields) {
expectIncludes(text, e);
}
expectIncludes(text, transformedSyntax.optionalChaining);
expectIncludes(text, transformedSyntax.optionalCatch);
expectIncludes(text, transformedSyntax.objectSpread);
for (const e of syntax.asyncFunctions) {
expectIncludes(text, e);
}
} finally {
server.stop();
}
});
it('can transform to es2016', async () => {
const { server, host } = await createTestServer({
rootDir: __dirname,
plugins: [
{
name: 'test',
serve(context) {
if (context.path === '/foo.js') {
return modernJs;
}
},
},
esbuildPlugin({ js: true, target: 'es2016' }),
],
});
try {
const response = await fetch(`${host}/foo.js`);
const text = await response.text();
expect(response.status).to.equal(200);
expect(response.headers.get('content-type')).to.equal(
'application/javascript; charset=utf-8',
);
expectIncludes(text, syntax.classes);
for (const e of transformedSyntax.classFields) {
expectIncludes(text, e);
}
expectIncludes(text, transformedSyntax.optionalChaining);
expectIncludes(text, transformedSyntax.optionalCatch);
expectIncludes(text, transformedSyntax.objectSpread);
for (const e of transformedSyntax.asyncFunctions) {
expectIncludes(text, e);
}
} finally {
server.stop();
}
});
it('can transform inline scripts', async () => {
const { server, host } = await createTestServer({
rootDir: __dirname,
plugins: [
{
name: 'test',
serve(context) {
if (context.path === '/index.html') {
return `<html>
<body>
<script type="module">${modernJs}</script>
</body>
</html>`;
}
},
},
esbuildPlugin({ js: true, target: 'es2016' }),
],
});
try {
const response = await fetch(`${host}/index.html`);
const text = await response.text();
expect(response.status).to.equal(200);
expect(response.headers.get('content-type')).to.equal('text/html; charset=utf-8');
expectIncludes(text, syntax.classes);
for (const e of transformedSyntax.classFields) {
expectIncludes(text, e);
}
expectIncludes(text, transformedSyntax.optionalChaining);
expectIncludes(text, transformedSyntax.optionalCatch);
expectIncludes(text, transformedSyntax.objectSpread);
for (const e of transformedSyntax.asyncFunctions) {
expectIncludes(text, e);
}
} finally {
server.stop();
}
});
it('should leave non-js types as they are', async () => {
const importmapString = '{"imports":{"foo":"./bar.js"}}';
const jsonString = '{test:1}';
const { server, host } = await createTestServer({
rootDir: __dirname,
plugins: [
{
name: 'test',
serve(context) {
if (context.path === '/index.html') {
return `<html>
<body>
<script type="importmap">${importmapString}</script>
<script type="application/json">${jsonString}</script>
</body>
</html>`;
}
},
},
esbuildPlugin({ js: true, target: 'es2016' }),
],
});
try {
const response = await fetch(`${host}/index.html`);
const text = await response.text();
expect(response.status).to.equal(200);
expect(response.headers.get('content-type')).to.equal('text/html; charset=utf-8');
expect(text).to.include(importmapString);
expect(text).to.include(jsonString);
} finally {
server.stop();
}
});
});
| modernweb-dev/web/packages/dev-server-esbuild/test/target.test.ts/0 | {
"file_path": "modernweb-dev/web/packages/dev-server-esbuild/test/target.test.ts",
"repo_id": "modernweb-dev",
"token_count": 4535
} | 189 |
import { Plugin, Logger, getRequestFilePath } from '@web/dev-server-core';
import {
ParsedImportMap,
parse as parseFromObject,
parseFromString,
resolve,
} from '@import-maps/resolve';
import { getHtmlPath } from '@web/dev-server-core';
import { parse as parseHtml, serialize as serializeHtml, Element as ElementAst } from 'parse5';
import path from 'path';
import {
IMPORT_MAP_PARAM,
normalizeInjectSetting,
withImportMapIdParam,
getRequestImportMapId,
shouldInject,
mergeImportMaps,
getDocumentBaseUrl,
} from './utils.js';
import { ImportMap } from '@import-maps/resolve';
import {
createElement,
findElement,
findElements,
getTagName,
isHtmlFragment,
getAttribute,
getTextContent,
hasAttribute,
setAttribute,
setTextContent,
} from '@web/parse5-utils';
export interface ImportMapData {
htmlPath: string;
importMap: ParsedImportMap;
importMapString: string;
}
export interface InjectSetting {
include?: string;
exclude?: string;
importMap: ImportMap;
}
export interface ImportMapsPluginConfig {
inject?: InjectSetting | InjectSetting[];
}
export interface NormalizedInjectSetting {
include?: (path: string) => boolean;
exclude?: (path: string) => boolean;
importMap: ImportMap;
}
function prepend(parent: any, node: any) {
// use 'any' because parse5 types are off
parent.childNodes.unshift(node);
node.parentNode = parent;
}
export function importMapsPlugin(config: ImportMapsPluginConfig = {}): Plugin {
const injectSettings = normalizeInjectSetting(config.inject);
const importMapsById: ImportMapData[] = [];
const importMapsIdsByHtmlPath = new Map<string, number>();
let logger: Logger;
let rootDir: string;
return {
name: 'import-map',
serverStart(args) {
({ logger } = args);
({ rootDir } = args.config);
},
/**
* Extracts import maps from HTML pages.
*/
transform(context) {
if (!context.response.is('html') || isHtmlFragment(context.body as string)) {
return;
}
let toInject = injectSettings.find(i => shouldInject(context.path, i));
// collect import map in HTML page
const documentAst = parseHtml(context.body as string);
const headNode = findElement(documentAst, el => getTagName(el) === 'head');
if (!headNode) {
throw new Error('Internal error: HTML document did not generate a <head>.');
}
const importMapScripts: ElementAst[] = findElements(
documentAst,
el => getTagName(el) === 'script' && getAttribute(el, 'type') === 'importmap',
);
if (toInject && importMapScripts.length === 0) {
// inject import map element into the page
const script = createElement('script', { type: 'importmap' });
setTextContent(script, JSON.stringify(toInject.importMap));
importMapScripts.push(script);
prepend(headNode, script);
toInject = undefined;
}
if (importMapScripts.length === 0) {
// HTML page has no import map
return;
}
if (importMapScripts.length !== 1) {
logger.warn(
'Multiple import maps on a page are not supported, using the first import map found.',
);
}
const [importMapScript] = importMapScripts;
if (getAttribute(importMapScript, 'src')) {
throw new Error('Import maps with a "src" attribute are not yet supported.');
}
const htmlPath = getHtmlPath(context.path);
const importMapString = getTextContent(importMapScript);
let importMapId = importMapsById.findIndex(i => i.importMapString === importMapString);
if (importMapId === -1) {
// this is the first time we encounter this import map for this
const baseNode = findElement(headNode, el => getTagName(el) === 'base');
const documentBaseUrl = getDocumentBaseUrl(context, baseNode);
// parse the import map and store it with the HTML path
try {
let importMap = parseFromString(importMapString, documentBaseUrl);
if (toInject) {
// we have to inject an import map but there was already one in the HTML file
// we merge it with the existing import
const parsedImportMapToInject = parseFromObject(toInject.importMap, documentBaseUrl);
importMap = mergeImportMaps(parsedImportMapToInject, importMap);
setTextContent(importMapScript, JSON.stringify(importMap));
toInject = undefined;
}
importMapsById.push({ htmlPath, importMap, importMapString });
importMapId = importMapsById.length - 1;
} catch (error) {
const filePath = getRequestFilePath(context.url, rootDir);
const relativeFilePath = path.relative(process.cwd(), filePath);
logger.warn(
`Failed to parse import map in "${relativeFilePath}": ${(error as Error).message}`,
);
return;
}
}
importMapsIdsByHtmlPath.set(htmlPath, importMapId);
const scripts = findElements(
documentAst,
el => getTagName(el) === 'script' && hasAttribute(el, 'src'),
);
const links = findElements(
documentAst,
el =>
getTagName(el) === 'link' &&
['preload', 'prefetch', 'modulepreload'].includes(getAttribute(el, 'rel') ?? '') &&
hasAttribute(el, 'href'),
);
// add import map id to all script tags
for (const script of scripts) {
const src = getAttribute(script, 'src');
if (src) {
setAttribute(script, 'src', withImportMapIdParam(src, String(importMapId)));
}
}
// add import map id to all preload links
for (const link of links) {
const href = getAttribute(link, 'href');
if (href) {
setAttribute(link, 'href', withImportMapIdParam(href, String(importMapId)));
}
}
return serializeHtml(documentAst);
},
/**
* Add import map param to imports in inline modules.
*/
transformImport({ source, context }) {
const importMapId = getRequestImportMapId(context, importMapsIdsByHtmlPath);
if (importMapId == null) {
return;
}
return withImportMapIdParam(source, String(importMapId));
},
/**
* Resolves imports using import maps. When the source file contains an import map
* search parameter, we look up the associated import map and use that to resolve
* the import.
*/
resolveImport({ source, context }) {
const importMapId = getRequestImportMapId(context, importMapsIdsByHtmlPath);
if (importMapId == null) {
return;
}
const data = importMapsById[Number(importMapId)];
if (!data) {
throw Error(
`Something went wrong resolving an import map. Could not find import map with id ${importMapId}.` +
` Are you adding the URL search parameter ${IMPORT_MAP_PARAM} manually?`,
);
}
const { resolvedImport, matched } = resolve(source, data.importMap, context.URL);
// console.log({ resolvedImport });
if (matched && resolvedImport) {
return resolvedImport.href.startsWith(context.URL.origin)
? resolvedImport.pathname
: resolvedImport.href;
}
},
};
}
| modernweb-dev/web/packages/dev-server-import-maps/src/importMapsPlugin.ts/0 | {
"file_path": "modernweb-dev/web/packages/dev-server-import-maps/src/importMapsPlugin.ts",
"repo_id": "modernweb-dev",
"token_count": 2785
} | 190 |
import { LitElement, html } from 'lit-element';
class MyApp extends LitElement {
static properties = {
foo: { type: String },
};
constructor() {
super();
this.foo = 'bar';
}
render() {
return html`<p>Hello world</p>`;
}
}
customElements.define('my-app', MyApp);
| modernweb-dev/web/packages/dev-server-legacy/demo/app.js/0 | {
"file_path": "modernweb-dev/web/packages/dev-server-legacy/demo/app.js",
"repo_id": "modernweb-dev",
"token_count": 110
} | 191 |
/* eslint-disable no-control-regex */
import path from 'path';
import whatwgUrl from 'whatwg-url';
import {
Plugin as WdsPlugin,
DevServerCoreConfig,
FSWatcher,
PluginError,
PluginSyntaxError,
Context,
getRequestFilePath,
} from '@web/dev-server-core';
import {
queryAll,
predicates,
getTextContent,
setTextContent,
} from '@web/dev-server-core/dist/dom5';
import { parse as parseHtml, serialize as serializeHtml } from 'parse5';
import { CustomPluginOptions, Plugin as RollupPlugin, TransformPluginContext } from 'rollup';
import { InputOptions } from 'rollup';
import { red, cyan } from 'nanocolors';
import { toBrowserPath, isAbsoluteFilePath, isOutsideRootDir } from './utils.js';
import { createRollupPluginContextAdapter } from './createRollupPluginContextAdapter.js';
import { createRollupPluginContexts, RollupPluginContexts } from './createRollupPluginContexts.js';
const NULL_BYTE_PARAM = 'web-dev-server-rollup-null-byte';
const VIRTUAL_FILE_PREFIX = '/__web-dev-server__/rollup';
const WDS_FILE_PREFIX = '/__web-dev-server__';
const OUTSIDE_ROOT_REGEXP = /\/__wds-outside-root__\/([0-9]+)\/(.*)/;
/**
* Wraps rollup error in a custom error for web dev server.
*/
function wrapRollupError(filePath: string, context: Context, error: any) {
if (typeof error == null || typeof error !== 'object') {
return error;
}
if (typeof error?.loc?.line === 'number' && typeof error?.loc?.column === 'number') {
return new PluginSyntaxError(
// replace file path in error message since it will be reported be the dev server
error.message.replace(new RegExp(`(\\s*in\\s*)?(${filePath})`), ''),
filePath,
context.body as string,
error.loc.line as number,
error.loc.column as number,
);
}
return error;
}
export interface RollupAdapterOptions {
throwOnUnresolvedImport?: boolean;
}
const resolverCache = new WeakMap<Context, WeakMap<WdsPlugin, Set<string>>>();
export function rollupAdapter(
rollupPlugin: RollupPlugin,
rollupInputOptions: Partial<InputOptions> = {},
adapterOptions: RollupAdapterOptions = {},
): WdsPlugin {
if (typeof rollupPlugin !== 'object') {
throw new Error('rollupAdapter should be called with a rollup plugin object.');
}
const transformedFiles = new Set();
const pluginMetaPerModule = new Map<string, CustomPluginOptions>();
let rollupPluginContexts: RollupPluginContexts;
let fileWatcher: FSWatcher;
let config: DevServerCoreConfig;
let rootDir: string;
let idResolvers: Array<Required<RollupPlugin>['resolveId']> = [];
function savePluginMeta(
id: string,
{ meta }: { meta?: CustomPluginOptions | null | undefined } = {},
) {
if (!meta) {
return;
}
const previousMeta = pluginMetaPerModule.get(id);
pluginMetaPerModule.set(id, { ...previousMeta, ...meta });
}
const wdsPlugin: WdsPlugin = {
name: rollupPlugin.name,
async serverStart(args) {
({ fileWatcher, config } = args);
({ rootDir } = config);
rollupPluginContexts = await createRollupPluginContexts(rollupInputOptions);
idResolvers = [];
// call the options and buildStart hooks
let transformedOptions;
if (typeof rollupPlugin.options === 'function') {
transformedOptions =
(await rollupPlugin.options?.call(
rollupPluginContexts.minimalPluginContext,
rollupInputOptions,
)) ?? rollupInputOptions;
} else {
transformedOptions = rollupInputOptions;
}
if (typeof rollupPlugin.buildStart === 'function') {
await rollupPlugin.buildStart?.call(
rollupPluginContexts.pluginContext,
rollupPluginContexts.normalizedInputOptions,
);
}
if (
transformedOptions &&
transformedOptions.plugins &&
Array.isArray(transformedOptions.plugins)
) {
for (const subPlugin of transformedOptions.plugins) {
if (subPlugin && !Array.isArray(subPlugin)) {
const resolveId = (subPlugin as RollupPlugin).resolveId;
if (resolveId) {
idResolvers.push(resolveId);
}
}
}
}
if (rollupPlugin.resolveId) {
idResolvers.push(rollupPlugin.resolveId);
}
},
resolveImportSkip(context: Context, source: string, importer: string) {
const resolverCacheForContext =
resolverCache.get(context) ?? new WeakMap<WdsPlugin, Set<string>>();
resolverCache.set(context, resolverCacheForContext);
const resolverCacheForPlugin = resolverCacheForContext.get(wdsPlugin) ?? new Set<string>();
resolverCacheForContext.set(wdsPlugin, resolverCacheForPlugin);
resolverCacheForPlugin.add(`${source}:${importer}`);
},
async resolveImport({ source, context, code, column, line, resolveOptions }) {
if (context.response.is('html') && source.startsWith('�')) {
// when serving HTML a null byte gets parsed as an unknown character
// we remap it to a null byte here so that it is handled properly downstream
// this isn't a perfect solution
source = source.replace('�', '\0');
}
// if we just transformed this file and the import is an absolute file path
// we need to rewrite it to a browser path
const injectedFilePath = path.normalize(source).startsWith(rootDir);
if (!injectedFilePath && idResolvers.length === 0) {
return;
}
const isVirtualModule = source.startsWith('\0');
if (
!injectedFilePath &&
!path.isAbsolute(source) &&
whatwgUrl.parseURL(source) != null &&
!isVirtualModule
) {
// don't resolve relative and valid urls
return source;
}
const filePath = getRequestFilePath(context.url, rootDir);
try {
const rollupPluginContext = createRollupPluginContextAdapter(
rollupPluginContexts.pluginContext,
wdsPlugin,
config,
fileWatcher,
context,
pluginMetaPerModule,
);
let resolvableImport = source;
let importSuffix = '';
// we have to special case node-resolve because it doesn't support resolving
// with hash/params at the moment
if (rollupPlugin.name === 'node-resolve') {
if (source[0] === '#') {
// private import
resolvableImport = source;
} else {
const [withoutHash, hash] = source.split('#');
const [importPath, params] = withoutHash.split('?');
importSuffix = `${params ? `?${params}` : ''}${hash ? `#${hash}` : ''}`;
resolvableImport = importPath;
}
}
let result = null;
const resolverCacheForContext =
resolverCache.get(context) ?? new WeakMap<WdsPlugin, Set<string>>();
resolverCache.set(context, resolverCacheForContext);
const resolverCacheForPlugin = resolverCacheForContext.get(wdsPlugin) ?? new Set<string>();
resolverCacheForContext.set(wdsPlugin, resolverCacheForPlugin);
if (resolverCacheForPlugin.has(`${source}:${filePath}`)) {
return undefined;
}
for (const idResolver of idResolvers) {
const idResolverHandler =
typeof idResolver === 'function' ? idResolver : idResolver.handler;
result = await idResolverHandler.call(rollupPluginContext, resolvableImport, filePath, {
...resolveOptions,
attributes: {
...((resolveOptions?.assertions as Record<string, string>) ?? {}),
},
isEntry: false,
});
if (result) {
break;
}
}
if (!result && injectedFilePath) {
// the import is a file path but it was not resolved by this plugin
// we do assign it here so that it will be converted to a browser path
result = resolvableImport;
}
let resolvedImportPath: string | undefined = undefined;
if (typeof result === 'string') {
resolvedImportPath = result;
} else if (typeof result === 'object' && typeof result?.id === 'string') {
resolvedImportPath = result.id;
savePluginMeta(result.id, result);
}
if (!resolvedImportPath) {
if (
!['/', './', '../'].some(prefix => resolvableImport.startsWith(prefix)) &&
adapterOptions.throwOnUnresolvedImport
) {
const errorMessage = red(`Could not resolve import ${cyan(`"${source}"`)}.`);
if (
typeof code === 'string' &&
typeof column === 'number' &&
typeof line === 'number'
) {
throw new PluginSyntaxError(errorMessage, filePath, code, column, line);
} else {
throw new PluginError(errorMessage);
}
}
return undefined;
}
// if the resolved import includes a null byte (\0) there is some special logic
// these often are not valid file paths, so the browser cannot request them.
// we rewrite them to a special URL which we deconstruct later when we load the file
if (resolvedImportPath.includes('\0')) {
const filename = path.basename(
resolvedImportPath.replace(/\0*/g, '').split('?')[0].split('#')[0],
);
// if the resolve import path is outside our normal root, fully resolve the file path for rollup
const matches = resolvedImportPath.match(OUTSIDE_ROOT_REGEXP);
if (matches) {
const upDirs = new Array(parseInt(matches[1], 10) + 1).join(`..${path.sep}`);
resolvedImportPath = `\0${path.resolve(`${upDirs}${matches[2]}`)}`;
}
const urlParam = encodeURIComponent(resolvedImportPath);
return `${VIRTUAL_FILE_PREFIX}/${filename}?${NULL_BYTE_PARAM}=${urlParam}`;
}
// some plugins don't return a file path, so we just return it as is
if (!isAbsoluteFilePath(resolvedImportPath)) {
return `${resolvedImportPath}`;
}
// file already resolved outsided root dir
if (isOutsideRootDir(resolvedImportPath)) {
return `${resolvedImportPath}`;
}
const normalizedPath = path.normalize(resolvedImportPath);
// append a path separator to rootDir so we are actually testing containment
// of the normalized path within the rootDir folder
const checkRootDir = rootDir.endsWith(path.sep) ? rootDir : rootDir + path.sep;
if (!normalizedPath.startsWith(checkRootDir)) {
const relativePath = path.relative(rootDir, normalizedPath);
const dirUp = `..${path.sep}`;
const lastDirUpIndex = relativePath.lastIndexOf(dirUp) + 3;
const dirUpStrings = relativePath.substring(0, lastDirUpIndex).split(path.sep);
if (dirUpStrings.length === 0 || dirUpStrings.some(str => !['..', ''].includes(str))) {
// we expect the relative part to consist of only ../ or ..\\
const errorMessage =
red(`\n\nResolved ${cyan(source)} to ${cyan(resolvedImportPath)}.\n\n`) +
red(
'This path could not be converted to a browser path. Please file an issue with a reproduction.',
);
if (
typeof code === 'string' &&
typeof column === 'number' &&
typeof line === 'number'
) {
throw new PluginSyntaxError(errorMessage, filePath, code, column, line);
} else {
throw new PluginError(errorMessage);
}
}
const importPath = toBrowserPath(relativePath.substring(lastDirUpIndex));
resolvedImportPath = `/__wds-outside-root__/${dirUpStrings.length - 1}/${importPath}`;
} else {
const resolveRelativeTo = path.dirname(filePath);
const relativeImportFilePath = path.relative(resolveRelativeTo, resolvedImportPath);
resolvedImportPath = `./${toBrowserPath(relativeImportFilePath)}`;
}
return `${resolvedImportPath}${importSuffix}`;
} catch (error) {
throw wrapRollupError(filePath, context, error);
}
},
async serve(context) {
if (!rollupPlugin.load) {
return;
}
if (
context.path.startsWith(WDS_FILE_PREFIX) &&
!context.path.startsWith(VIRTUAL_FILE_PREFIX)
) {
return;
}
let filePath;
if (
context.path.startsWith(VIRTUAL_FILE_PREFIX) &&
context.URL.searchParams.has(NULL_BYTE_PARAM)
) {
// if this was a special URL constructed in resolveImport to handle null bytes,
// the file path is stored in the search paramter
filePath = context.URL.searchParams.get(NULL_BYTE_PARAM) as string;
} else {
filePath = path.join(rootDir, context.path);
}
try {
const rollupPluginContext = createRollupPluginContextAdapter(
rollupPluginContexts.pluginContext,
wdsPlugin,
config,
fileWatcher,
context,
pluginMetaPerModule,
);
let result;
if (typeof rollupPlugin.load === 'function') {
result = await rollupPlugin.load?.call(rollupPluginContext, filePath);
}
if (typeof result === 'string') {
return { body: result, type: 'js' };
}
if (result != null && typeof result?.code === 'string') {
savePluginMeta(filePath, result);
return { body: result.code, type: 'js' };
}
} catch (error) {
throw wrapRollupError(filePath, context, error);
}
return undefined;
},
async transform(context) {
if (!rollupPlugin.transform) {
return;
}
if (context.path.startsWith(WDS_FILE_PREFIX)) {
return;
}
if (context.response.is('js')) {
const filePath = path.join(rootDir, context.path);
try {
const rollupPluginContext = createRollupPluginContextAdapter(
rollupPluginContexts.transformPluginContext,
wdsPlugin,
config,
fileWatcher,
context,
pluginMetaPerModule,
);
let result;
if (typeof rollupPlugin.transform === 'function') {
result = await rollupPlugin.transform?.call(
rollupPluginContext as TransformPluginContext,
context.body as string,
filePath,
);
}
let transformedCode: string | undefined = undefined;
if (typeof result === 'string') {
transformedCode = result;
}
if (typeof result === 'object' && typeof result?.code === 'string') {
savePluginMeta(filePath, result);
transformedCode = result.code;
}
if (transformedCode) {
transformedFiles.add(context.path);
return transformedCode;
}
return;
} catch (error) {
throw wrapRollupError(filePath, context, error);
}
}
if (context.response.is('html')) {
const documentAst = parseHtml(context.body as string);
const inlineScripts = queryAll(
documentAst,
predicates.AND(
predicates.hasTagName('script'),
predicates.NOT(predicates.hasAttr('src')),
),
);
const filePath = getRequestFilePath(context.url, rootDir);
let transformed = false;
try {
for (const node of inlineScripts) {
const code = getTextContent(node);
const rollupPluginContext = createRollupPluginContextAdapter(
rollupPluginContexts.transformPluginContext,
wdsPlugin,
config,
fileWatcher,
context,
pluginMetaPerModule,
);
let result;
if (typeof rollupPlugin.transform === 'function') {
result = await rollupPlugin.transform?.call(
rollupPluginContext as TransformPluginContext,
code,
filePath,
);
}
let transformedCode: string | undefined = undefined;
if (typeof result === 'string') {
transformedCode = result;
}
if (typeof result === 'object' && typeof result?.code === 'string') {
savePluginMeta(filePath, result);
transformedCode = result.code;
}
if (transformedCode) {
transformedFiles.add(context.path);
setTextContent(node, transformedCode);
transformed = true;
}
}
if (transformed) {
return serializeHtml(documentAst);
}
} catch (error) {
throw wrapRollupError(filePath, context, error);
}
}
},
fileParsed(context) {
if (!rollupPlugin.moduleParsed) {
return;
}
const rollupPluginContext = createRollupPluginContextAdapter(
rollupPluginContexts.transformPluginContext,
wdsPlugin,
config,
fileWatcher,
context,
pluginMetaPerModule,
);
const filePath = getRequestFilePath(context.url, rootDir);
const info = rollupPluginContext.getModuleInfo(filePath);
if (!info) throw new Error(`Missing info for module ${filePath}`);
if (typeof rollupPlugin.moduleParsed === 'function') {
rollupPlugin.moduleParsed?.call(rollupPluginContext as TransformPluginContext, info);
}
},
};
return wdsPlugin;
}
| modernweb-dev/web/packages/dev-server-rollup/src/rollupAdapter.ts/0 | {
"file_path": "modernweb-dev/web/packages/dev-server-rollup/src/rollupAdapter.ts",
"repo_id": "modernweb-dev",
"token_count": 7632
} | 192 |
export const internalA = 'internal a value';
| modernweb-dev/web/packages/dev-server-rollup/test/node/fixtures/private-imports/internal-a.js/0 | {
"file_path": "modernweb-dev/web/packages/dev-server-rollup/test/node/fixtures/private-imports/internal-a.js",
"repo_id": "modernweb-dev",
"token_count": 11
} | 193 |
import path from 'path';
import {
createTestServer as originalCreateTestServer,
timeout,
fetchText,
expectIncludes,
} from '@web/dev-server-core/test-helpers';
import { DevServerCoreConfig, Logger } from '@web/dev-server-core';
export function createTestServer(config: Partial<DevServerCoreConfig> = {}, mockLogger?: Logger) {
return originalCreateTestServer(
{
rootDir: path.resolve(__dirname, 'fixtures', 'basic'),
...config,
},
mockLogger,
);
}
export { timeout, fetchText, expectIncludes };
| modernweb-dev/web/packages/dev-server-rollup/test/node/test-helpers.ts/0 | {
"file_path": "modernweb-dev/web/packages/dev-server-rollup/test/node/test-helpers.ts",
"repo_id": "modernweb-dev",
"token_count": 180
} | 194 |
console.log('loaded manager.js');
| modernweb-dev/web/packages/dev-server-storybook/demo/wc/.storybook/manager.js/0 | {
"file_path": "modernweb-dev/web/packages/dev-server-storybook/demo/wc/.storybook/manager.js",
"repo_id": "modernweb-dev",
"token_count": 10
} | 195 |
import { Plugin } from 'rollup';
import { mdjsToCsf } from 'storybook-addon-markdown-docs';
export function mdjsPlugin(type: string): Plugin {
return {
name: 'md',
transform(code, id) {
if (id.endsWith('.md')) {
return mdjsToCsf(code, id, type);
}
},
};
}
| modernweb-dev/web/packages/dev-server-storybook/src/build/rollup/mdjsPlugin.ts/0 | {
"file_path": "modernweb-dev/web/packages/dev-server-storybook/src/build/rollup/mdjsPlugin.ts",
"repo_id": "modernweb-dev",
"token_count": 125
} | 196 |
declare module 'storybook-addon-markdown-docs' {
export function mdjsToCsf(
markdown: string,
filePath: string,
projectType: string,
options?: Record<string, unknown>,
): Promise<string>;
}
| modernweb-dev/web/packages/dev-server-storybook/types/storybook-addon-markdown-docs/index.d.ts/0 | {
"file_path": "modernweb-dev/web/packages/dev-server-storybook/types/storybook-addon-markdown-docs/index.d.ts",
"repo_id": "modernweb-dev",
"token_count": 75
} | 197 |
<html>
<head>
<base href="/" />
</head>
<body>
<img width="100" src="./demo/logo.png" />
<h1>Demo app</h1>
<p>
<a href="foo/">Foo</a>
</p>
<p>
<a href="bar/">Bar</a>
</p>
<div id="test"></div>
</body>
<script type="module">
import './demo/index-rewrite/module-a.js';
window.__tests = {
moduleLoaded: window.__moduleALoaded && window.__moduleBLoaded,
};
document.getElementById('test').innerHTML = `<pre>${JSON.stringify(
window.__tests,
null,
2,
)}</pre>`;
</script>
</html>
| modernweb-dev/web/packages/dev-server/demo/index-rewrite/index.html/0 | {
"file_path": "modernweb-dev/web/packages/dev-server/demo/index-rewrite/index.html",
"repo_id": "modernweb-dev",
"token_count": 288
} | 198 |
import { getPortPromise } from 'portfinder';
import path from 'path';
import { DevServerCliArgs } from './readCliArgs.js';
import { mergeConfigs } from './mergeConfigs.js';
import { DevServerConfig } from './DevServerConfig.js';
import { esbuildPlugin } from '../plugins/esbuildPlugin.js';
import { watchPlugin } from '../plugins/watchPlugin.js';
import { nodeResolvePlugin } from '../plugins/nodeResolvePlugin.js';
import { DevServerStartError } from '../DevServerStartError.js';
const defaultConfig: Partial<DevServerConfig> = {
rootDir: process.cwd(),
hostname: 'localhost',
injectWebSocket: true,
clearTerminalOnReload: true,
middleware: [],
plugins: [],
chokidarOptions: {},
};
function validate(config: Record<string, unknown>, key: string, type: string) {
if (config[key] == null) {
return;
}
if (typeof config[key] !== type) {
throw new DevServerStartError(`Configuration error: The ${key} setting should be a ${type}.`);
}
}
const stringSettings = ['rootDir', 'hostname', 'basePath', 'appIndex', 'sslKey', 'sslCert'];
const numberSettings = ['port'];
const booleanSettings = ['watch', 'preserveSymlinks', 'http2', 'eventStream'];
export function validateConfig(config: Partial<DevServerConfig>) {
stringSettings.forEach(key => validate(config, key, 'string'));
numberSettings.forEach(key => validate(config, key, 'number'));
booleanSettings.forEach(key => validate(config, key, 'boolean'));
if (config.basePath != null && !config.basePath.startsWith('/')) {
throw new Error(`basePath property must start with a /. Received: ${config.basePath}`);
}
if (
config.esbuildTarget != null &&
!(typeof config.esbuildTarget === 'string' || Array.isArray(config.esbuildTarget))
) {
throw new Error(`Configuration error: The esbuildTarget setting should be a string or array.`);
}
if (
config.open != null &&
!(typeof config.open === 'string' || typeof config.open === 'boolean')
) {
throw new Error(`Configuration error: The open setting should be a string or boolean.`);
}
return config as DevServerConfig;
}
export async function parseConfig(
config: Partial<DevServerConfig>,
cliArgs?: DevServerCliArgs,
): Promise<DevServerConfig> {
const mergedConfigs = mergeConfigs(defaultConfig, config, cliArgs);
// backwards compatibility for configs written for es-dev-server, where middleware was
// spelled incorrectly as middlewares
if (Array.isArray((mergedConfigs as any).middlewares)) {
mergedConfigs.middleware!.push(...(mergedConfigs as any).middlewares);
}
const finalConfig = validateConfig(mergedConfigs);
// filter out non-objects from plugin list
finalConfig.plugins = (finalConfig.plugins ?? []).filter(pl => typeof pl === 'object');
// ensure rootDir is always resolved
if (typeof finalConfig.rootDir === 'string') {
finalConfig.rootDir = path.resolve(finalConfig.rootDir);
}
// generate a default random port
if (typeof finalConfig.port !== 'number') {
finalConfig.port = await getPortPromise({ port: 8000 });
}
if (finalConfig.nodeResolve) {
const userOptions = typeof config.nodeResolve === 'object' ? config.nodeResolve : undefined;
// do node resolve after user plugins, to allow user plugins to resolve imports
finalConfig.plugins!.push(
nodeResolvePlugin(finalConfig.rootDir!, finalConfig.preserveSymlinks, userOptions),
);
}
// map flags to plugin
if (finalConfig?.esbuildTarget) {
finalConfig.plugins!.unshift(esbuildPlugin(finalConfig.esbuildTarget));
}
if (finalConfig.watch) {
finalConfig.plugins!.unshift(watchPlugin());
}
return finalConfig;
}
| modernweb-dev/web/packages/dev-server/src/config/parseConfig.ts/0 | {
"file_path": "modernweb-dev/web/packages/dev-server/src/config/parseConfig.ts",
"repo_id": "modernweb-dev",
"token_count": 1140
} | 199 |
import './polyfills.js';
import { setupWorker } from 'msw/browser';
import { _registerMockRoutes } from './registerMockRoutes.js';
const bypassServiceWorker = new URL(window.location.href).searchParams.has('bypass-sw');
const worker = setupWorker();
const workerPromise = worker
.start({
serviceWorker: {
url: '__msw_sw__.js',
},
quiet: true,
// See https://github.com/mswjs/msw/discussions/1231#discussioncomment-2729999 if you'd like to warn if there's a unhandled request
onUnhandledRequest() {
return undefined;
},
})
.catch(() => {
console.error(`[MOCKS]: Failed to load Service Worker.
Did you forget to use the mockPlugin in the dev server?`);
return Promise.resolve();
});
/**
* It's unfortunate to override native `fetch`, and you should never do it, and please don't take this
* code as an example. We have to do this here because MSW removed this behavior which was released as
* a breaking change in a minor version https://github.com/mswjs/msw/issues/1981
*/
const originalFetch = window.fetch;
window.fetch = async (...args) => {
await workerPromise;
window.fetch = originalFetch;
return window.fetch(...args);
};
/**
* Mock the given mocked routes using a Service Worker.
*
* @param {import('./types.js').Mock[]} mocks
*/
function registerMockRoutes(...mocks) {
_registerMockRoutes(worker, bypassServiceWorker, ...mocks);
}
export { worker, registerMockRoutes };
| modernweb-dev/web/packages/mocks/browser.js/0 | {
"file_path": "modernweb-dev/web/packages/mocks/browser.js",
"repo_id": "modernweb-dev",
"token_count": 489
} | 200 |
// @ts-nocheck
import { createAddon } from '@web/storybook-utils';
import React from 'react';
import { addons } from '@storybook/manager-api';
import { registerAddon } from './register-addon.js';
// Storybook 7
registerAddon(addons, React, createAddon);
| modernweb-dev/web/packages/mocks/storybook/addon/manager.js/0 | {
"file_path": "modernweb-dev/web/packages/mocks/storybook/addon/manager.js",
"repo_id": "modernweb-dev",
"token_count": 84
} | 201 |
# @web/polyfills-loader
## 2.3.0
### Minor Changes
- 74b3e1bd: Set fetchPriority of polyfill scripts to `high`
## 2.2.0
### Minor Changes
- c185cbaa: Set minimum node version to 18
### Patch Changes
- Updated dependencies [c185cbaa]
- @web/parse5-utils@2.1.0
## 2.1.5
### Patch Changes
- 76a2f86f: update entrypoints
## 2.1.4
### Patch Changes
- 55d9ea1b: fix: export polyfills data
## 2.1.3
### Patch Changes
- 640ba85f: added types for main entry point
- Updated dependencies [640ba85f]
- @web/parse5-utils@2.0.2
## 2.1.2
### Patch Changes
- cb5da085: Minify `es-modules-shims`
## 2.1.1
### Patch Changes
- 85647c10: Update `lit-html`
- 5acaf838: Update `@typescript-eslint/parser`
## 2.1.0
### Minor Changes
- 6a8a7648: add support for the Scoped CustomElementRegistry polyfill (this is a prototype polyfill)
## 2.0.1
### Patch Changes
- c26d3730: Update TypeScript
## 2.0.0
### Major Changes
- febd9d9d: Set node 16 as the minimum version.
### Patch Changes
- Updated dependencies [febd9d9d]
- @web/parse5-utils@2.0.0
## 1.4.1
### Patch Changes
- f80b22ed: fix(polyfills-loader): reverse condition to load the polyfill for constructable stylesheets
## 1.4.0
### Minor Changes
- ab5abe10: feat(polyfills-loader): add URLPattern polyfill
## 1.3.5
### Patch Changes
- ca516a01: Update terser to 5.14.2
## 1.3.4
### Patch Changes
- e9508a24: fix: support node 17 & 18 by using md5 hashing
## 1.3.3
### Patch Changes
- d3492789: Fixed typo in the loadScriptFunction function parameter (attr to att).
## 1.3.2
### Patch Changes
- 16f33e3e: make polyfills loader work on IE11
- 283c9258: add missing dependency
- 642d5253: add missing dependency
## 1.3.1
### Patch Changes
- d872ce9c: fix: use correct property
## 1.3.0
### Minor Changes
- 03f1481c: Add option to externalize polyfills loader script
## 1.2.2
### Patch Changes
- 62623d18: fix: always load EMS for config option 'always'
## 1.2.1
### Patch Changes
- e24a47c2: Added support for module-shim
## 1.2.0
### Minor Changes
- 738043d1: feat: add constructible stylesheets polyfill to loader
## 1.1.2
### Patch Changes
- ca749b0e: Update dependency @types/parse5 to v6
- Updated dependencies [ca749b0e]
- @web/parse5-utils@1.3.0
## 1.1.1
### Patch Changes
- 68726a66: fix to export createPolyfillsLoader
## 1.1.0
### Minor Changes
- 0892bddd: Retain script tag attributes
## 1.0.2
### Patch Changes
- ac379b48: fix(rollup-plugin-polyfills-loader): fix relative paths to polyfills with `flattenOutput: false`
## 1.0.1
### Patch Changes
- 2006211: update minimum systemjs version
## 1.0.0
### Major Changes
- 369308b: Initial implementation
### Patch Changes
- Updated dependencies [a7c9af6]
- @web/parse5-utils@1.1.2
| modernweb-dev/web/packages/polyfills-loader/CHANGELOG.md/0 | {
"file_path": "modernweb-dev/web/packages/polyfills-loader/CHANGELOG.md",
"repo_id": "modernweb-dev",
"token_count": 1065
} | 202 |
const { glob } = require('glob');
const fs = require('fs');
const path = require('path');
/**
* Lists all files using the specified glob, starting from the given root directory.
*
* Will return all matching file paths fully resolved.
*
* @param {string} fromGlob
* @param {string} rootDir
* @param {string|string[]} [ignore]
*/
async function listFiles(fromGlob, rootDir, ignore) {
// remember, each filepath returned is relative to rootDir
return (
(await glob(fromGlob, { cwd: rootDir, dot: true, ignore }))
// fully resolve the filename relative to rootDir
.map(filePath => path.resolve(rootDir, filePath))
// filter out directories
.filter(filePath => !fs.lstatSync(filePath).isDirectory())
);
}
module.exports = { listFiles };
| modernweb-dev/web/packages/rollup-plugin-copy/src/listFiles.js/0 | {
"file_path": "modernweb-dev/web/packages/rollup-plugin-copy/src/listFiles.js",
"repo_id": "modernweb-dev",
"token_count": 247
} | 203 |
<h1>Index</h1>
<ul>
<li>
<a href="/">Index</a>
</li>
<li>
<a href="/pages/page-a.html">A</a>
</li>
<li>
<a href="/pages/page-B.html">B</a>
</li>
<li>
<a href="/pages/page-C.html">C</a>
</li>
</ul> | modernweb-dev/web/packages/rollup-plugin-html/demo/mpa/index.html/0 | {
"file_path": "modernweb-dev/web/packages/rollup-plugin-html/demo/mpa/index.html",
"repo_id": "modernweb-dev",
"token_count": 130
} | 204 |
import { injectBundles } from './injectBundles.js';
import { InputData } from '../input/InputData';
import {
EntrypointBundle,
RollupPluginHTMLOptions,
TransformHtmlFunction,
} from '../RollupPluginHTMLOptions';
import { parse, serialize } from 'parse5';
import { minify as minifyHTMLFunc } from 'html-minifier-terser';
import { injectedUpdatedAssetPaths } from './injectedUpdatedAssetPaths.js';
import { EmittedAssets } from './emitAssets.js';
import { injectAbsoluteBaseUrl } from './injectAbsoluteBaseUrl.js';
import { hashInlineScripts } from './hashInlineScripts.js';
import { injectServiceWorkerRegistration } from './injectServiceWorkerRegistration.js';
export interface GetOutputHTMLParams {
input: InputData;
outputDir: string;
emittedAssets: EmittedAssets;
pluginOptions: RollupPluginHTMLOptions;
entrypointBundles: Record<string, EntrypointBundle>;
externalTransformHtmlFns?: TransformHtmlFunction[];
defaultInjectDisabled: boolean;
serviceWorkerPath: string;
injectServiceWorker: boolean;
absolutePathPrefix?: string;
strictCSPInlineScripts: boolean;
}
export async function getOutputHTML(params: GetOutputHTMLParams) {
const {
pluginOptions,
entrypointBundles,
externalTransformHtmlFns,
input,
outputDir,
emittedAssets,
defaultInjectDisabled,
serviceWorkerPath,
injectServiceWorker,
absolutePathPrefix,
strictCSPInlineScripts,
} = params;
const { default: defaultBundle, ...multiBundles } = entrypointBundles;
const { absoluteSocialMediaUrls = true, rootDir = process.cwd() } = pluginOptions;
// inject rollup output into HTML
let document = parse(input.html);
if (pluginOptions.extractAssets !== false) {
injectedUpdatedAssetPaths({
document,
input,
outputDir,
rootDir,
emittedAssets,
externalAssets: pluginOptions.externalAssets,
absolutePathPrefix,
publicPath: pluginOptions.publicPath,
});
}
if (!defaultInjectDisabled) {
injectBundles(document, entrypointBundles);
}
if (absoluteSocialMediaUrls && pluginOptions.absoluteBaseUrl) {
injectAbsoluteBaseUrl(document, pluginOptions.absoluteBaseUrl);
}
if (injectServiceWorker && serviceWorkerPath) {
injectServiceWorkerRegistration({
document,
outputDir,
serviceWorkerPath,
htmlFileName: input.name,
});
}
let outputHtml = serialize(document);
const transforms = [...(externalTransformHtmlFns ?? [])];
if (pluginOptions.transformHtml) {
if (Array.isArray(pluginOptions.transformHtml)) {
transforms.push(...pluginOptions.transformHtml);
} else {
transforms.push(pluginOptions.transformHtml);
}
}
// run transform functions on output HTML
for (const transform of transforms) {
outputHtml = await transform(outputHtml, {
bundle: defaultBundle,
bundles: multiBundles,
htmlFileName: input.name,
});
}
if (pluginOptions.minify) {
outputHtml = await minifyHTMLFunc(outputHtml, {
collapseWhitespace: true,
removeComments: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
useShortDoctype: true,
minifyCSS: true,
minifyJS: true,
});
}
if (strictCSPInlineScripts) {
document = parse(outputHtml);
hashInlineScripts(document);
outputHtml = serialize(document);
}
return outputHtml;
}
| modernweb-dev/web/packages/rollup-plugin-html/src/output/getOutputHTML.ts/0 | {
"file_path": "modernweb-dev/web/packages/rollup-plugin-html/src/output/getOutputHTML.ts",
"repo_id": "modernweb-dev",
"token_count": 1195
} | 205 |
<svg xmlns="http://www.w3.org/2000/svg"><path d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2"></path></svg>
| modernweb-dev/web/packages/rollup-plugin-html/test/fixtures/assets/image-b.svg/0 | {
"file_path": "modernweb-dev/web/packages/rollup-plugin-html/test/fixtures/assets/image-b.svg",
"repo_id": "modernweb-dev",
"token_count": 61
} | 206 |
console.log('hello world');
| modernweb-dev/web/packages/rollup-plugin-html/test/fixtures/basic/app.js/0 | {
"file_path": "modernweb-dev/web/packages/rollup-plugin-html/test/fixtures/basic/app.js",
"repo_id": "modernweb-dev",
"token_count": 8
} | 207 |
console.log('shared-module.js');
| modernweb-dev/web/packages/rollup-plugin-html/test/fixtures/rollup-plugin-html/modules/shared-module.js/0 | {
"file_path": "modernweb-dev/web/packages/rollup-plugin-html/test/fixtures/rollup-plugin-html/modules/shared-module.js",
"repo_id": "modernweb-dev",
"token_count": 11
} | 208 |
import path from 'path';
import { parse, serialize } from 'parse5';
import { expect } from 'chai';
import { extractModules } from '../../../../src/input/extract/extractModules.js';
const { sep } = path;
describe('extractModules()', () => {
it('extracts all modules from a html document', () => {
const document = parse(
'<div>before</div>' +
'<script type="module" src="./foo.js"></script>' +
'<script type="module" src="/bar.js"></script>' +
'<div>after</div>',
);
const { moduleImports, inlineModules } = extractModules({
document,
htmlDir: '/',
rootDir: '/',
});
const htmlWithoutModules = serialize(document);
expect(inlineModules.length).to.equal(0);
expect(moduleImports).to.eql([
{ importPath: `${sep}foo.js`, attributes: [] },
{ importPath: `${sep}bar.js`, attributes: [] },
]);
expect(htmlWithoutModules).to.eql(
'<html><head></head><body><div>before</div><div>after</div></body></html>',
);
});
it('does not touch non module scripts', () => {
const document = parse(
'<div>before</div>' +
'<script src="./foo.js"></script>' +
'<script></script>' +
'<div>after</div>',
);
const { moduleImports, inlineModules } = extractModules({
document,
htmlDir: '/',
rootDir: '/',
});
const htmlWithoutModules = serialize(document);
expect(inlineModules.length).to.equal(0);
expect(moduleImports).to.eql([]);
expect(htmlWithoutModules).to.eql(
'<html><head></head><body><div>before</div><script src="./foo.js"></script><script></script><div>after</div></body></html>',
);
});
it('resolves imports relative to the root dir', () => {
const document = parse(
'<div>before</div>' +
'<script type="module" src="./foo.js"></script>' +
'<script type="module" src="/bar.js"></script>' +
'<div>after</div>',
);
const { moduleImports, inlineModules } = extractModules({
document,
htmlDir: '/',
rootDir: '/base/',
});
const htmlWithoutModules = serialize(document);
expect(inlineModules.length).to.equal(0);
expect(moduleImports).to.eql([
{ importPath: `${sep}foo.js`, attributes: [] },
{ importPath: `${sep}base${sep}bar.js`, attributes: [] },
]);
expect(htmlWithoutModules).to.eql(
'<html><head></head><body><div>before</div><div>after</div></body></html>',
);
});
it('resolves relative imports relative to the relative import base', () => {
const document = parse(
'<div>before</div>' +
'<script type="module" src="./foo.js"></script>' +
'<script type="module" src="/bar.js"></script>' +
'<div>after</div>',
);
const { moduleImports, inlineModules } = extractModules({
document,
htmlDir: '/base-1/base-2/',
rootDir: '/base-1/',
});
const htmlWithoutModules = serialize(document);
expect(inlineModules.length).to.equal(0);
expect(moduleImports).to.eql([
{ importPath: `${sep}base-1${sep}base-2${sep}foo.js`, attributes: [] },
{ importPath: `${sep}base-1${sep}bar.js`, attributes: [] },
]);
expect(htmlWithoutModules).to.eql(
'<html><head></head><body><div>before</div><div>after</div></body></html>',
);
});
it('extracts all inline modules from a html document', () => {
const document = parse(
'<div>before</div>' +
'<script type="module">/* my module 1 */</script>' +
'<script type="module">/* my module 2 */</script>' +
'<div>after</div>',
);
const { moduleImports, inlineModules } = extractModules({
document,
htmlDir: '/',
rootDir: '/',
});
const htmlWithoutModules = serialize(document);
expect(inlineModules).to.eql([
{
importPath: '/inline-module-cce79ce714e2c3b250afef32e61fb003.js',
code: '/* my module 1 */',
attributes: [],
},
{
importPath: '/inline-module-d9a0918508784903d131c7c4eb98e424.js',
code: '/* my module 2 */',
attributes: [],
},
]);
expect(moduleImports).to.eql([]);
expect(htmlWithoutModules).to.eql(
'<html><head></head><body><div>before</div><div>after</div></body></html>',
);
});
it('prefixes inline module with index.html directory', () => {
const document = parse(
'<div>before</div>' +
'<script type="module">/* my module 1 */</script>' +
'<script type="module">/* my module 2 */</script>' +
'<div>after</div>',
);
const { moduleImports, inlineModules } = extractModules({
document,
htmlDir: '/foo/bar/',
rootDir: '/',
});
const htmlWithoutModules = serialize(document);
expect(inlineModules).to.eql([
{
importPath: '/foo/bar/inline-module-cce79ce714e2c3b250afef32e61fb003.js',
code: '/* my module 1 */',
attributes: [],
},
{
importPath: '/foo/bar/inline-module-d9a0918508784903d131c7c4eb98e424.js',
code: '/* my module 2 */',
attributes: [],
},
]);
expect(moduleImports).to.eql([]);
expect(htmlWithoutModules).to.eql(
'<html><head></head><body><div>before</div><div>after</div></body></html>',
);
});
it('ignores absolute paths', () => {
const document = parse(
'<div>before</div>' +
'<script type="module" src="https://www.my-cdn.com/foo.js"></script>' +
'<script type="module" src="/bar.js"></script>' +
'<div>after</div>',
);
const { moduleImports, inlineModules } = extractModules({
document,
htmlDir: '/',
rootDir: '/',
});
const htmlWithoutModules = serialize(document);
expect(inlineModules.length).to.equal(0);
expect(moduleImports).to.eql([{ importPath: `${sep}bar.js`, attributes: [] }]);
expect(htmlWithoutModules).to.eql(
'<html><head></head><body><div>before</div><script type="module" src="https://www.my-cdn.com/foo.js"></script><div>after</div></body></html>',
);
});
});
| modernweb-dev/web/packages/rollup-plugin-html/test/src/input/extract/extractModules.test.ts/0 | {
"file_path": "modernweb-dev/web/packages/rollup-plugin-html/test/src/input/extract/extractModules.test.ts",
"repo_id": "modernweb-dev",
"token_count": 2590
} | 209 |
export const nameTwo = 'two-name';
export const imageTwo = new URL('../../two.svg', import.meta.url).href;
| modernweb-dev/web/packages/rollup-plugin-import-meta-assets/test/fixtures/one/two/two.js/0 | {
"file_path": "modernweb-dev/web/packages/rollup-plugin-import-meta-assets/test/fixtures/one/two/two.js",
"repo_id": "modernweb-dev",
"token_count": 35
} | 210 |
{
"name": "@web/rollup-plugin-polyfills-loader",
"version": "2.1.1",
"publishConfig": {
"access": "public"
},
"description": "Plugin for injecting a polyfills loader to HTML pages",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/modern-web/web.git",
"directory": "packages/rollup-plugin-polyfills-loader"
},
"author": "modern-web",
"homepage": "https://github.com/modern-web/web/packages/rollup-plugin-polyfills-loader",
"main": "dist/index.js",
"exports": {
".": {
"import": "./index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"engines": {
"node": ">=18.0.0"
},
"scripts": {
"test:node": "mocha test/**/*.test.ts --require ts-node/register --reporter dot",
"test:update-snapshots": "mocha test/**/*.test.ts --require ts-node/register --update-snapshots",
"test:watch": "mocha test/**/*.test.ts --require ts-node/register --watch --watch-files src,test"
},
"files": [
"*.d.ts",
"*.js",
"*.mjs",
"dist",
"src"
],
"keywords": [
"rollup-plugin",
"minify",
"html",
"polyfill",
"loader",
"feature detection"
],
"dependencies": {
"@web/polyfills-loader": "^2.2.0"
},
"devDependencies": {
"@web/rollup-plugin-html": "^2.1.2",
"rollup": "^4.4.0"
}
}
| modernweb-dev/web/packages/rollup-plugin-polyfills-loader/package.json/0 | {
"file_path": "modernweb-dev/web/packages/rollup-plugin-polyfills-loader/package.json",
"repo_id": "modernweb-dev",
"token_count": 604
} | 211 |
<html><head>
<link rel="preload" href="./entrypoint-a.js" as="script" crossorigin="anonymous" />
</head><body><script>(function () {
function loadScript(src, type, attributes) {
return new Promise(function (resolve) {
var script = document.createElement('script');
script.fetchPriority = 'high';
function onLoaded() {
if (script.parentElement) {
script.parentElement.removeChild(script);
}
resolve();
}
script.src = src;
script.onload = onLoaded;
if (attributes) {
attributes.forEach(function (att) {
script.setAttribute(att.name, att.value);
});
}
script.onerror = function () {
console.error('[polyfills-loader] failed to load: ' + src + ' check the network tab for HTTP status.');
onLoaded();
};
if (type) script.type = type;
document.head.appendChild(script);
});
}
var polyfills = [];
if (!('fetch' in window)) {
polyfills.push(loadScript('./polyfills/fetch.js'));
}
if (!('noModule' in HTMLScriptElement.prototype)) {
polyfills.push(loadScript('./polyfills/systemjs.js'));
}
if (!('attachShadow' in Element.prototype) || !('getRootNode' in Element.prototype) || window.ShadyDOM && window.ShadyDOM.force) {
polyfills.push(loadScript('./polyfills/webcomponents.js'));
}
if (!('noModule' in HTMLScriptElement.prototype) && 'getRootNode' in Element.prototype) {
polyfills.push(loadScript('./polyfills/custom-elements-es5-adapter.js'));
}
function loadFiles() {
if (!('noModule' in HTMLScriptElement.prototype)) {
System.import('./entrypoint-a.js');
} else {
loadScript('./entrypoint-a.js', 'module', []);
}
}
if (polyfills.length) {
Promise.all(polyfills).then(loadFiles);
} else {
loadFiles();
}
})();</script></body></html> | modernweb-dev/web/packages/rollup-plugin-polyfills-loader/test/snapshots/multiple-outputs.html/0 | {
"file_path": "modernweb-dev/web/packages/rollup-plugin-polyfills-loader/test/snapshots/multiple-outputs.html",
"repo_id": "modernweb-dev",
"token_count": 745
} | 212 |
export const a = 1; | modernweb-dev/web/packages/rollup-plugin-workbox/demo/some-module.js/0 | {
"file_path": "modernweb-dev/web/packages/rollup-plugin-workbox/demo/some-module.js",
"repo_id": "modernweb-dev",
"token_count": 6
} | 213 |
// based on https://github.com/storybookjs/storybook/blob/v7.0.9/code/lib/builder-vite/src/codegen-importfn-script.ts
import { normalizePath } from '@rollup/pluginutils';
import { logger } from '@storybook/node-logger';
import type { Options } from '@storybook/types';
import * as path from 'path';
import { listStories } from './list-stories.js';
/**
* This file is largely based on https://github.com/storybookjs/storybook/blob/d1195cbd0c61687f1720fefdb772e2f490a46584/lib/core-common/src/utils/to-importFn.ts
*/
export async function generateStoriesScript(options: Options) {
// First we need to get an array of stories and their absolute paths.
const stories = await listStories(options);
// We can then call toImportFn to create a function that can be used to load each story dynamically.
return (await toImportFn(stories)).trim();
}
/**
* This function takes an array of stories and creates a mapping between the stories' relative paths
* to the working directory and their dynamic imports. The import is done in an asynchronous function
* to delay loading. It then creates a function, `importFn(path)`, which resolves a path to an import
* function and this is called by Storybook to fetch a story dynamically when needed.
* @param stories An array of absolute story paths.
*/
async function toImportFn(stories: string[]) {
const objectEntries = stories.map(file => {
const ext = path.extname(file);
const relativePath = normalizePath(path.relative(process.cwd(), file));
if (!['.js', '.jsx', '.ts', '.tsx', '.mdx', '.svelte', '.vue'].includes(ext)) {
logger.warn(`Cannot process ${ext} file with storyStoreV7: ${relativePath}`);
}
return ` '${toImportPath(relativePath)}': () => import('${process.cwd()}/${relativePath}')`;
});
return `
const importers = {
${objectEntries.join(',\n')}
};
export function importFn(path) {
return importers[path]();
}
`.trim();
}
/**
* Paths get passed either with no leading './' - e.g. `src/Foo.stories.js`,
* or with a leading `../` (etc), e.g. `../src/Foo.stories.js`.
* We want to deal in importPaths relative to the working dir, so we normalize
*/
function toImportPath(relativePath: string) {
return relativePath.startsWith('../') ? relativePath : `./${relativePath}`;
}
| modernweb-dev/web/packages/storybook-builder/src/generate-stories-script.ts/0 | {
"file_path": "modernweb-dev/web/packages/storybook-builder/src/generate-stories-script.ts",
"repo_id": "modernweb-dev",
"token_count": 730
} | 214 |
{
"name": "@web/storybook-framework-web-components",
"version": "0.1.1",
"publishConfig": {
"access": "public"
},
"description": "Storybook framework for `@web/storybook-builder` + Web Components",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/modernweb-dev/web.git",
"directory": "packages/storybook-framework-web-components"
},
"author": "modern-web",
"homepage": "https://github.com/modernweb-dev/web/tree/master/packages/storybook-framework-web-components",
"main": "dist/index.js",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./index.mjs",
"types": "./index.d.ts"
},
"./preset": {
"require": "./dist/preset.js",
"import": "./preset.mjs",
"types": "./preset.d.ts"
},
"./package.json": "./package.json"
},
"engines": {
"node": ">=16.0.0"
},
"scripts": {
"build": "tsc",
"test": "npm run test:build && npm run test:ui:build && npm run test:ui:runtime",
"test:build": "storybook build -c ./tests/fixtures/all-in-one/.storybook -o ./tests/fixtures/all-in-one/storybook-build",
"test:start:build": "wds -r ./tests/fixtures/all-in-one/storybook-build -p 3000",
"test:start:runtime": "storybook dev -c ./tests/fixtures/all-in-one/.storybook -p 3000 --no-open",
"test:ui:build": "npx playwright test -c playwright.build.config.ts",
"test:ui:runtime": "npx playwright test -c playwright.runtime.config.ts"
},
"files": [
"*.d.ts",
"*.js",
"*.mjs",
"CHANGELOG.md",
"dist",
"README.md"
],
"keywords": [
"storybook",
"builder",
"framework",
"web",
"dev",
"server",
"web components",
"es modules",
"modules",
"esm"
],
"dependencies": {
"@storybook/web-components": "^7.0.0",
"@web/storybook-builder": "^0.1.0"
},
"devDependencies": {
"@playwright/test": "^1.22.2",
"@storybook/addon-a11y": "^7.0.0",
"@storybook/addon-essentials": "^7.0.0",
"@storybook/addon-interactions": "^7.0.0",
"@storybook/addon-links": "^7.0.0",
"@storybook/types": "^7.0.0",
"@web/dev-server": "^0.4.0",
"storybook": "^7.0.0"
}
}
| modernweb-dev/web/packages/storybook-framework-web-components/package.json/0 | {
"file_path": "modernweb-dev/web/packages/storybook-framework-web-components/package.json",
"repo_id": "modernweb-dev",
"token_count": 987
} | 215 |
# @web/storybook-utils
## 1.0.1
### Patch Changes
- afc680d2: fix export
## 1.0.0
### Major Changes
- 7320d233: create a package for Storybook utilities, move the utility to help make Storybook addons with web components from @web/storybook-prebuilt to reuse in Storybook 7
| modernweb-dev/web/packages/storybook-utils/CHANGELOG.md/0 | {
"file_path": "modernweb-dev/web/packages/storybook-utils/CHANGELOG.md",
"repo_id": "modernweb-dev",
"token_count": 90
} | 216 |
import { TestRunnerPlugin } from '@web/test-runner-core';
import path from 'path';
import fs from 'fs';
import { promisify } from 'util';
import mkdirp from 'mkdirp';
const readFile = promisify(fs.readFile);
const writeFile = promisify(fs.writeFile);
const unlink = promisify(fs.unlink);
const access = promisify(fs.access);
async function fileExists(filePath: string) {
try {
await access(filePath);
return true;
} catch {
return false;
}
}
function isObject(payload: unknown): payload is Record<string, unknown> {
return payload != null && typeof payload === 'object';
}
export interface WriteFilePayload {
path: string;
content: string;
encoding?: BufferEncoding;
}
export interface ReadFilePayload {
path: string;
encoding?: BufferEncoding;
}
export interface RemoveFilePayload {
path: string;
}
function isWriteFilePayload(payload: unknown): payload is WriteFilePayload {
if (!isObject(payload)) throw new Error('You must provide a payload object');
if (typeof payload.path !== 'string') throw new Error('You must provide a path option');
if (typeof payload.content !== 'string') throw new Error('You must provide a content option');
return true;
}
function isReadFilePayload(payload: unknown): payload is ReadFilePayload {
if (!isObject(payload)) throw new Error('You must provide a payload object');
if (typeof payload.path !== 'string') throw new Error('You must provide a path option');
return true;
}
function isRemoveFilePayload(payload: unknown): payload is RemoveFilePayload {
if (!isObject(payload)) throw new Error('You must provide a payload object');
if (typeof payload.path !== 'string') throw new Error('You must provide a path option');
return true;
}
function joinFilePath(testFile: string, relativePath: string) {
if (path.isAbsolute(relativePath)) {
throw new Error('file path must not be an absolute path.');
}
const dir = path.dirname(testFile);
return path.join(dir, relativePath.split('/').join(path.sep));
}
export function filePlugin(): TestRunnerPlugin {
return {
name: 'file-commands',
async executeCommand({ command, payload, session }) {
if (command === 'write-file') {
if (!isWriteFilePayload(payload)) {
throw new Error('You must provide a payload object');
}
const filePath = joinFilePath(session.testFile, payload.path);
const fileDir = path.dirname(filePath);
await mkdirp(fileDir);
await writeFile(filePath, payload.content, payload.encoding || 'utf-8');
return true;
}
if (command === 'read-file') {
if (!isReadFilePayload(payload)) {
throw new Error('You must provide a payload object');
}
const filePath = joinFilePath(session.testFile, payload.path);
if (await fileExists(filePath)) {
return readFile(filePath, payload.encoding || 'utf-8');
} else {
return undefined;
}
}
if (command === 'remove-file') {
if (!isRemoveFilePayload(payload)) {
throw new Error('You must provide a payload object');
}
const filePath = joinFilePath(session.testFile, payload.path);
await unlink(filePath);
return true;
}
},
};
}
| modernweb-dev/web/packages/test-runner-commands/src/filePlugin.ts/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-commands/src/filePlugin.ts",
"repo_id": "modernweb-dev",
"token_count": 1137
} | 217 |
import { executeServerCommand } from '../../browser/commands.mjs';
import { expect } from '../chai.js';
it('a known command does not throw', async () => {
await executeServerCommand('command-a');
});
it('a command can return an object', async () => {
const result = await executeServerCommand('command-a');
expect(result).to.eql({ foo: 'bar' });
});
it('a command can pass along parameters', async () => {
const resultA = await executeServerCommand('command-b', { message: 'hello world' });
expect(resultA).to.be.true;
const resultB = await executeServerCommand('command-b', { message: 'not hello world' });
expect(resultB).to.be.false;
});
it('an unmatched command falls through to the next plugin', async () => {
const result = await executeServerCommand('command-c');
expect(result).to.be.true;
});
it('a server error causes the command to fail', async () => {
let thrown = false;
try {
await executeServerCommand('command-d', { foo: 'bar' });
} catch (error) {
expect(error.message).to.equal(
'Error while executing command command-d with payload {"foo":"bar"}: error expected to be thrown from command',
);
thrown = true;
}
expect(thrown).to.be.true;
});
it('an unknown command causes the command to fail', async () => {
let thrown = false;
try {
await executeServerCommand('command-x');
} catch (error) {
expect(error.message).to.equal(
'Error while executing command command-x: Unknown command command-x. Did you install a plugin to handle this command?',
);
thrown = true;
}
expect(thrown).to.be.true;
});
| modernweb-dev/web/packages/test-runner-commands/test/execute-server-command/browser-test.js/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-commands/test/execute-server-command/browser-test.js",
"repo_id": "modernweb-dev",
"token_count": 501
} | 218 |
/* @web/test-runner snapshot v1 */
export const snapshots = {};
snapshots['persistent-a'] = `this is snapshot A`;
/* end snapshot persistent-a */
snapshots['persistent-b'] = `this is snapshot B`;
/* end snapshot persistent-b */
| modernweb-dev/web/packages/test-runner-commands/test/snapshot/__snapshots__/browser-test.snap.js/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-commands/test/snapshot/__snapshots__/browser-test.snap.js",
"repo_id": "modernweb-dev",
"token_count": 71
} | 219 |
import { codeFrameColumns } from '@babel/code-frame';
import path from 'path';
import { bold, cyan, red } from 'nanocolors';
import openBrowser from 'open';
import { writeCoverageReport } from './writeCoverageReport.js';
import { getSelectFilesMenu } from './getSelectFilesMenu.js';
import { getWatchCommands } from './getWatchCommands.js';
import { DynamicTerminal } from './terminal/DynamicTerminal.js';
import { BufferedLogger } from './BufferedLogger.js';
import { getManualDebugMenu } from './getManualDebugMenu.js';
import { ErrorWithLocation } from '../logger/Logger.js';
import { TestRunnerCoreConfig } from '../config/TestRunnerCoreConfig.js';
import { TestSessionManager } from '../test-session/TestSessionManager.js';
import { SESSION_STATUS } from '../test-session/TestSessionStatus.js';
import { Logger } from '../logger/Logger.js';
import { TestRunner } from '../runner/TestRunner.js';
import { TestCoverage } from '../coverage/getTestCoverage.js';
export type MenuType = 'none' | 'overview' | 'focus' | 'debug' | 'manual-debug';
export const MENUS = {
NONE: 'none' as MenuType,
OVERVIEW: 'overview' as MenuType,
FOCUS_SELECT_FILE: 'focus' as MenuType,
DEBUG_SELECT_FILE: 'debug' as MenuType,
MANUAL_DEBUG: 'manual-debug' as MenuType,
};
const KEYCODES = {
ENTER: '\r',
ESCAPE: '\u001b',
CTRL_C: '\u0003',
CTRL_D: '\u0004',
};
export class TestRunnerCli {
private config: TestRunnerCoreConfig;
private runner: TestRunner;
private terminal = new DynamicTerminal();
private reportedFilesByTestRun = new Map<number, Set<string>>();
private sessions: TestSessionManager;
private activeMenu: MenuType = MENUS.NONE;
private menuSucceededAndPendingFiles: string[] = [];
private menuFailedFiles: string[] = [];
private testCoverage?: TestCoverage;
private pendingReportPromises: Promise<any>[] = [];
private logger: Logger;
private localAddress: string;
private lastStaticLog = -1;
constructor(config: TestRunnerCoreConfig, runner: TestRunner) {
this.config = config;
this.runner = runner;
this.logger = this.config.logger;
this.sessions = runner.sessions;
this.localAddress = `${this.config.protocol}//${this.config.hostname}:${this.config.port}/`;
if (config.watch && !this.terminal.isInteractive) {
this.runner.stop(new Error('Cannot run watch mode in a non-interactive (TTY) terminal.'));
}
}
start() {
this.setupTerminalEvents();
this.setupRunnerEvents();
this.terminal.start();
for (const reporter of this.config.reporters) {
reporter.start?.({
config: this.config,
sessions: this.sessions,
testFiles: this.runner.testFiles,
startTime: this.runner.startTime,
browsers: this.runner.browsers,
browserNames: this.runner.browserNames,
});
}
this.switchMenu(this.config.manual ? MENUS.MANUAL_DEBUG : MENUS.OVERVIEW);
if (this.config.watch || (this.config.manual && this.terminal.isInteractive)) {
this.terminal.observeDirectInput();
}
if (this.config.staticLogging || !this.terminal.isInteractive) {
this.logger.log(bold(`Running ${this.runner.testFiles.length} test files...\n`));
}
if (this.config.open) {
openBrowser(this.localAddress);
}
}
private setupTerminalEvents() {
this.terminal.on('input', key => {
if ([MENUS.DEBUG_SELECT_FILE, MENUS.FOCUS_SELECT_FILE].includes(this.activeMenu)) {
const i = Number(key);
if (!Number.isNaN(i)) {
this.focusTestFileNr(i);
return;
}
}
switch (key.toUpperCase()) {
case KEYCODES.CTRL_C:
case KEYCODES.CTRL_D:
case 'Q':
if (
this.activeMenu === MENUS.OVERVIEW ||
(this.config.manual && this.activeMenu === MENUS.MANUAL_DEBUG)
) {
this.runner.stop();
}
return;
case 'D':
if (this.activeMenu === MENUS.OVERVIEW) {
if (this.runner.focusedTestFile) {
this.runner.startDebugBrowser(this.runner.focusedTestFile);
} else if (this.runner.testFiles.length === 1) {
this.runner.startDebugBrowser(this.runner.testFiles[0]);
} else {
this.switchMenu(MENUS.DEBUG_SELECT_FILE);
}
} else if (this.activeMenu === MENUS.MANUAL_DEBUG) {
openBrowser(this.localAddress);
}
return;
case 'F':
if (this.activeMenu === MENUS.OVERVIEW && this.runner.testFiles.length > 1) {
this.switchMenu(MENUS.FOCUS_SELECT_FILE);
}
return;
case 'C':
if (this.activeMenu === MENUS.OVERVIEW && this.config.coverage) {
openBrowser(
`file://${path.resolve(
this.config.coverageConfig!.reportDir ?? '',
'lcov-report',
'index.html',
)}`,
);
}
return;
case 'M':
this.switchMenu(MENUS.MANUAL_DEBUG);
return;
case KEYCODES.ESCAPE:
if (this.activeMenu === MENUS.OVERVIEW && this.runner.focusedTestFile) {
this.runner.focusedTestFile = undefined;
this.reportTestResults(true);
this.reportTestProgress();
} else if (this.activeMenu === MENUS.MANUAL_DEBUG) {
this.switchMenu(MENUS.OVERVIEW);
}
return;
case KEYCODES.ENTER:
this.runner.runTests(this.sessions.all());
return;
default:
return;
}
});
}
private setupRunnerEvents() {
this.sessions.on('session-status-updated', session => {
if (this.activeMenu !== MENUS.OVERVIEW) {
return;
}
if (session.status === SESSION_STATUS.FINISHED) {
this.reportTestResult(session.testFile);
this.reportTestProgress();
}
});
this.runner.on('test-run-started', ({ testRun }) => {
for (const reporter of this.config.reporters) {
reporter.onTestRunStarted?.({ testRun });
}
if (this.activeMenu !== MENUS.OVERVIEW) {
return;
}
if (testRun !== 0 && this.config.watch) {
this.terminal.clear();
}
this.reportTestResults();
this.reportTestProgress(false);
});
this.runner.on('test-run-finished', ({ testRun, testCoverage }) => {
for (const reporter of this.config.reporters) {
reporter.onTestRunFinished?.({
testRun,
sessions: Array.from(this.sessions.all()),
testCoverage,
focusedTestFile: this.runner.focusedTestFile,
});
}
if (this.activeMenu !== MENUS.OVERVIEW) {
return;
}
this.testCoverage = testCoverage;
if (testCoverage && !this.runner.focusedTestFile) {
this.writeCoverageReport(testCoverage);
}
this.reportSyntaxErrors();
this.reportTestProgress();
});
this.runner.on('finished', () => {
this.reportEnd();
});
}
private focusTestFileNr(i: number) {
const focusedTestFile =
this.menuFailedFiles[i - 1] ??
this.menuSucceededAndPendingFiles[i - this.menuFailedFiles.length - 1];
const debug = this.activeMenu === MENUS.DEBUG_SELECT_FILE;
if (focusedTestFile) {
this.runner.focusedTestFile = focusedTestFile;
this.switchMenu(MENUS.OVERVIEW);
if (debug) {
this.runner.startDebugBrowser(focusedTestFile);
}
} else {
this.terminal.clear();
this.logSelectFilesMenu();
}
}
private reportTestResults(forceReport = false) {
const { focusedTestFile } = this.runner;
const testFiles = focusedTestFile ? [focusedTestFile] : this.runner.testFiles;
for (const testFile of testFiles) {
this.reportTestResult(testFile, forceReport);
}
}
private reportTestResult(testFile: string, forceReport = false) {
const testRun = this.runner.testRun;
const sessionsForTestFile = Array.from(this.sessions.forTestFile(testFile));
const allFinished = sessionsForTestFile.every(s => s.status === SESSION_STATUS.FINISHED);
if (!allFinished) {
// not all sessions for this file are finished
return;
}
let reportedFiles = this.reportedFilesByTestRun.get(testRun);
if (!reportedFiles) {
reportedFiles = new Set();
this.reportedFilesByTestRun.set(testRun, reportedFiles);
}
if (!forceReport && reportedFiles.has(testFile)) {
// this was file was already reported
return;
}
reportedFiles.add(testFile);
const bufferedLogger = new BufferedLogger(this.logger);
for (const reporter of this.config.reporters) {
const sessionsForTestFile = Array.from(this.sessions.forTestFile(testFile));
reporter.reportTestFileResults?.({
logger: bufferedLogger,
sessionsForTestFile,
testFile,
testRun,
});
}
// all the logs from the reportered were buffered, if they finished before a new test run
// actually log them to the terminal here
if (this.runner.testRun === testRun) {
bufferedLogger.logBufferedMessages();
}
}
private reportTestProgress(final = false) {
if (this.config.manual) {
return;
}
const logStatic = this.config.staticLogging || !this.terminal.isInteractive;
if (logStatic && !final) {
// print a static progress log only once every 10000ms
const now = Date.now();
if (this.lastStaticLog !== -1 && now - this.lastStaticLog < 10000) {
return;
}
this.lastStaticLog = now;
}
const reports: string[] = [];
for (const reporter of this.config.reporters) {
const report = reporter.getTestProgress?.({
sessions: Array.from(this.sessions.all()),
testRun: this.runner.testRun,
focusedTestFile: this.runner.focusedTestFile,
testCoverage: this.testCoverage,
});
if (report) {
reports.push(...report);
}
}
if (this.config.watch) {
if (this.runner.focusedTestFile) {
reports.push(
`Focused on test file: ${cyan(
path.relative(process.cwd(), this.runner.focusedTestFile),
)}\n`,
);
}
reports.push(
...getWatchCommands(
!!this.config.coverage,
this.runner.testFiles,
!!this.runner.focusedTestFile,
),
'',
);
}
if (logStatic) {
this.terminal.logStatic(reports);
} else {
this.terminal.logDynamic(reports);
}
}
private reportSyntaxErrors() {
// TODO: this special cases the logger of @web/test-runner which implements
// logging of syntax errors. we need to make this more generic
const logger = this.config.logger as {
loggedSyntaxErrors?: Map<string, ErrorWithLocation>;
clearLoggedSyntaxErrors?: () => void;
} & Logger;
const { loggedSyntaxErrors = new Map() } = logger as any;
if (loggedSyntaxErrors.size === 0) {
return;
}
const report: string[] = [];
logger.clearLoggedSyntaxErrors?.();
for (const [filePath, errors] of loggedSyntaxErrors.entries()) {
for (const error of errors) {
const { message, code, line, column } = error;
const result = codeFrameColumns(code, { start: { line, column } }, { highlightCode: true });
const relativePath = path.relative(process.cwd(), filePath);
report.push(red(`Error while transforming ${cyan(relativePath)}: ${message}`));
report.push(result);
report.push('');
}
}
this.terminal.logStatic(report);
}
private writeCoverageReport(testCoverage: TestCoverage) {
writeCoverageReport(testCoverage, this.config.coverageConfig);
}
private switchMenu(menu: MenuType) {
if (this.activeMenu === menu) {
return;
}
this.activeMenu = menu;
if (this.config.watch) {
this.terminal.clear();
}
switch (menu) {
case MENUS.OVERVIEW:
this.reportTestResults(true);
this.reportTestProgress();
if (this.config.watch) {
this.terminal.observeDirectInput();
}
break;
case MENUS.FOCUS_SELECT_FILE:
case MENUS.DEBUG_SELECT_FILE:
this.logSelectFilesMenu();
break;
case MENUS.MANUAL_DEBUG:
this.logManualDebugMenu();
break;
default:
break;
}
}
private logSelectFilesMenu() {
this.menuSucceededAndPendingFiles = [];
this.menuFailedFiles = [];
for (const testFile of this.runner.testFiles) {
const sessions = Array.from(this.sessions.forTestFile(testFile));
if (sessions.every(t => t.status === SESSION_STATUS.FINISHED && !t.passed)) {
this.menuFailedFiles.push(testFile);
} else {
this.menuSucceededAndPendingFiles.push(testFile);
}
}
const selectFilesEntries = getSelectFilesMenu(
this.menuSucceededAndPendingFiles,
this.menuFailedFiles,
);
this.terminal.logDynamic([]);
this.terminal.logStatic(selectFilesEntries);
this.terminal.logPendingUserInput(
`Number of the file to ${this.activeMenu === MENUS.FOCUS_SELECT_FILE ? 'focus' : 'debug'}: `,
);
this.terminal.observeConfirmedInput();
}
logManualDebugMenu() {
this.terminal.logDynamic(getManualDebugMenu(this.config));
}
private async reportEnd() {
for (const reporter of this.config.reporters) {
await reporter.stop?.({
sessions: Array.from(this.sessions.all()),
testCoverage: this.testCoverage,
focusedTestFile: this.runner.focusedTestFile,
});
}
this.reportTestProgress(true);
this.terminal.stop();
this.runner.stop();
}
}
| modernweb-dev/web/packages/test-runner-core/src/cli/TestRunnerCli.ts/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-core/src/cli/TestRunnerCli.ts",
"repo_id": "modernweb-dev",
"token_count": 5713
} | 220 |
import globby from 'globby';
import { sep } from 'path';
export function collectTestFiles(patterns: string | string[], baseDir = process.cwd()) {
const normalizedPatterns = [patterns].flat().map(p => p.split(sep).join('/'));
return globby.sync(normalizedPatterns, { cwd: baseDir, absolute: true });
}
| modernweb-dev/web/packages/test-runner-core/src/runner/collectTestFiles.ts/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-core/src/runner/collectTestFiles.ts",
"repo_id": "modernweb-dev",
"token_count": 98
} | 221 |
import path from 'path';
import { Context } from '@web/dev-server-core';
import { TestRunnerCoreConfig } from '../config/TestRunnerCoreConfig.js';
import { PARAM_SESSION_ID, PARAM_MANUAL_SESSION } from '../utils/constants.js';
const toBrowserPathRegExp = new RegExp(path.sep === '\\' ? '\\\\' : path.sep, 'g');
const toFilePathRegeExp = new RegExp('/', 'g');
export function toBrowserPath(filePath: string) {
return filePath.replace(toBrowserPathRegExp, '/');
}
export function toFilePath(browserPath: string) {
return browserPath.replace(toFilePathRegeExp, path.sep);
}
export async function createTestFileImportPath(
config: TestRunnerCoreConfig,
context: Context,
filePath: string,
sessionId?: string,
) {
const fullFilePath = path.resolve(filePath);
const relativeToRootDir = path.relative(config.rootDir, fullFilePath);
const browserPath = `/${toBrowserPath(relativeToRootDir)}`;
const params = sessionId ? `?${PARAM_SESSION_ID}=${sessionId}` : `?${PARAM_MANUAL_SESSION}=true`;
let importPath = encodeURI(`${browserPath}${params}`);
// allow plugins to transform the import path
for (const p of config.plugins ?? []) {
if (p.transformImport) {
const transformResult = await p.transformImport({ source: importPath, context });
if (typeof transformResult === 'object' && typeof transformResult.id === 'string') {
importPath = transformResult.id;
} else if (typeof transformResult === 'string') {
importPath = transformResult;
}
}
}
return importPath;
}
| modernweb-dev/web/packages/test-runner-core/src/server/utils.ts/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-core/src/server/utils.ts",
"repo_id": "modernweb-dev",
"token_count": 512
} | 222 |
// this file is autogenerated with the generate-mjs-dts-entrypoints script
import cjsEntrypoint from './dist/test-helpers.js';
const { runTests } = cjsEntrypoint;
export { runTests };
| modernweb-dev/web/packages/test-runner-core/test-helpers.mjs/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-core/test-helpers.mjs",
"repo_id": "modernweb-dev",
"token_count": 62
} | 223 |
{
"name": "@web/test-runner-coverage-v8",
"version": "0.8.0",
"publishConfig": {
"access": "public"
},
"description": "Code coverage using v8",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/modernweb-dev/web.git",
"directory": "packages/test-runner-coverage-v8"
},
"author": "modern-web",
"homepage": "https://github.com/modernweb-dev/web/tree/master/packages/test-runner-coverage-v8",
"main": "dist/index.js",
"exports": {
".": {
"types": "./index.d.ts",
"import": "./index.mjs",
"require": "./dist/index.js"
}
},
"engines": {
"node": ">=18.0.0"
},
"scripts": {
"build": "tsc"
},
"files": [
"*.d.ts",
"*.js",
"*.mjs",
"dist",
"src"
],
"keywords": [
"web",
"test",
"runner",
"testrunner",
"dev",
"server"
],
"dependencies": {
"@web/test-runner-core": "^0.13.0",
"istanbul-lib-coverage": "^3.0.0",
"lru-cache": "^8.0.4",
"picomatch": "^2.2.2",
"v8-to-istanbul": "^9.0.1"
},
"devDependencies": {
"@types/istanbul-lib-coverage": "^2.0.3",
"@types/picomatch": "^2.2.1"
}
}
| modernweb-dev/web/packages/test-runner-coverage-v8/package.json/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-coverage-v8/package.json",
"repo_id": "modernweb-dev",
"token_count": 581
} | 224 |
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="Chrome_puppeteer_/packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js" id="0" tests="6" skipped="1" errors="2" failures="2" time="<<computed>>">
<properties>
<property name="test.fileName" value="packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js"/>
<property name="browser.name" value="Chrome"/>
<property name="browser.launcher" value="puppeteer"/>
</properties>
<testcase name="under addition" time="<<computed>>" classname="real numbers forming a monoid" file="packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js"/>
<testcase name="null hypothesis" time="<<computed>>" classname="off-by-one boolean logic errors" file="packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js"/>
<testcase name="asserts error" time="<<computed>>" classname="off-by-one boolean logic errors" file="packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js" line="17">
<failure message="expected false to be true" type="AssertionError"><![CDATA[AssertionError: expected false to be true
at <<anonymous>> (packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js:17:29)]]></failure>
</testcase>
<testcase name="tbd: confirm true positive" time="<<computed>>" classname="off-by-one boolean logic errors" file="packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js">
<skipped/>
</testcase>
<testcase name="reports logs to JUnit" time="<<computed>>" classname="logging during a test" file="packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js"/>
<testcase name="fails with source trace" time="<<computed>>" classname="logging during a test" file="packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js" line="2">
<failure message="failed" type="Error"><![CDATA[Error: failed
at fail (packages/test-runner-junit-reporter/test/fixtures/simple/simple-source.js:2:9)
at <<anonymous>> (packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js:33:17)]]></failure>
</testcase>
</testsuite>
</testsuites> | modernweb-dev/web/packages/test-runner-junit-reporter/test/fixtures/simple/expected.xml/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-junit-reporter/test/fixtures/simple/expected.xml",
"repo_id": "modernweb-dev",
"token_count": 775
} | 225 |
<!DOCTYPE html>
<html>
<body>
<script type="module">
import { runTests } from '../../dist/standalone.js';
runTests(() => {
throw new Error('error during setup');
it('test 1', () => {});
it('test 2', () => {});
});
</script>
</body>
</html>
| modernweb-dev/web/packages/test-runner-mocha/test/fixtures/standalone-setup-fail.html/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-mocha/test/fixtures/standalone-setup-fail.html",
"repo_id": "modernweb-dev",
"token_count": 137
} | 226 |
{
"name": "time-library",
"type": "module",
"exports": {
"./hour": "./index.js"
}
} | modernweb-dev/web/packages/test-runner-module-mocking/test/fixtures/bare/fixture/node_modules/time-library/package.json/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-module-mocking/test/fixtures/bare/fixture/node_modules/time-library/package.json",
"repo_id": "modernweb-dev",
"token_count": 55
} | 227 |
import { Page, BrowserContext } from 'playwright';
import { TestRunnerCoreConfig } from '@web/test-runner-core';
import { V8Coverage, v8ToIstanbul } from '@web/test-runner-coverage-v8';
import { SessionResult } from '@web/test-runner-core';
import { ProductType } from './PlaywrightLauncher.js';
export class PlaywrightLauncherPage {
private config: TestRunnerCoreConfig;
private testFiles: string[];
private product: ProductType;
public playwrightContext: BrowserContext;
public playwrightPage: Page;
private nativeInstrumentationEnabledOnPage = false;
constructor(
config: TestRunnerCoreConfig,
product: ProductType,
testFiles: string[],
playwrightContext: BrowserContext,
playwrightPage: Page,
) {
this.config = config;
this.product = product;
this.testFiles = testFiles;
this.playwrightContext = playwrightContext;
this.playwrightPage = playwrightPage;
}
async runSession(url: string, coverage: boolean) {
if (
coverage &&
this.product === 'chromium' &&
this.config.coverageConfig?.nativeInstrumentation !== false
) {
if (this.nativeInstrumentationEnabledOnPage) {
await this.playwrightPage.coverage.stopJSCoverage();
}
this.nativeInstrumentationEnabledOnPage = true;
await this.playwrightPage.coverage.startJSCoverage();
}
await this.playwrightPage.setViewportSize({ height: 600, width: 800 });
await this.playwrightPage.goto(url);
}
async stopSession(): Promise<SessionResult> {
const testCoverage = this.nativeInstrumentationEnabledOnPage
? await this.collectTestCoverage(this.config, this.testFiles)
: undefined;
// navigate to an empty page to kill any running code on the page, stopping timers and
// breaking a potential endless reload loop
await this.playwrightPage.goto('about:blank');
await this.playwrightContext.close();
return { testCoverage };
}
private async collectTestCoverage(config: TestRunnerCoreConfig, testFiles: string[]) {
const userAgentPromise = this.playwrightPage
.evaluate(() => window.navigator.userAgent)
.catch(() => undefined);
try {
const coverageFromBrowser = await this.playwrightPage.evaluate(
() => (window as any).__coverage__,
);
if (coverageFromBrowser) {
// coverage was generated by JS, return that
return coverageFromBrowser;
}
} catch (error) {
// evaluate throws when the a test navigates in the browser
}
if (config.coverageConfig?.nativeInstrumentation === false) {
throw new Error(
'Coverage is enabled with nativeInstrumentation disabled. ' +
'Expected coverage provided in the browser as a global __coverage__ variable.' +
'Use a plugin like babel-plugin-istanbul to generate the coverage, or enable native instrumentation.',
);
}
// get native coverage from playwright
let coverage: V8Coverage[];
if (this.product === 'chromium') {
coverage = await this.playwrightPage?.coverage?.stopJSCoverage();
} else {
coverage = [];
}
this.nativeInstrumentationEnabledOnPage = false;
const userAgent = await userAgentPromise;
return v8ToIstanbul(config, testFiles, coverage, userAgent);
}
}
| modernweb-dev/web/packages/test-runner-playwright/src/PlaywrightLauncherPage.ts/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-playwright/src/PlaywrightLauncherPage.ts",
"repo_id": "modernweb-dev",
"token_count": 1111
} | 228 |
{
"name": "@web/test-runner-puppeteer",
"version": "0.16.0",
"publishConfig": {
"access": "public"
},
"description": "Puppeteer browser launcher for Web Test Runner",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/modernweb-dev/web.git",
"directory": "packages/test-runner-puppeteer"
},
"author": "modern-web",
"homepage": "https://github.com/modernweb-dev/web/tree/master/packages/test-runner-puppeteer",
"main": "dist/index.js",
"exports": {
".": {
"types": "./index.d.ts",
"import": "./index.mjs",
"require": "./dist/index.js"
}
},
"engines": {
"node": ">=18.0.0"
},
"scripts": {
"build": "tsc",
"test:node": "mocha test/**/*.test.ts --require ts-node/register --reporter dot",
"test:watch": "mocha test/**/*.test.ts --require ts-node/register --watch --watch-files src,test"
},
"files": [
"*.d.ts",
"*.js",
"*.mjs",
"dist",
"src"
],
"keywords": [
"web",
"test",
"runner",
"testrunner",
"puppeteer",
"browser",
"launcher"
],
"dependencies": {
"@web/test-runner-chrome": "^0.16.0",
"@web/test-runner-core": "^0.13.0",
"puppeteer": "^22.0.0"
},
"devDependencies": {
"@web/test-runner-mocha": "^0.9.0",
"puppeteer-core": "^22.0.0"
}
}
| modernweb-dev/web/packages/test-runner-puppeteer/package.json/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-puppeteer/package.json",
"repo_id": "modernweb-dev",
"token_count": 626
} | 229 |
{
"name": "@web/test-runner-saucelabs",
"version": "0.11.1",
"publishConfig": {
"access": "public"
},
"description": "Saucelabs launcher for Web Test Runner",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/modernweb-dev/web.git",
"directory": "packages/test-runner-saucelabs"
},
"author": "modern-web",
"homepage": "https://github.com/modernweb-dev/web/tree/master/packages/test-runner-saucelabs",
"main": "dist/index.js",
"exports": {
".": {
"types": "./index.d.ts",
"import": "./index.mjs",
"require": "./dist/index.js"
}
},
"engines": {
"node": ">=18.0.0"
},
"scripts": {
"build": "tsc",
"test": "mocha test-remote/**/*.test.ts --require ts-node/register --reporter dot",
"test:watch": "mocha test-remote/**/*.test.ts --require ts-node/register --watch --watch-files src,test"
},
"files": [
"*.d.ts",
"*.js",
"*.mjs",
"dist",
"src"
],
"keywords": [
"web",
"test",
"runner",
"testrunner",
"saucelabs",
"browser",
"launcher"
],
"dependencies": {
"@web/test-runner-webdriver": "^0.8.0",
"ip": "^2.0.1",
"nanoid": "^3.1.25",
"saucelabs": "^7.2.0",
"webdriver": "^8.8.6",
"webdriverio": "^8.8.6"
},
"devDependencies": {
"@types/ip": "^1.1.0",
"@web/dev-server-esbuild": "^1.0.0",
"@web/dev-server-legacy": "^2.1.0",
"portfinder": "^1.0.32"
}
}
| modernweb-dev/web/packages/test-runner-saucelabs/package.json/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-saucelabs/package.json",
"repo_id": "modernweb-dev",
"token_count": 705
} | 230 |
export default 'moduleFeaturesB';
| modernweb-dev/web/packages/test-runner-saucelabs/test-remote/fixtures/module-features-b.js/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-saucelabs/test-remote/fixtures/module-features-b.js",
"repo_id": "modernweb-dev",
"token_count": 8
} | 231 |
export function visualDiff(element: Node, name: string): Promise<void>;
| modernweb-dev/web/packages/test-runner-visual-regression/browser/commands.d.ts/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-visual-regression/browser/commands.d.ts",
"repo_id": "modernweb-dev",
"token_count": 19
} | 232 |
export { visualRegressionPlugin } from './visualRegressionPlugin.js';
| modernweb-dev/web/packages/test-runner-visual-regression/src/index.ts/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-visual-regression/src/index.ts",
"repo_id": "modernweb-dev",
"token_count": 18
} | 233 |
export { webdriverLauncher, WebdriverLauncher } from './webdriverLauncher.js';
| modernweb-dev/web/packages/test-runner-webdriver/src/index.ts/0 | {
"file_path": "modernweb-dev/web/packages/test-runner-webdriver/src/index.ts",
"repo_id": "modernweb-dev",
"token_count": 23
} | 234 |
import { createSauceLabsLauncher } from '@web/test-runner-saucelabs';
import { legacyPlugin } from '@web/dev-server-legacy';
const sauceLabsCapabilities = {
build: `modern-web ${process.env.GITHUB_REF || 'local'} build ${
process.env.GITHUB_RUN_NUMBER || ''
}`,
name: 'integration test',
};
const sauceLabsLauncher = createSauceLabsLauncher(
{
user: process.env.SAUCE_USERNAME,
key: process.env.SAUCE_ACCESS_KEY,
region: 'eu',
},
sauceLabsCapabilities,
);
export default {
files: 'demo/test/pass-!(commands)*.test.js',
rootDir: '../..',
nodeResolve: true,
plugins: [legacyPlugin()],
browsers: [
sauceLabsLauncher({
browserName: 'chrome',
browserVersion: 'latest',
platformName: 'Windows 10',
}),
// sauceLabsLauncher({
// browserName: 'chrome',
// browserVersion: 'latest-1',
// platformName: 'Windows 10',
// }),
// sauceLabsLauncher({
// browserName: 'chrome',
// browserVersion: 'latest-2',
// platformName: 'Windows 10',
// }),
// // sauceLabsLauncher({
// // browserName: 'safari',
// // browserVersion: 'latest',
// // platformName: 'macOS 10.15',
// // }),
// sauceLabsLauncher({
// browserName: 'firefox',
// browserVersion: 'latest',
// platformName: 'Windows 10',
// }),
// sauceLabsLauncher({
// browserName: 'internet explorer',
// browserVersion: '11.0',
// platformName: 'Windows 7',
// }),
],
browserStartTimeout: 1000 * 60 * 1,
testsStartTimeout: 1000 * 60 * 1,
testsFinishTimeout: 1000 * 60 * 1,
};
| modernweb-dev/web/packages/test-runner/demo/saucelabs.config.mjs/0 | {
"file_path": "modernweb-dev/web/packages/test-runner/demo/saucelabs.config.mjs",
"repo_id": "modernweb-dev",
"token_count": 652
} | 235 |
import { expect } from './chai.js';
beforeEach(() => {
throw new Error('error thrown in afterEach hook');
});
it('true is true', () => {
expect(true).to.equal(true);
});
it('true is really true', () => {
expect(true).to.equal(true);
});
| modernweb-dev/web/packages/test-runner/demo/test/fail-after-each.test.js/0 | {
"file_path": "modernweb-dev/web/packages/test-runner/demo/test/fail-after-each.test.js",
"repo_id": "modernweb-dev",
"token_count": 87
} | 236 |
import { throwErrorA } from './fail-stack-trace-a.js';
import { expect } from './chai.js';
it('test 1', () => {
throwErrorA();
});
| modernweb-dev/web/packages/test-runner/demo/test/fail-stack-trace.test.js/0 | {
"file_path": "modernweb-dev/web/packages/test-runner/demo/test/fail-stack-trace.test.js",
"repo_id": "modernweb-dev",
"token_count": 51
} | 237 |
export function neverImported() {
return 'function is never imported';
}
export function neverCalled() {
return 'function is never called';
}
export function neverCalledWithTrue(neverTrue) {
if (neverTrue) {
return 'condition is never returned';
} else {
return 6;
}
}
export function calledOnce() {
return 'this function is called once';
}
export function calledTwice() {
return 'this function is called twice';
}
export function calledThrice() {
return 'this function is called thrice';
}
class LocalClass {}
export class PublicClass {
constructor(neverTrue) {
if (neverTrue) {
console.log('never logged');
}
if (window.neverTrue) {
console.log('never true');
}
}
neverCalled() {
return 'function is never called';
}
calledOnce() {
return 'this function is called once';
}
calledTwice() {
return 'this function is called twice';
}
calledThrice() {
return 'this function is called thrice';
}
}
function localFunction() {
const localVariable = 123;
}
| modernweb-dev/web/packages/test-runner/demo/test/pass-coverage.js/0 | {
"file_path": "modernweb-dev/web/packages/test-runner/demo/test/pass-coverage.js",
"repo_id": "modernweb-dev",
"token_count": 340
} | 238 |
export function b(condition: unknown) {
if (condition) {
return 'a';
}
return 'b';
}
| modernweb-dev/web/packages/test-runner/demo/test/virtual-files/b.ts/0 | {
"file_path": "modernweb-dev/web/packages/test-runner/demo/test/virtual-files/b.ts",
"repo_id": "modernweb-dev",
"token_count": 36
} | 239 |
import './shared-a.js';
| modernweb-dev/web/packages/test-runner/demo/tsc/dist/test/pass-16.test.d.ts/0 | {
"file_path": "modernweb-dev/web/packages/test-runner/demo/tsc/dist/test/pass-16.test.d.ts",
"repo_id": "modernweb-dev",
"token_count": 10
} | 240 |
import { CoverageConfig, TestRunnerCoreConfig, TestRunnerGroupConfig } from '@web/test-runner-core';
import { chromeLauncher } from '@web/test-runner-chrome';
import {
emulateMediaPlugin,
selectOptionPlugin,
setUserAgentPlugin,
setViewportPlugin,
sendKeysPlugin,
filePlugin,
snapshotPlugin,
sendMousePlugin,
} from '@web/test-runner-commands/plugins';
import { getPortPromise } from 'portfinder';
import path from 'path';
import { cpus } from 'os';
import { TestRunnerCliArgs } from './readCliArgs.js';
import { mergeConfigs } from './mergeConfigs.js';
import { TestRunnerConfig } from './TestRunnerConfig.js';
import { esbuildPlugin, nodeResolvePlugin } from '@web/dev-server';
import { TestRunnerStartError } from '../TestRunnerStartError.js';
import { collectGroupConfigs } from './collectGroupConfigs.js';
import { playwrightLauncher, puppeteerLauncher } from './loadLauncher.js';
import { defaultReporter } from '../reporter/defaultReporter.js';
import { TestRunnerLogger } from '../logger/TestRunnerLogger.js';
const secondMs = 1000;
const minuteMs = secondMs * 60;
const defaultConfig: Partial<TestRunnerConfig> = {
rootDir: process.cwd(),
protocol: 'http:',
hostname: 'localhost',
middleware: [],
plugins: [],
watch: false,
concurrentBrowsers: 2,
concurrency: Math.max(1, cpus().length / 2),
browserStartTimeout: minuteMs / 2,
testsStartTimeout: secondMs * 20,
testsFinishTimeout: minuteMs * 2,
browserLogs: true,
};
const defaultCoverageConfig: CoverageConfig = {
exclude: ['**/node_modules/**/*', '**/web_modules/**/*'],
threshold: { statements: 0, functions: 0, branches: 0, lines: 0 },
report: true,
reportDir: 'coverage',
reporters: ['lcov'],
};
function validate(config: Record<string, unknown>, key: string, type: string) {
if (config[key] == null) {
return;
}
if (typeof config[key] !== type) {
throw new TestRunnerStartError(`Configuration error: The ${key} setting should be a ${type}.`);
}
}
const stringSettings = ['rootDir', 'hostname'];
const numberSettings = [
'port',
'concurrentBrowsers',
'concurrency',
'browserStartTimeout',
'testsStartTimeout',
'testsFinishTimeout',
];
const booleanSettings = [
'watch',
'preserveSymlinks',
'browserLogs',
'coverage',
'staticLogging',
'manual',
'open',
'debug',
];
export function validateConfig(config: Partial<TestRunnerConfig>) {
stringSettings.forEach(key => validate(config, key, 'string'));
numberSettings.forEach(key => validate(config, key, 'number'));
booleanSettings.forEach(key => validate(config, key, 'boolean'));
if (
config.esbuildTarget != null &&
!(typeof config.esbuildTarget === 'string' || Array.isArray(config.esbuildTarget))
) {
throw new TestRunnerStartError(
`Configuration error: The esbuildTarget setting should be a string or array.`,
);
}
if (config.files != null && !(typeof config.files === 'string' || Array.isArray(config.files))) {
throw new TestRunnerStartError(
`Configuration error: The files setting should be a string or an array.`,
);
}
return config as TestRunnerConfig;
}
async function parseConfigGroups(config: TestRunnerConfig, cliArgs: TestRunnerCliArgs) {
const groupConfigs: TestRunnerGroupConfig[] = [];
const configPatterns: string[] = [];
if (cliArgs.groups) {
// groups are provided from CLI args
configPatterns.push(cliArgs.groups);
} else if (config.groups) {
// groups are provided from config
for (const entry of config.groups) {
if (typeof entry === 'object') {
groupConfigs.push(entry);
} else {
configPatterns.push(entry);
}
}
}
// group entries which are strings are globs which point to group conigs
groupConfigs.push(...(await collectGroupConfigs(configPatterns)));
return groupConfigs;
}
export async function parseConfig(
config: Partial<TestRunnerConfig>,
cliArgs: TestRunnerCliArgs = {},
): Promise<{ config: TestRunnerCoreConfig; groupConfigs: TestRunnerGroupConfig[] }> {
const cliArgsConfig: Partial<TestRunnerConfig> = {
...(cliArgs as Omit<TestRunnerCliArgs, 'groups' | 'browsers'>),
};
// CLI has properties with the same name as the config, but with different values
// delete them so they don't overwrite when merging, the CLI values are read separately
delete cliArgsConfig.groups;
delete cliArgsConfig.browsers;
const mergedConfigs = mergeConfigs(defaultConfig, config, cliArgsConfig);
// backwards compatibility for configs written for es-dev-server, where middleware was
// spelled incorrectly as middlewares
if (Array.isArray((mergedConfigs as any).middlewares)) {
mergedConfigs.middleware!.push(...(mergedConfigs as any).middlewares);
}
const finalConfig = validateConfig(mergedConfigs);
// filter out non-objects from plugin list
finalConfig.plugins = (finalConfig.plugins ?? []).filter(pl => typeof pl === 'object');
// ensure rootDir is always resolved
if (typeof finalConfig.rootDir === 'string') {
finalConfig.rootDir = path.resolve(finalConfig.rootDir);
} else {
throw new TestRunnerStartError('No rootDir specified.');
}
// generate a default random port
if (typeof finalConfig.port !== 'number') {
finalConfig.port = await getPortPromise({ port: 8000 });
}
finalConfig.coverageConfig = {
...defaultCoverageConfig,
...finalConfig.coverageConfig,
};
let groupConfigs = await parseConfigGroups(finalConfig, cliArgs);
if (groupConfigs.find(g => g.name === 'default')) {
throw new TestRunnerStartError(
'Cannot create a group named "default". This named is reserved by the test runner.',
);
}
if (cliArgs.group != null) {
if (cliArgs.group === 'default') {
// default group is an alias for the root config
groupConfigs = [];
} else {
const groupConfig = groupConfigs.find(c => c.name === cliArgs.group);
if (!groupConfig) {
throw new TestRunnerStartError(`Could not find any group named ${cliArgs.group}`);
}
// when focusing a group, ensure that the "default" group isn't run
// we can improve this by relying only on groups inside the test runner itself
if (groupConfig.files == null) {
groupConfig.files = finalConfig.files;
}
finalConfig.files = undefined;
groupConfigs = [groupConfig];
}
}
if (cliArgs.puppeteer) {
if (finalConfig.browsers && finalConfig.browsers.length > 0) {
throw new TestRunnerStartError(
'The --puppeteer flag cannot be used when defining browsers manually in your finalConfig.',
);
}
finalConfig.browsers = puppeteerLauncher(cliArgs.browsers);
} else if (cliArgs.playwright) {
if (finalConfig.browsers && finalConfig.browsers.length > 0) {
throw new TestRunnerStartError(
'The --playwright flag cannot be used when defining browsers manually in your finalConfig.',
);
}
finalConfig.browsers = playwrightLauncher(cliArgs.browsers);
} else {
if (cliArgs.browsers != null) {
throw new TestRunnerStartError(
`The browsers option must be used along with the puppeteer or playwright option.`,
);
}
// add default chrome launcher if the user did not configure their own browsers
if (!finalConfig.browsers) {
finalConfig.browsers = [chromeLauncher()];
}
}
finalConfig.testFramework = {
path: require.resolve('@web/test-runner-mocha/dist/autorun.js'),
...(finalConfig.testFramework ?? {}),
};
if (!finalConfig.reporters) {
finalConfig.reporters = [defaultReporter()];
}
if (!finalConfig.logger) {
finalConfig.logger = new TestRunnerLogger(config.debug);
}
if (finalConfig.plugins == null) {
finalConfig.plugins = [];
}
// plugin with a noop transformImport hook, this will cause the dev server to analyze modules and
// catch syntax errors. this way we still report syntax errors when the user has no flags enabled
finalConfig.plugins.unshift({
name: 'syntax-checker',
transformImport() {
return undefined;
},
});
finalConfig.plugins.unshift(
setViewportPlugin(),
emulateMediaPlugin(),
setUserAgentPlugin(),
selectOptionPlugin(),
filePlugin(),
sendKeysPlugin(),
sendMousePlugin(),
snapshotPlugin({ updateSnapshots: !!cliArgs.updateSnapshots }),
);
if (finalConfig.nodeResolve) {
const userOptions =
typeof finalConfig.nodeResolve === 'object' ? finalConfig.nodeResolve : undefined;
// do node resolve after user plugins, to allow user plugins to resolve imports
finalConfig.plugins!.push(
nodeResolvePlugin(finalConfig.rootDir!, finalConfig.preserveSymlinks, userOptions),
);
}
if (finalConfig?.esbuildTarget) {
finalConfig.plugins!.unshift(esbuildPlugin(finalConfig.esbuildTarget));
}
if ((!finalConfig.files || finalConfig.files.length === 0) && groupConfigs.length === 0) {
throw new TestRunnerStartError(
'Did not find any tests to run. Use the "files" or "groups" option to configure test files.',
);
}
return { config: finalConfig as TestRunnerCoreConfig, groupConfigs };
}
| modernweb-dev/web/packages/test-runner/src/config/parseConfig.ts/0 | {
"file_path": "modernweb-dev/web/packages/test-runner/src/config/parseConfig.ts",
"repo_id": "modernweb-dev",
"token_count": 3002
} | 241 |
export function getFailedOnBrowsers(allBrowserNames: string[], failedBrowsers: string[]) {
if (allBrowserNames.length === 1 || failedBrowsers.length === allBrowserNames.length) {
return '';
}
const browserString =
failedBrowsers.length === 1
? failedBrowsers[0]
: failedBrowsers.slice(0, -1).join(', ') + ' and ' + failedBrowsers.slice(-1);
return ` (failed on ${browserString})`;
}
| modernweb-dev/web/packages/test-runner/src/reporter/utils/getFailedOnBrowsers.ts/0 | {
"file_path": "modernweb-dev/web/packages/test-runner/src/reporter/utils/getFailedOnBrowsers.ts",
"repo_id": "modernweb-dev",
"token_count": 148
} | 242 |
/* eslint-disable */
const fs = require('fs-extra');
const path = require('path');
/**
* Script to update a single dependency on the monorepo. Example:
*
* npm run update-dependency rollup ^1.2.3
*/
const isDefined = _ => !!_;
const dependencyFields = ['dependencies', 'devDependencies', 'peerDependencies'];
const [, , pkg, version] = process.argv;
if (!pkg || !version) {
throw new Error(
'Package and version must be specified. For example: npm run update-dependency rollup ^1.2.3',
);
}
function forEachParallel(items, callback) {
return Promise.all(items.map(callback));
}
async function run() {
const basedir = path.resolve(__dirname, '..');
const dirs = [
...(await fs.readdir(path.join(basedir, 'packages'))).map(dir => path.join('packages', dir)),
...(await fs.readdir(path.join(basedir, 'demo', 'projects'))).map(dir =>
path.join('demo', 'projects', dir),
),
];
const rootPackageJsonPath = path.join(basedir, 'package.json');
const readRootPackageJsonTask = fs.readJSON(rootPackageJsonPath, 'utf-8');
// read all project package.json
let packageJsons = await Promise.all(
dirs.map(async dir => {
const packageJsonPath = path.join(basedir, dir, 'package.json');
if (!(await fs.pathExists(packageJsonPath))) return null;
const content = await fs.readJSON(packageJsonPath, 'utf-8');
return { content, path: packageJsonPath };
}),
);
packageJsons = packageJsons.filter(isDefined);
// read root package json
const rootPackageJson = await readRootPackageJsonTask;
packageJsons.push({ content: rootPackageJson, path: rootPackageJsonPath });
// update package.json files
await forEachParallel(packageJsons, async ({ content: packageJson, path: packageJsonPath }) => {
let changed = false;
for (const field of dependencyFields) {
if (packageJson[field] && pkg in packageJson[field]) {
packageJson[field][pkg] = version;
changed = true;
}
}
if (changed) {
console.log('updating package.json in ', packageJsonPath);
await fs.writeJSON(packageJsonPath, packageJson, { spaces: 2 });
}
});
}
run().catch(e => {
console.error(e);
});
| modernweb-dev/web/scripts/update-dependency.js/0 | {
"file_path": "modernweb-dev/web/scripts/update-dependency.js",
"repo_id": "modernweb-dev",
"token_count": 785
} | 243 |
legacy-peer-deps=true | odota/web/.npmrc/0 | {
"file_path": "odota/web/.npmrc",
"repo_id": "odota",
"token_count": 9
} | 244 |
https://opendota.com/* https://www.opendota.com/:splat 301!
/api/* https://api.opendota.com/api/:splat 200
/static/js/* /index.html 404
/* /index.html 200
| odota/web/public/_redirects/0 | {
"file_path": "odota/web/public/_redirects",
"repo_id": "odota",
"token_count": 69
} | 245 |
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="900" height="600"><rect width="900" height="600" fill="#ED2939"/><rect width="600" height="600" fill="#fff"/><rect width="300" height="600" fill="#002395"/></svg>
| odota/web/public/assets/images/flags/fx.svg/0 | {
"file_path": "odota/web/public/assets/images/flags/fx.svg",
"repo_id": "odota",
"token_count": 97
} | 246 |
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480">
<defs>
<clipPath id="a">
<path fill-opacity=".67" d="M-87.62 0h682.67v512H-87.62z"/>
</clipPath>
</defs>
<g fill-rule="evenodd" clip-path="url(#a)" transform="translate(82.14) scale(.94)">
<path fill="#fff" d="M619.43 512H-112V0h731.43z"/>
<path fill="#00c" d="M619.43 115.23H-112V48.003h731.43zm0 350.45H-112v-67.227h731.43zm-483-274.9l110.12 191.54 112.49-190.75-222.61-.79z"/>
<path d="M225.75 317.81l20.95 35.506 21.4-35.36-42.35-.145z" fill="#fff"/>
<path d="M136.02 320.58l110.13-191.54 112.48 190.75-222.61.79z" fill="#00c"/>
<path d="M225.75 191.61l20.95-35.506 21.4 35.36-42.35.145zm-43.78 79.5l-21.64 35.982 40.9-.127-19.26-35.855zm-21.27-66.5l41.225.29-19.834 36.26-21.39-36.55zm151.24 66.91l20.83 35.576-41.71-.533 20.88-35.043zm20.45-66.91l-41.225.29L311 241.16l21.39-36.55zm-114.27-.04l-28.394 51.515 28.8 50.297 52.73 1.217 32.044-51.515-29.61-51.92-55.572.405z" fill="#fff"/>
</g>
</svg>
| odota/web/public/assets/images/flags/il.svg/0 | {
"file_path": "odota/web/public/assets/images/flags/il.svg",
"repo_id": "odota",
"token_count": 555
} | 247 |
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480">
<defs>
<clipPath id="a">
<path fill-opacity=".67" d="M0 0h682.67v512H0z"/>
</clipPath>
</defs>
<g clip-path="url(#a)" fill-rule="evenodd" transform="scale(.9375)">
<path fill="#ff0" d="M0 0h768.77v128H0z"/>
<path fill="#fff" d="M0 128h768.77v128H0z"/>
<path fill="#be0027" d="M0 256h768.77v128H0z"/>
<path fill="#3b5aa3" d="M0 384h768.77v128H0z"/>
<path d="M0 0v512l381.86-255.28L0 0z" fill="#239e46"/>
<path d="M157.21 141.43C72.113 137.12 33.34 204.9 33.43 257.3c-.194 61.97 58.529 113.08 112.81 109.99-29.27-13.84-65.008-52.66-65.337-110.25-.3-52.18 29.497-97.55 76.307-115.61z" fill="#fff"/>
<path fill="#fff" d="M155.927 197.058l-11.992-9.385-14.539 4.576 5.215-14.317-8.831-12.41 15.227.528 9.065-12.238 4.195 14.649 14.452 4.846-12.644 8.524zM155.672 249.121l-11.993-9.385-14.538 4.576 5.215-14.317-8.831-12.41 15.227.528 9.065-12.238 4.194 14.649 14.453 4.846-12.645 8.524zM155.927 301.698l-11.992-9.385-14.539 4.576 5.215-14.317-8.831-12.41 15.227.528 9.065-12.239 4.195 14.65 14.452 4.846-12.644 8.524zM155.672 354.778l-11.993-9.385-14.538 4.576 5.215-14.317-8.831-12.41 15.227.528 9.065-12.239 4.194 14.65 14.453 4.846-12.645 8.524z"/>
</g>
</svg>
| odota/web/public/assets/images/flags/km.svg/0 | {
"file_path": "odota/web/public/assets/images/flags/km.svg",
"repo_id": "odota",
"token_count": 689
} | 248 |
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480">
<g fill-rule="evenodd">
<path fill="#fff" d="M0 0h640v480.003H0z"/>
<path fill="#ab231d" d="M0 0h640v192.001H0zM0 288.002h640v192.001H0z"/>
</g>
</svg>
| odota/web/public/assets/images/flags/lv.svg/0 | {
"file_path": "odota/web/public/assets/images/flags/lv.svg",
"repo_id": "odota",
"token_count": 124
} | 249 |
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="480" width="640" viewBox="0 0 640 480">
<path fill="#006233" d="M0 0h640v480H0z"/>
<circle cx="320" cy="180" r="155" fill="#ffc400"/>
<path d="M243.425 11.216A150 150 0 0 0 170 140a150 150 0 0 0 150 150 150 150 0 0 0 150-150 150 150 0 0 0-73.433-128.784H243.425z" fill="#006233"/>
<g id="b" transform="matrix(5 0 0 5 320 140)">
<path id="a" d="M0-12L-3.708-.587l5.706 1.854" fill="#ffc400"/>
<use height="100%" width="100%" xlink:href="#a" transform="scale(-1 1)"/>
</g>
<use height="100%" width="100%" xlink:href="#b" transform="rotate(72 320 140)"/>
<use height="100%" width="100%" xlink:href="#b" transform="rotate(144 320 140)"/>
<use height="100%" width="100%" xlink:href="#b" transform="rotate(-144 320 140)"/>
<use height="100%" width="100%" xlink:href="#b" transform="rotate(-72 320 140)"/>
</svg>
| odota/web/public/assets/images/flags/mr.svg/0 | {
"file_path": "odota/web/public/assets/images/flags/mr.svg",
"repo_id": "odota",
"token_count": 376
} | 250 |
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480">
<path fill="#ef2b2d" d="M0 0h640v480H0z"/>
<path fill="#fff" d="M180 0h120v480H180z"/>
<path fill="#fff" d="M0 180h640v120H0z"/>
<path fill="#002868" d="M210 0h60v480h-60z"/>
<path fill="#002868" d="M0 210h640v60H0z"/>
</svg>
| odota/web/public/assets/images/flags/no.svg/0 | {
"file_path": "odota/web/public/assets/images/flags/no.svg",
"repo_id": "odota",
"token_count": 156
} | 251 |
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480">
<defs>
<clipPath id="a">
<path fill-opacity=".67" d="M-118 0h682.67v512H-118z"/>
</clipPath>
</defs>
<g clip-path="url(#a)" transform="translate(110.63) scale(.9375)">
<g fill-rule="evenodd" stroke-width="1pt">
<path d="M-246 0H778.002v170.667H-246z"/>
<path fill="#fff" d="M-246 170.667H778.002v170.667H-246z"/>
<path fill="#090" d="M-246 341.334H778.002v170.667H-246z"/>
<path d="M-246 512.001l512.001-256L-246 0v512.001z" fill="red"/>
</g>
</g>
</svg>
| odota/web/public/assets/images/flags/ps.svg/0 | {
"file_path": "odota/web/public/assets/images/flags/ps.svg",
"repo_id": "odota",
"token_count": 296
} | 252 |
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480">
<g fill-rule="evenodd">
<path fill="#000067" d="M0 0h213.97v480H0z"/>
<path fill="red" d="M426.03 0H640v480H426.03z"/>
<path fill="#ff0" d="M213.97 0h212.06v480H213.97z"/>
</g>
</svg>
| odota/web/public/assets/images/flags/td.svg/0 | {
"file_path": "odota/web/public/assets/images/flags/td.svg",
"repo_id": "odota",
"token_count": 141
} | 253 |
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480">
<g fill-rule="evenodd" stroke-width="1pt">
<path fill="#ffd500" d="M0 0h640v480H0z"/>
<path fill="#005bbb" d="M0 0h640v240H0z"/>
</g>
</svg>
| odota/web/public/assets/images/flags/ua.svg/0 | {
"file_path": "odota/web/public/assets/images/flags/ua.svg",
"repo_id": "odota",
"token_count": 115
} | 254 |
export default function transformTrends(fieldName) {
return (response) => {
let cumulativeSum = 0;
const chunkSize = 20;
// Compute sum of data (to act as in integral over data field)
// trends[i].value = sum(0 -> i, attribute)
const trends = response.reverse().reduce((dataList, match) => {
const win = (match.player_slot < 128) === match.radiant_win;
const currentValue = fieldName === 'win_rate'
? Number(win) * 100 // true -> 100 false -> 0
: match[fieldName];
if (currentValue === undefined || currentValue === null) {
// filter
return dataList;
}
cumulativeSum += currentValue;
const nextIndex = dataList.length + 1;
dataList.push({
x: nextIndex,
value: Number(cumulativeSum).toFixed(2),
independent_value: currentValue,
match_id: match.match_id,
hero_id: match.hero_id,
game_mode: match.game_mode,
duration: match.duration,
start_time: match.start_time,
win,
});
return dataList;
}, []);
// Compute in reverse order so that first n can be discarded
for (let i = trends.length - 1; i > chunkSize - 1; i -= 1) {
trends[i].value = (trends[i].value - trends[i - chunkSize].value) / chunkSize;
// Update graph index so it starts at 1 (since we only display 480 at a time)
trends[i].x -= chunkSize;
}
// Discard first 20 elements
trends.splice(0, chunkSize);
// Return 480 elements
return trends;
};
}
| odota/web/src/actions/transformTrends.js/0 | {
"file_path": "odota/web/src/actions/transformTrends.js",
"repo_id": "odota",
"token_count": 602
} | 255 |
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import styled from 'styled-components';
import constants from '../constants';
const StyledLink = styled(Link)`
font-weight: ${constants.fontWeightMedium};
color: ${constants.textColorPrimary};
text-transform: uppercase;
&:hover {
color: ${constants.textColorPrimary};
opacity: 0.6;
}
`;
const AppLogo = ({ size, strings, onClick }) => (
<StyledLink aria-label="Go to the Open Dota homepage" to="/" onClick={onClick}>
<span style={{ fontSize: size }}>
{strings.app_name && `<${strings.app_name}/>`}
</span>
</StyledLink>
);
AppLogo.propTypes = {
size: PropTypes.string,
strings: PropTypes.shape({}),
onClick: PropTypes.func,
};
const mapStateToProps = state => ({
strings: state.app.strings,
});
export default connect(mapStateToProps)(AppLogo);
| odota/web/src/components/App/AppLogo.jsx/0 | {
"file_path": "odota/web/src/components/App/AppLogo.jsx",
"repo_id": "odota",
"token_count": 330
} | 256 |
import React from 'react';
import { string } from 'prop-types';
const Error = props => (
<div>Whoops! Something went wrong. {props.text ? props.text : ''}</div>
);
Error.propTypes = {
text: string,
};
export default Error;
| odota/web/src/components/Error/Error.jsx/0 | {
"file_path": "odota/web/src/components/Error/Error.jsx",
"repo_id": "odota",
"token_count": 77
} | 257 |
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import AppLogo from '../App/AppLogo';
import PageLinks from './PageLinks';
// import Cheese from './Cheese';
import SocialLinks from './SocialLinks';
import { IconSteam } from '../Icons';
import constants from '../constants';
const StyledFooter = styled.footer`
padding: 0px 50px 15px;
background-color: ${constants.defaultPrimaryColor};
color: ${constants.primaryTextColor};
display: flex;
flex-direction: row;
align-items: flex-start;
& p {
padding: 2px 0 5px;
margin: 0;
font-size: ${constants.fontSizeMedium};
}
& .links,
& .cheese {
margin-top: 12px;
}
& .mobile {
& img {
&:hover {
opacity: 0.6;
}
}
}
& .links {
& .logoNsocial {
display: flex;
flex-direction: row;
align-items: baseline;
position: relative;
& a {
cursor: pointer;
&[data-hint-position="top"] {
&::before {
margin-left: 18px;
}
}
}
}
& svg {
height: 18px;
margin-left: 15px;
vertical-align: text-top;
fill: ${constants.textColorPrimary};
transition: ${constants.normalTransition};
&:hover {
opacity: 0.6;
}
}
& small {
color: ${constants.colorMutedLight};
font-size: ${constants.fontSizeSmall};
& svg {
height: 13px;
margin-left: 8px;
vertical-align: sub;
transition: ${constants.normalTransition};
}
}
& .pages {
font-size: ${constants.fontSizeMedium};
margin-bottom: 4px;
& a {
display: inline-block;
&:hover {
color: ${constants.textColorPrimary};
}
&::after {
content: "•";
margin: 0 8px;
opacity: 0.6;
color: ${constants.primaryTextColor};
}
&:last-child {
&::after {
content: "";
margin: 0;
}
}
}
}
}
& .cheese {
display: flex;
flex-direction: row;
align-items: center;
& > div:first-of-type {
margin-right: 20px;
}
}
& .SocialLinks a {
position: relative;
&[data-hint] {
cursor: pointer;
&::before {
margin-left: 16px;
}
}
}
@media only screen and (max-width: 960px) {
padding: 20px 25px 15px;
flex-direction: column;
& .links,
& .cheese {
width: 100%;
}
& .cheese {
margin-top: 20px;
}
}
`;
const StyledHr = styled.hr`
border: 0;
height: 1px;
opacity: 0.1;
margin: 10px 0;
background: linear-gradient(to right, ${constants.primaryTextColor}, rgba(0, 0, 0, 0));
`;
const Footer = ({ strings }) => (
<StyledFooter>
<div className="links">
<div className="logoNsocial">
<AppLogo />
<SocialLinks strings={strings} />
<div className="mobile">
<a
href="https://play.google.com/store/apps/details?id=com.opendota.mobile&hl=en"
style={{ position: 'relative', left: '13px', top: '12px' }}
>
<img src="/assets/images/google_play_store.png" alt="download the android app on google play store" height="46px" />
</a>
<a
href="https://itunes.apple.com/us/app/opendota/id1354762555?ls=1&mt=8"
style={{ position: 'relative', left: '20px', top: '5px' }}
>
<img src="/assets/images/apple_app_store.png" alt="download the iOS app on the app store" height="31px" />
</a>
</div>
</div>
<small className="about">
<span id="app-description">{strings.app_description}</span>
{' - '}
<span id="app-powered-by">{strings.app_powered_by}</span>
<a href="http://steampowered.com" aria-describedby="app-description app-powered-by" target="_blank" rel="noopener noreferrer">
<IconSteam />
</a>
</small>
<StyledHr />
<div className="pages">
<PageLinks />
</div>
</div>
{/* <Cheese /> */}
</StyledFooter>
);
Footer.propTypes = {
strings: PropTypes.shape({}),
};
const mapStateToProps = state => ({
strings: state.app.strings,
});
export default connect(mapStateToProps)(Footer);
| odota/web/src/components/Footer/Footer.jsx/0 | {
"file_path": "odota/web/src/components/Footer/Footer.jsx",
"repo_id": "odota",
"token_count": 2041
} | 258 |
import Heading from './Heading';
export default Heading;
| odota/web/src/components/Heading/index.js/0 | {
"file_path": "odota/web/src/components/Heading/index.js",
"repo_id": "odota",
"token_count": 17
} | 259 |
import React, { useEffect } from 'react';
import { connect } from 'react-redux';
import itemIds from 'dotaconstants/build/item_ids.json';
import PropTypes from 'prop-types';
import Table from '../Table';
import inflictorWithValue from '../Visualizations/inflictorWithValue';
import { getHeroItemSuggestions } from '../../actions';
import TableSkeleton from '../Skeletons/TableSkeleton';
function ItemsSuggestion(props) {
const displayFn = (row, col, i) => Object.keys(i).map(itemId => inflictorWithValue(itemIds[itemId]));
const { onGetHeroItemSuggestions, match } = props;
useEffect(() => {
if (match.params && match.params.heroId) {
onGetHeroItemSuggestions(match.params.heroId);
}
}, [onGetHeroItemSuggestions, match]);
const itemSuggestionColumns = [
{
field: 'start_game_items',
displayName: 'Start Game',
displayFn,
},
{
field: 'early_game_items',
displayName: 'Early Game',
displayFn,
},
{
field: 'mid_game_items',
displayName: 'Mid Game',
displayFn,
},
{
field: 'late_game_items',
displayName: 'Late Game',
displayFn,
},
];
const itemsPopularityData = props.data;
return props.isLoading ? <TableSkeleton /> : <Table data={itemsPopularityData} columns={itemSuggestionColumns} />;
}
ItemsSuggestion.propTypes = {
match: PropTypes.shape({
params: PropTypes.shape({
heroId: PropTypes.string,
}),
}),
isLoading: PropTypes.bool,
};
const mapStateToProps = ({ app }) => ({
isLoading: app.heroItemSuggestions.loading,
data: Object.values(app.heroItemSuggestions.data),
}
);
const mapDispatchToProps = {
onGetHeroItemSuggestions: getHeroItemSuggestions,
};
export default connect(mapStateToProps, mapDispatchToProps)(ItemsSuggestion);
| odota/web/src/components/Hero/ItemSuggestion.jsx/0 | {
"file_path": "odota/web/src/components/Hero/ItemSuggestion.jsx",
"repo_id": "odota",
"token_count": 663
} | 260 |
import React from 'react';
export default props => (
// Taked from http://game-icons.net/lorc/originals/wind-slap.html
// by http://lorcblog.blogspot.ru/ under CC BY 3.0
<svg {...props} viewBox="0 0 512 512">
<path
fill="#39d401"
d="M164.672 15.316c-4.24-.02-8.52-.008-12.848.032 356.973 34.267 149.668
296.606-133.02 225.675v29.272c208.715 52.028 406.9-83.077 335.225-186.316 74.252 54.5 10.927
228.767-217.44 261.272 80.052-17.795 151.75-58.013 188.793-112.78v-.003c-76.777 75.27-199.896
99.73-306.61 83.514v38.547l.03.003v29.983c103.604 17.95 230.47-10.83 317.05-98.192-64.335
91.95-198.984 149.52-317.05 142.64v62.942C398.408 491.783 590.073 234.433 449.346 98c90.898
155.644-119.865 338.862-308.12 339.258C392.92 399.278 523.24 116.29
322.532 33.352c-43.685-11.26-96.104-17.76-157.86-18.036z"
/>
</svg>
);
| odota/web/src/components/Icons/AttrAgility.jsx/0 | {
"file_path": "odota/web/src/components/Icons/AttrAgility.jsx",
"repo_id": "odota",
"token_count": 449
} | 261 |
import React from 'react';
import styled from 'styled-components';
import PropTypes from 'prop-types';
const icon = (props) => {
const { color } = props.style;
return (
<svg {...props} viewBox="0 0 24 24">
<line strokeLinecap="undefined" strokeLinejoin="undefined" id="svg_24" y2="2" x2="2" y1="12" x1="2" fillOpacity="null" strokeOpacity="null" strokeWidth="1.5" stroke={color} fill="none" />
<line strokeLinecap="undefined" strokeLinejoin="undefined" id="svg_26" y2="22.062643" x2="22" y1="12.062643" x1="22" fillOpacity="null" strokeOpacity="null" strokeWidth="1.5" stroke={color} fill="none" />
<line strokeLinecap="undefined" strokeLinejoin="undefined" id="svg_27" y2="22" x2="12" y1="22" x1="22" fillOpacity="null" strokeOpacity="null" strokeWidth="1.5" stroke={color} fill="none" />
<line strokeLinecap="undefined" strokeLinejoin="undefined" id="svg_28" y2="2" x2="12" y1="2" x1="2" fillOpacity="null" strokeOpacity="null" strokeWidth="1.5" stroke={color} fill="none" />
<line transform="rotate(-45 11.999999999999998,12.015661239624022) " strokeLinecap="undefined" strokeLinejoin="undefined" id="svg_33" y2="12.031322" x2="18" y1="12" x1="6" fillOpacity="1" strokeOpacity="null" strokeWidth="1.5" stroke={color} fill="none" />
</svg>);
};
export default styled(icon)`
height: 24px;
`;
icon.propTypes = {
style: PropTypes.shape({}),
};
| odota/web/src/components/Icons/LaneRoles.jsx/0 | {
"file_path": "odota/web/src/components/Icons/LaneRoles.jsx",
"repo_id": "odota",
"token_count": 544
} | 262 |
import React from 'react';
import propTypes from 'prop-types';
import styled from 'styled-components';
import constants from '../constants';
import { styleValues } from '../../utility';
import config from '../../config';
import AbilityBehaviour from '../AbilityTooltip/AbilityBehaviour';
const items = (await import('dotaconstants/build/items.json')).default;
const patchnotes = (await import('dotaconstants/build/patchnotes.json')).default;
// Get patchnotes from up to two last letter patches
function getRecentChanges(item) {
const patches = Object.keys(patchnotes);
const latest = patches[patches.length - 1];
const previous = patches[patches.length - 2];
const changes = [];
// Latest patch wasn't a major patch e.g. 7_35b, return more entries
if (latest.length > 4) {
patchnotes[previous].items[item]?.forEach(note => changes.push({patch: previous, note}))
}
patchnotes[latest].items[item]?.forEach(note => changes.push({patch: latest, note}))
return changes;
}
const textHighlightColors = {
use: '#95c07a',
active: '#9f9fcf',
passive: '#7e8c9d',
}
const Wrapper = styled.div`
width: 300px;
background: linear-gradient(#16232B, #10171D);
color: #7a80a7;
overflow: hidden;
border: 2px solid #27292b;
hr {
border-color: #29353b;
margin: 0 9px;
}
`;
const Header = styled.div`
font-size: ${constants.fontSizeCommon};
text-transform: uppercase;
color: ${constants.colorBlue};
background-color: #222C35;
.header-content {
height: 50px;
padding: 13px;
white-space: nowrap;
display: flex;
}
#item-img {
display: inline-block;
height: 100%;
width: 100%;
border: 1px solid #080D15;
box-sizing: border-box;
}
`;
const HeaderText = styled.div`
height: 100%;
position: relative;
bottom: 2px;
display: inline-block;
margin-left: 15px;
color: ${constants.primaryTextColor};
font-weight: bold;
letter-spacing: 1px;
& div {
width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
& #gold {
color: ${constants.colorGolden};
font-weight: normal;
font-size: ${constants.fontSizeSmall};
& img {
height: 13px;
margin-right: 5px;
position: relative;
top: 2px;
}
}
& .neutral-header {
font-weight: normal;
text-transform: none;
font-size: ${constants.fontSizeSmall};
& .neutral_tier_2 {
color: ${constants.colorNeutralTier2};
}
& .neutral_tier_3 {
color: ${constants.colorNeutralTier3};
}
& .neutral_tier_4 {
color: ${constants.colorNeutralTier4};
}
& .neutral_tier_5 {
color: ${constants.colorNeutralTier5};
}
}
`;
const ResourceIcon = styled.img`
max-width: 16px;
max-height: 16px;
vertical-align: sub;
margin-right: 5px;
`;
const Attributes = styled.div`
padding: 0 8px;
margin: 9px 0;
& #footer {
color: #95a5a6;
}
& #value {
font-weight: 500;
}
& #header {
color: #95a5a6;
}
`;
const GameplayChanges = styled.div`
margin: 10px 9px;
background-color: #18212a;
padding: 6px;
& .patch {
color: #a09259;
margin-right: 2px;
}
& .note {
color: grey;
}
`;
const GameplayChange = styled.div`
display: flex;
align-items: flex-start;
font-size: 10px;
`;
const Lore = styled.div`
background-color: #0D1118;
margin: 10px 9px 10px 9px;
font-size: ${constants.fontSizeSmall};
font-style: italic;
color: #51565F;
padding: 6px;
`;
const Hint = styled.div`
margin: 10px 9px;
padding: 6px;
background-color: #51565F;
color: #080D15;
`;
const Components = styled.div`
font-family: Tahoma;
margin: 6px 9px;
#header {
font-size: 10px;
color: #51565F;
}
.component {
display: inline-block;
margin-right: 5px;
& img {
height: 25px;
opacity: 0.75;
}
#cost {
font-size: 10px;
position: relative;
bottom: 6px;
text-align: center;
color: ${constants.colorYelorMuted};
}
}
`;
const AbilityComponent = styled.div`
margin: 10px 9px;
& .ability-name {
font-size: 13px;
font-weight: bold;
vertical-align: middle;
padding-left: 4px;
text-shadow: 1px 1px 0 #00000090;
}
& .header {
height: 28px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 0 5px;
.entry {
color: ${constants.textColorPrimary};
margin-left: 10px;
}
}
& .content {
padding: 5px;
}
.active {
color: #7a80a7;
& .header {
color: ${textHighlightColors.active};
background: linear-gradient(to right, #373B7F, #181E30);
}
& .content {
background-color: #181E30;
}
}
.passive {
color: #626d7b;
& .header {
color: ${textHighlightColors.passive};
background: linear-gradient(to right, #263540, #1C2630);
}
& .content {
background-color: #1C2630;
}
}
.use {
color: #7b8a72;
& .header {
color: ${textHighlightColors.use};
background: linear-gradient(to right, #273F27, #17231F);
}
& .content {
background-color: #17231F;
}
}
`;
const Ability = (item, type, title, description, hasNonPassive) => {
const highlightStyle = `font-weight:500;color:${textHighlightColors[type]};text-shadow:2px 2px 0 #00000090;`;
return (
<AbilityComponent>
<div className={type}>
<div className='header'>
<span className='ability-name'>{title}</span>
<div>
{item.mc && type !== 'passive' &&
<span className="entry">
<ResourceIcon src='/assets/images/dota2/ability_manacost.png' alt='Mana icon' />
<span className='values'>{item.mc}</span>
</span>}
{item.hc && type !== 'passive' &&
<span className="entry">
<ResourceIcon src='/assets/images/dota2/ability_healthcost.png' alt='Health icon' />
<span className='values'>{item.hc}</span>
</span>}
{item.cd && ((!hasNonPassive && type === 'passive') || type !== 'passive') &&
<span className="entry">
<ResourceIcon src='/assets/images/dota2/ability_cooldown.png' alt='Cooldown icon' />
<span className='values'>{item.cd}</span>
</span>}
</div>
</div>
<div className='content'>
<div className='ability-text' ref={el => styleValues(el, highlightStyle)}>
{description}
</div>
</div>
</div>
</AbilityComponent>
);
};
// How each type should be styled
const abilityType = {
Active: 'active',
Toggle: 'active',
Passive: 'passive',
Use: 'use',
}
function parseAbilities(lines) {
const abilities = [];
const hints = [];
lines?.forEach((line) => {
const match = line.match(/^(Use|Active|Passive|Toggle): (([A-Z]\w+'*\w )+)/);
if (match) {
const [str, typeStr, titleCase, firstWord] = match;
const type = abilityType[typeStr] || 'passive';
const title = `${typeStr}: ${ titleCase.replace(firstWord, '')}`;
abilities.push({
type,
title,
description: line.replace(str, firstWord),
});
} else {
hints.push(line);
}
});
return [abilities, hints];
}
const ItemTooltip = ({ item, inflictor }) => {
const recentChanges = getRecentChanges(inflictor);
const [ abilities, hints ] = parseAbilities(item.hint);
const stats = item.attrib.filter(a => a.hasOwnProperty('display'));
const hasNonPassive = abilities.some((a) => ['active', 'use'].includes(a.type))
return (
<Wrapper>
<Header>
<div className='header-content'>
<img id='item-img' src={`${config.VITE_IMAGE_CDN}${item.img}`} alt={item.dname} />
<HeaderText>
<div>{item.dname}</div>
{item.tier ? <div className='neutral-header'><span
className={`neutral_tier_${item.tier}`}
>{`Tier ${item.tier} `}
</span><span>Neutral Item</span>
</div>
: <div id='gold'><img
src={`${config.VITE_IMAGE_CDN}/apps/dota2/images/tooltips/gold.png`}
alt='Gold'
/>{item.cost}
</div>}
</HeaderText>
</div>
</Header>
{(item.behavior || item.dmg_type || item.bkbpierce || item.dispellable) && <div><AbilityBehaviour ability={item} /><hr /></div>}
{(stats && stats.length > 0) &&
<Attributes>
{(stats).map((attrib) => (
<div key={attrib.key}>
<div id='header' ref={el => styleValues(el)}>
{attrib.display.replace('{value}', attrib.value)}
</div>
</div>
))}
</Attributes>}
{abilities.map(({type, title, description}) => Ability(item, type, title, description, hasNonPassive))}
{hints.map((hint) => <Hint>{hint}</Hint>)}
{item.lore && <Lore>{item.lore}</Lore>}
{recentChanges.length > 0 &&
<GameplayChanges>
{recentChanges.map(({ patch, note }) => (
<GameplayChange>
<span className="patch">{`${patch.replace('_','.') }:`}</span><span className="note">{note}</span>
</GameplayChange>
))}
</GameplayChanges>}
{item.components &&
<Components>
<div id='header'>Components:</div>
{item.components.concat((items[`recipe_${inflictor}`] && [`recipe_${inflictor}`]) || []).filter(Boolean).map(component =>
items[component] &&
(
<div className='component'>
<img src={`${config.VITE_IMAGE_CDN}${items[component].img}`} alt='' />
<div id='cost'>{items[component].cost}</div>
</div>
))
}
</Components>
}
</Wrapper>
);
}
ItemTooltip.propTypes = {
item: propTypes.shape({}).isRequired,
inflictor: propTypes.string.isRequired
};
export default ItemTooltip;
| odota/web/src/components/ItemTooltip/index.jsx/0 | {
"file_path": "odota/web/src/components/ItemTooltip/index.jsx",
"repo_id": "odota",
"token_count": 4612
} | 263 |
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import FlatButton from 'material-ui/FlatButton';
import styled from 'styled-components';
import NavigationRefresh from 'material-ui/svg-icons/navigation/refresh';
import ActionFingerprint from 'material-ui/svg-icons/action/fingerprint';
import FileFileDownload from 'material-ui/svg-icons/file/file-download';
import ContentCopy from 'material-ui/svg-icons/content/content-copy';
import { transformations, isRadiant, sum } from '../../../utility';
import { IconRadiant, IconDire } from '../../Icons';
import Warning from '../../Alerts';
import constants from '../../constants';
import config from '../../../config';
const Styled = styled.header`
width: 100vw;
margin: 0px -50vw 0px -50vw;
position: relative;
left: 50%;
right: 50%;
padding-top: 35px;
background-color: rgba(14, 84, 113, 37%);
.matchInfo {
display: grid;
grid-template-columns: 1fr minmax(500px, max-content) 1fr;
justify-items: center;
align-items: center;
@media only screen and (max-width: 1000px) {
grid-template-columns: none;
grid-template-rows: auto;
grid-gap: 10px;
margin-bottom: 15px;
}
}
.team {
box-sizing: border-box;
border: 1px solid rgba(255, 255, 255, 6%);
background: rgba(0, 0, 0, 23%);
padding: 8px;
border-radius: 3px;
margin-right: 30px;
margin-left: 30px;
justify-self: flex-end;
font-weight: 700;
@media only screen and (max-width: 1023px) {
flex-basis: 100%;
max-width: 100%;
justify-self: auto;
}
font-size: 28px;
@media only screen and (max-width: 1023px) {
text-align: center;
margin: 10px 0;
}
& > span {
letter-spacing: 1px;
}
&.radiant {
background: rgba(9, 90, 30, 23%);
}
&.dire {
background: rgba(143, 16, 16, 23%);
}
& svg {
width: 32px;
height: 32px;
margin-right: 10px;
vertical-align: sub;
@media only screen and (max-width: 1023px) {
display: block;
margin: 0 auto;
width: 48px;
height: 48px;
}
}
}
.nowinner {
color: ${constants.colorMuted};
}
.radiant {
color: ${constants.colorSuccess};
& svg {
filter: drop-shadow(0 0 5px green);
fill: ${constants.textColorPrimary} !important;
}
}
.dire {
color: ${constants.colorDanger};
& svg {
filter: drop-shadow(0 0 5px ${constants.colorDanger});
fill: black !important;
}
}
.mainInfo {
box-sizing: border-box;
@media only screen and (max-width: 1023px) {
flex-basis: 100%;
max-width: 100%;
}
display: flex;
justify-content: center;
text-align: center;
}
.gmde {
margin: 0 20px;
@media only screen and (max-width: 400px) {
margin: 0 10px;
}
& span {
text-transform: uppercase;
display: block;
}
& .gameMode {
font-size: ${constants.fontSizeMedium};
}
& .duration {
font-size: 28px;
@media only screen and (max-width: 400px) {
font-size: 24px;
}
}
& .ended {
font-size: ${constants.fontSizeSmall};
color: ${constants.colorMutedLight};
margin-top: 3px;
& > div {
display: inline-block;
}
}
}
.killsRadiant {
font-size: 48px;
text-align: center;
@media only screen and (max-width: 400px) {
font-size: 40px;
}
color: ${constants.colorSuccess};
}
.killsDire {
font-size: 48px;
text-align: center;
@media only screen and (max-width: 400px) {
font-size: 40px;
}
color: ${constants.colorDanger};
}
.additionalInfo {
box-sizing: border-box;
padding: 20px 0px 10px 0px;
margin-right: 30px;
margin-left: 30px;
justify-self: flex-start;
@media only screen and (max-width: 1023px) {
flex-basis: 100%;
max-width: 100%;
justify-self: auto;
}
text-align: right;
@media only screen and (max-width: 1023px) {
text-align: center;
& span {
margin-bottom: 5px;
}
}
& ul {
padding: 0;
margin: 0;
& li {
display: inline-block;
margin-left: 20px;
& > span {
display: block;
text-transform: uppercase;
font-size: ${constants.fontSizeSmall};
color: ${constants.colorMutedLight};
}
}
& li:first-child {
margin-left: 0;
}
}
}
.matchButtons {
display: table;
margin: 10px auto 0;
/* Material-ui buttons */
& a {
float: left;
margin: 5px !important;
line-height: 34px !important;
}
@media only screen and (max-width: 620px) {
& a {
min-width: 24px !important;
& span {
font-size: 0 !important;
padding-left: 0 !important;
padding-right: 12px !important;
}
}
}
}
.unparsed {
text-align: center;
margin-top: 12px;
}
.copy-match-id {
span {
line-height: 17px;
padding: 0px !important;
padding-right: 4px !important;
}
svg {
margin: 0px !important;
margin-left: 4px !important;
}
line-height: 0px !important;
height: 20px !important;
},
`;
const getWinnerStyle = (radiantWin) => {
if (radiantWin === null || radiantWin === undefined) {
return 'nowinner';
}
return radiantWin ? 'radiant' : 'dire';
};
const MatchHeader = ({ match, strings }) => {
if (!match) {
return null;
}
const copyMatchId = () => navigator.clipboard.writeText(match.match_id);
const mapPlayers = (key, radiant) => (player) =>
radiant === undefined || radiant === isRadiant(player.player_slot)
? Number(player[key])
: null;
const victorySection = match.radiant_win ? (
<span>
<IconRadiant />
{match.radiant_team && match.radiant_team.name
? `${match.radiant_team.name} ${strings.match_team_win}`
: strings.match_radiant_win}
</span>
) : (
<span>
<IconDire />
{match.dire_team && match.dire_team.name
? `${match.dire_team.name} ${strings.match_team_win}`
: strings.match_dire_win}
</span>
);
return (
<Styled>
<div className="matchInfo">
<div className={`team ${getWinnerStyle(match.radiant_win)}`}>
{match.radiant_win === null || match.radiant_win === undefined
? strings.td_no_result
: victorySection}
</div>
<div className="mainInfo">
<div className="killsRadiant">
{match.radiant_score ||
match.players.map(mapPlayers('kills', true)).reduce(sum, 0)}
</div>
<div className="gmde">
<span className="gameMode">
{strings[`game_mode_${match.game_mode}`]}
</span>
<span className="duration">
{transformations.duration(null, null, match.duration)}
</span>
<span className="ended">
{strings.match_ended}{' '}
{transformations.start_time(
null,
null,
match.start_time + match.duration
)}
</span>
</div>
<div className="killsDire">
{match.dire_score ||
match.players.map(mapPlayers('kills', false)).reduce(sum, 0)}
</div>
</div>
<div className="additionalInfo">
<ul>
{match.league && (
<li>
<span>league</span>
{match.league.name}
</li>
)}
<li>
<span>{strings.match_id}</span>
<FlatButton
label={match.match_id}
className='copy-match-id'
onClick={copyMatchId}
icon={<ContentCopy viewBox='0 -3 30 30' style={{ height: 18, width: 18 }} />}
/>
</li>
<li>
<span>{strings.match_region}</span>
{strings[`region_${match.region}`]}
</li>
</ul>
</div>
</div>
{!match.version && (
<Warning className="unparsed">{strings.tooltip_unparsed}</Warning>
)}
<div className="matchButtons">
<FlatButton
label={
match.version
? strings.match_button_reparse
: strings.match_button_parse
}
icon={match.version ? <NavigationRefresh /> : <ActionFingerprint />}
containerElement={<Link to={`/request#${match.match_id}`}>r</Link>}
/>
{match.replay_url && (
<FlatButton
label={strings.match_button_replay}
icon={<FileFileDownload />}
href={match.replay_url}
target="_blank"
rel="noopener noreferrer"
/>
)}
{config.VITE_ENABLE_DOTA_COACH && (
<FlatButton
label={strings.app_dota_coach_button}
icon={
<img
src="/assets/images/dota-coach-icon.png"
alt="Sponsor icon dota-coach.com"
height="24px"
/>
}
href="https://dota-coach.com?s=OpenDota&c=analytics"
target="_blank"
rel="noopener noreferrer"
/>
)}
{config.VITE_ENABLE_RIVALRY && (
<FlatButton
label={strings.app_rivalry}
icon={
<img src="/assets/images/rivalry-icon.png" alt="Sponsor icon rivalry.com" height="24px" />
}
href="https://www.rivalry.com/opendota"
target="_blank"
rel="noopener noreferrer"
/>
)}
</div>
</Styled>
);
};
MatchHeader.propTypes = {
match: PropTypes.shape({}),
user: PropTypes.shape({}),
strings: PropTypes.shape({}),
};
const mapStateToProps = (state) => ({
strings: state.app.strings,
});
export default connect(mapStateToProps)(MatchHeader);
| odota/web/src/components/Match/MatchHeader/MatchHeader.jsx/0 | {
"file_path": "odota/web/src/components/Match/MatchHeader/MatchHeader.jsx",
"repo_id": "odota",
"token_count": 4946
} | 264 |
import React from 'react';
import PropTypes from 'prop-types';
import TeamTable from '../TeamTable';
import mcs from '../matchColumns';
const VisionItems = ({ match, strings }) => {
const { visionColumns } = mcs(strings);
return (
<TeamTable
players={match.players}
heading={strings.heading_vision}
columns={visionColumns(strings)}
radiantTeam={match.radiant_team}
direTeam={match.dire_team}
radiantWin={match.radiant_win}
/>
);
};
VisionItems.propTypes = {
match: PropTypes.shape({}),
strings: PropTypes.shape({}),
};
export default VisionItems;
| odota/web/src/components/Match/Vision/VisionItems.jsx/0 | {
"file_path": "odota/web/src/components/Match/Vision/VisionItems.jsx",
"repo_id": "odota",
"token_count": 214
} | 265 |
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import { connect } from 'react-redux';
import { PlayerStatsCard } from './Styled';
import constants from '../../constants';
import config from '../../../config';
const shouldShow = props => props.loggedInId && props.loggedInId !== props.playerId;
const getData = (props, context) => {
if (shouldShow(props)) {
fetch(`${config.VITE_API_HOST}/api/players/${props.loggedInId}/wl?included_account_id=${props.playerId}`)
.then(resp => resp.json())
.then(json => context.setState({ ...context.state, ...json }));
}
};
const inlineStyle = { display: 'inline' };
class PlayedWith extends React.Component {
static propTypes = {
playerId: PropTypes.string,
loggedInId: PropTypes.string,
strings: PropTypes.shape({}),
}
constructor() {
super();
this.state = {};
}
componentDidMount() {
getData(this.props, this);
}
componentDidUpdate(prevProps) {
if (this.props.playerId !== prevProps.playerId) {
getData(this.props, this);
}
}
render() {
const { strings } = this.props;
return (
<div style={{ display: shouldShow(this.props) ? 'inline' : 'none', marginLeft: '10px' }}>
<PlayerStatsCard
subtitle={
<div>
<div style={{ ...inlineStyle, color: constants.colorGreen }}>{this.state.win}</div>
<div style={inlineStyle}> - </div>
<div style={{ ...inlineStyle, color: constants.colorRed }}>{this.state.lose}</div>
</div>
}
title={<Link to={`/players/${this.props.loggedInId}/matches?included_account_id=${this.props.playerId}`}>{strings.th_played_with}</Link>}
/>
</div>);
}
}
const mapStateToProps = state => ({
strings: state.app.strings,
});
export default connect(mapStateToProps)(PlayedWith);
| odota/web/src/components/Player/Header/PlayedWith.jsx/0 | {
"file_path": "odota/web/src/components/Player/Header/PlayedWith.jsx",
"repo_id": "odota",
"token_count": 768
} | 266 |
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { MMRGraph } from '../../../Visualizations';
import { getPlayerMmr } from '../../../../actions';
import Container from '../../../Container';
import Info from '../../../Alerts/Info';
const MMRInfo = strings => (
<Info>
<a href="https://blog.opendota.com/2016/01/13/opendota-mmr-and-you/" target="_blank" rel="noopener noreferrer">
{strings.mmr_not_up_to_date}
</a>
</Info>);
const MMR = ({
columns, error, loading, strings,
}) => (
<div>
<Container title={strings.heading_mmr} subtitle={MMRInfo(strings)} error={error} loading={loading}>
<MMRGraph columns={columns} />
</Container>
</div>
);
MMR.propTypes = {
columns: PropTypes.arrayOf({}),
error: PropTypes.string,
loading: PropTypes.bool,
strings: PropTypes.shape({}),
};
const getData = (props) => {
props.getPlayerMmr(props.playerId, props.location.search);
};
class RequestLayer extends React.Component {
static propTypes = {
location: PropTypes.shape({
key: PropTypes.string,
}),
playerId: PropTypes.string,
strings: PropTypes.shape({}),
}
componentDidMount() {
getData(this.props);
}
componentDidUpdate(prevProps) {
if (this.props.playerId !== prevProps.playerId || this.props.location.key !== prevProps.location.key) {
getData(this.props);
}
}
render() {
return <MMR {...this.props} />;
}
}
const mapStateToProps = state => ({
columns: state.app.playerMmr.data,
loading: state.app.playerMmr.loading,
error: state.app.playerMmr.error,
strings: state.app.strings,
});
export default connect(mapStateToProps, { getPlayerMmr })(RequestLayer);
| odota/web/src/components/Player/Pages/MMR/MMR.jsx/0 | {
"file_path": "odota/web/src/components/Player/Pages/MMR/MMR.jsx",
"repo_id": "odota",
"token_count": 639
} | 267 |
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { TrendGraph } from '../../../Visualizations';
import { getPlayerTrends } from '../../../../actions';
import ButtonGarden from '../../../ButtonGarden';
import trendNames from '../matchDataColumns';
import Heading from '../../../Heading';
import Container from '../../../Container';
const Trend = ({
routeParams, columns, playerId, error, loading, history, strings,
}) => {
const selectedTrend = routeParams.subInfo || trendNames[0];
return (
<div>
<Heading title={strings.trends_name} subtitle={strings.trends_description} />
<ButtonGarden
onClick={buttonName => history.push(`/players/${playerId}/trends/${buttonName}${window.location.search}`)}
buttonNames={trendNames}
selectedButton={selectedTrend}
/>
<Container
error={error}
loading={loading}
>
<TrendGraph
columns={columns}
name={selectedTrend}
onClick={(p) => {
const matchId = columns[p.index].match_id;
history.push(`/matches/${matchId}`);
}}
/>
</Container>
</div>
);
};
Trend.propTypes = {
routeParams: PropTypes.shape({}),
columns: PropTypes.arrayOf({}),
playerId: PropTypes.string,
error: PropTypes.string,
loading: PropTypes.bool,
history: PropTypes.shape({}),
strings: PropTypes.shape({}),
};
const getData = (props) => {
const trendName = props.routeParams.subInfo || trendNames[0];
props.getPlayerTrends(props.playerId, props.location.search, trendName);
};
class RequestLayer extends React.Component {
static propTypes = {
playerId: PropTypes.string,
location: PropTypes.shape({
key: PropTypes.string,
}),
strings: PropTypes.shape({}),
}
componentDidMount() {
getData(this.props);
}
componentDidUpdate(prevProps) {
if (this.props.playerId !== prevProps.playerId
|| this.props.location.key !== prevProps.location.key) {
getData(this.props);
}
}
render() {
return <Trend {...this.props} />;
}
}
const mapStateToProps = state => ({
columns: state.app.playerTrends.data,
loading: state.app.playerTrends.loading,
error: state.app.playerTrends.error,
strings: state.app.strings,
});
export default withRouter(connect(mapStateToProps, { getPlayerTrends })(RequestLayer));
| odota/web/src/components/Player/Pages/Trends/Trends.jsx/0 | {
"file_path": "odota/web/src/components/Player/Pages/Trends/Trends.jsx",
"repo_id": "odota",
"token_count": 931
} | 268 |
import React from 'react';
import MenuItem from 'material-ui/MenuItem';
import heroes from 'dotaconstants/build/heroes.json';
import { getTimeRange } from './ScenariosColumns';
import config from '../../config';
const items = (await import('dotaconstants/build/items.json')).default;
export default function getFormFieldData(metadata, strings) {
const {
teamScenariosQueryParams, itemCost, gameDurationBucket, timings,
} = metadata;
return {
heroList: Object.keys(heroes).map(id => ({
text: heroes[id] && heroes[id].localized_name,
value: (
<MenuItem
primaryText={heroes[id] && heroes[id].localized_name}
leftIcon={<img src={`${config.VITE_IMAGE_CDN}${heroes[id] && heroes[id].icon}`} alt="" />}
/>
),
altValue: id,
}))
.sort((a, b) => a.text && a.text.localeCompare(b.text)),
itemList: Object.keys(items).filter(item => items[item].cost >= itemCost && !item.startsWith('recipe_')).map(item => ({
text: items[item].dname,
value: (
<MenuItem
primaryText={items[item].dname}
leftIcon={<img src={`${config.VITE_IMAGE_CDN}${items[item].img}`} alt="" />}
/>
),
altValue: item,
}))
.sort((a, b) => a.text && a.text.localeCompare(b.text)),
laneRoleList: [1, 2, 3, 4].map(role => ({ text: strings[`lane_role_${role}`], value: role.toString() })),
miscList: teamScenariosQueryParams.map(scenario => ({ text: strings[`scenarios_${scenario}`], value: scenario })),
gameDurationList: gameDurationBucket.map(time => ({ text: getTimeRange(time, gameDurationBucket), value: time.toString() })),
timingList: timings.map(time => ({ text: getTimeRange(time, timings), value: time.toString() })),
};
}
| odota/web/src/components/Scenarios/FormFieldData.jsx/0 | {
"file_path": "odota/web/src/components/Scenarios/FormFieldData.jsx",
"repo_id": "odota",
"token_count": 709
} | 269 |
import React from 'react';
import ContentLoader from 'react-content-loader';
const PlayersSkeleton = props => (
<ContentLoader
primaryColor="#666"
secondaryColor="#ecebeb"
width={400}
animate
{...props}
>
<rect x="0" y="10" rx="5" ry="5" width="300" height="5" />
<rect x="0" y="25" rx="5" ry="5" width="300" height="5" />
<rect x="0" y="40" rx="5" ry="5" width="300" height="5" />
<rect x="0" y="55" rx="5" ry="5" width="300" height="5" />
<rect x="0" y="70" rx="5" ry="5" width="300" height="5" />
</ContentLoader>
);
export default PlayersSkeleton;
| odota/web/src/components/Skeletons/PlayersSkeleton.jsx/0 | {
"file_path": "odota/web/src/components/Skeletons/PlayersSkeleton.jsx",
"repo_id": "odota",
"token_count": 261
} | 270 |
import styled from 'styled-components';
import constants from '../constants';
export const StyledBody = styled.div`
table {
table-layout: auto !important;
font-family: ${constants.tableFontFamily} !important;
box-sizing: border-box;
${props => (props.customWidth ? `
table-layout: fixed !important;
`
: '')}
thead {
border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
& tr {
background: rgba(46, 160, 214, 0.26);
background: -moz-linear-gradient(90deg, rgba(20,255,212,0.09) 2%, rgba(46,160,214,0.26) 27%, rgba(5,181,249,0.04) 80%);
background: -webkit-linear-gradient(90deg, rgba(20,255,212,0.09) 2%, rgba(46,160,214,0.26) 27%, rgba(5,181,249,0.04) 80%);
background: linear-gradient(90deg, rgba(20,255,212,0.09) 2%, rgba(46,160,214,0.26) 27%, rgba(5,181,249,0.04) 80%);
/* Safari */
@media not all and (min-resolution:.001dpcm)
{ @supports (-webkit-appearance:none) {
background: rgba(46, 160, 214, 0.26);
}}
}
}
tr {
&:not(:last-child) {
border-bottom: 1px solid rgba(255, 255, 255, .05) !important;
}
}
& th {
position: relative;
svg {
position: absolute;
bottom: 0px;
left: 0px;
}
& svg {
vertical-align: top;
margin-left: 2px;
&:hover {
cursor: pointer;
}
}
& div[data-id='tooltip'] {
text-transform: none !important;
font-weight: var(--fontWeightNormal);
text-align: left;
}
}
& tbody tr {
& td {
border-bottom-width: 0px !important;
border-top-width: 0px !important;
& img, object {
opacity: 0.9;
}
}
}
& th,
& td {
overflow: visible !important;
&:first-child {
padding-left: 24px !important;
}
&:last-child {
padding-right: 24px !important;
}
}
}
/* Override material-ui style */
.innerContainer {
margin-bottom: 20px;
border: 1px solid rgba(255, 255, 255, .05);
border-radius: 3px;
}
.innerContainer {
overflow-y: hidden !important;
overflow-x: auto !important;
@media only screen and (min-width: 1200px) {
overflow-x: hidden !important;
}
}
.innerContainer.table-container-overflow-auto {
overflow-x: auto !important;
}
@media only screen and (max-width: 960px) {
}
${props => (props.hoverRowColumn ? `
& tr {
:hover {
background: rgba(190, 190, 140, 0.07) !important;
}
}
& td.col_highlight, th.col_highlight {
background: rgba(190, 190, 190, 0.07) !important;
color: ${constants.textColorPrimary} !important;
}
` : '')};
/* -- scrolling behavior -- */
.scrolled.shrink .textContainer {
width: 40px !important;
margin-right: 0px !important;
height: 32px !important;
}
.scrolled .textContainer span {
overflow: hidden !important;
white-space: nowrap !important;
text-overflow: ellipsis !important;
}
.scrolled .textContainer {
& .registered {
display: none !important;
}
& .badge {
display: none !important;
}
& .rank {
display: none !important;
}
& .contributor {
display: none !important;
}
}
.scrolled .guideContainer {
& .moremmr-icon {
display: none;
}
}
.scrolled .imageContainer {
& img {
margin-right: 4px;
height: 18px;
}
& .playerSlot {
display: none;
}
}
.scrolled th:first-child, .scrolled td:first-child {
position: sticky !important;
left: 0px !important;
}
.scrolled th:first-child {
background-color: rgba(33, 34, 44, 0.8) !important;
z-index: 100;
transition: background-color 0.5s ease-out !important;
width: 60px !important;
}
.scrolled tr {
&:nth-child(odd) {
& td:first-child {
background-color: rgba(33, 34, 44, 0.8) !important;
z-index: 100;
transition: background-color 0.5s ease-out !important;
padding-right: 0px !important;
width: 60px !important;
}
}
&:nth-child(even) {
& td:first-child {
background-color: rgba(33, 34, 44, 0.8) !important;
z-index: 100;
transition: background-color 0.5s ease-out !important;
padding-right: 0px !important;
width: 60px !important;
}
}
}
`;
export const StyledContainer = styled.div`
min-width: 100%;
clear: both;
`;
export const StyledHeaderCell = styled.div`
display: flex;
flex-direction: row;
justify-content: space-between;
text-align: center;
text-transform: uppercase;
color: ${constants.primaryTextColor} !important;
font-weight: 500;
`;
| odota/web/src/components/Table/Styled.jsx/0 | {
"file_path": "odota/web/src/components/Table/Styled.jsx",
"repo_id": "odota",
"token_count": 2196
} | 271 |
import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
import { connect } from 'react-redux';
import styled from 'styled-components';
import FlatButton from 'material-ui/FlatButton';
import { getOrdinal, getTeamLogoUrl, fromNow, subTextStyle } from '../../utility';
import { getTeams } from '../../actions';
import Heading from '../Heading';
import Team from '../Team';
import Table, { TableLink } from '../Table';
import { Logo } from '../Team/TeamStyled';
import config from '../../config';
const TeamImageContainer = styled.div`
display: flex;
align-items: center;
img {
margin-top: 7px;
margin-right: 7px;
margin-bottom: 7px;
margin-left: 0px;
width: 50px;
height: 50px;
object-fit: contain;
}
`;
const columns = strings => [{
displayName: strings.th_rank,
displayFn: (row, col, field, index) => getOrdinal(index + 1),
},
{
displayName: strings.th_name,
field: 'name',
displayFn: (row, col, field) => (
<TeamImageContainer>
<Logo
src={getTeamLogoUrl(row.logo_url)}
alt={`Official logo for ${field}`}
/>
<div>
<TableLink to={`/teams/${row.team_id}`}>{field}</TableLink>
<span style={{ ...subTextStyle, display: 'block', marginTop: 1 }}>
{fromNow(row.last_match_time)}
</span>
</div>
</TeamImageContainer>),
}, {
displayName: strings.th_rating,
field: 'rating',
sortFn: true,
relativeBars: true,
displayFn: (row, col, field) => Math.floor(field),
}, {
displayName: strings.th_wins,
field: 'wins',
sortFn: true,
relativeBars: true,
}, {
displayName: strings.th_losses,
field: 'losses',
sortFn: true,
relativeBars: true,
}];
class RequestLayer extends React.Component {
static propTypes = {
dispatchTeams: PropTypes.func,
data: PropTypes.arrayOf(PropTypes.object),
loading: PropTypes.bool,
match: PropTypes.shape({
params: PropTypes.shape({
teamId: PropTypes.string,
}),
}),
strings: PropTypes.shape({}),
}
componentDidMount() {
this.props.dispatchTeams();
}
render() {
const { strings } = this.props;
const route = this.props.match.params.teamId;
if (Number.isInteger(Number(route))) {
return <Team {...this.props} />;
}
const { loading } = this.props;
return (
<div>
<Helmet title={strings.header_teams} />
<div style={{ textAlign: 'center' }}>
{config.VITE_ENABLE_RIVALRY && <FlatButton
label={strings.app_rivalry}
icon={<img src="/assets/images/rivalry-icon.png" alt="" height="24px" />}
href="https://rivalry.com/opendota"
target="_blank"
rel="noopener noreferrer"
/>}
</div>
<Heading title={strings.heading_team_elo_rankings} subtitle={strings.subheading_team_elo_rankings} className="top-heading"/>
<Table columns={columns(strings)} data={this.props.data.slice(0, 100)} loading={loading} />
</div>);
}
}
const mapStateToProps = state => ({
data: state.app.teams.data.filter(team => team.last_match_time > ((new Date() / 1000) - (60 * 60 * 24 * 30 * 6))),
loading: state.app.teams.loading,
strings: state.app.strings,
});
const mapDispatchToProps = dispatch => ({
dispatchTeams: () => dispatch(getTeams()),
});
export default connect(mapStateToProps, mapDispatchToProps)(RequestLayer);
| odota/web/src/components/Teams/index.jsx/0 | {
"file_path": "odota/web/src/components/Teams/index.jsx",
"repo_id": "odota",
"token_count": 1380
} | 272 |
import React from 'react';
import PropTypes from 'prop-types';
import {
YAxis,
BarChart,
Bar,
Cell,
ReferenceLine,
Tooltip,
} from 'recharts';
import { StyledContainer, SparklineContainer } from './Styled';
import { StyledCustomizedTooltip } from '../../Visualizations/Graph/Styled';
import constants from '../../constants';
const CustomizedTooltip = ({ label, external, strings }) => (
<StyledCustomizedTooltip>
<div className="label">{label} - {label + 1}</div>
{external && external[label] && (
<div>
<div>
{strings.cs_this_minute}: {external[label].delta}
</div>
<div>
{strings.cumulative_cs}: {external[label].cumulative}
</div>
</div>)
}
</StyledCustomizedTooltip>
);
CustomizedTooltip.propTypes = {
label: PropTypes.number,
external: PropTypes.arrayOf(PropTypes.shape({})),
strings: PropTypes.shape({}),
};
const Sparkline = ({
values, altValues, strings,
}) => {
let lastValue = 0;
const data = (values || altValues).map((v) => {
const delta = v - lastValue;
lastValue = v;
return { delta, cumulative: v };
}).slice(1, 11);
return (
<StyledContainer>
<SparklineContainer>
<BarChart data={data} width={200} height={40} barCategoryGap={1}>
<YAxis hide domain={[0, 12]} />
<Tooltip content={<CustomizedTooltip strings={strings} external={data} />} />
<ReferenceLine y={6} stroke={constants.colorRed} strokeDasharray="3 3" />
<Bar dataKey="delta" barGap={0}>
{
data.map((entry, index) => (
<Cell key={`cell-${index}`} fill={entry.delta >= 6 ? constants.colorGreen : constants.colorRed} />
))
}
</Bar>
</BarChart>
</SparklineContainer>
</StyledContainer>
);
};
const {
instanceOf,
} = PropTypes;
Sparkline.propTypes = {
values: instanceOf(Array),
altValues: instanceOf(Array),
strings: PropTypes.shape({}),
};
Sparkline.tdStyle = {
paddingTop: 12,
paddingBottom: 12,
};
export default Sparkline;
| odota/web/src/components/Visualizations/Table/Sparkline.jsx/0 | {
"file_path": "odota/web/src/components/Visualizations/Table/Sparkline.jsx",
"repo_id": "odota",
"token_count": 861
} | 273 |
{
"yes": "sí",
"no": "no",
"abbr_thousand": "k",
"abbr_million": "m",
"abbr_billion": "b",
"abbr_trillion": "t",
"abbr_quadrillion": "q",
"abbr_not_available": "N/D",
"abbr_pick": "S",
"abbr_win": "V",
"abbr_number": "Núm.",
"analysis_eff": "Eficiencia en senda",
"analysis_farm_drought": "Menor GPM en un intervalo de 5 minutos",
"analysis_skillshot": "Skillshots acertados",
"analysis_late_courier": "Retraso en mejora del mensajero",
"analysis_wards": "Guardianes colocados",
"analysis_roshan": "Roshans asesinados",
"analysis_rune_control": "Runas obtenidas",
"analysis_unused_item": "Objetos activos no usados",
"analysis_expected": "de",
"announce_dismiss": "Descartar",
"announce_github_more": "Ver en Github",
"api_meta_description": "La API de OpenDota le da acceso a todas las estadísticas de Dota 2 avanzadas ofrecidas por la plataforma de OpenDota. Gráficos de rendimiento de acceso heatmaps, wordclouds y más. Comenzar gratis.",
"api_title": "OpenDota API",
"api_subtitle": "Construir sobre la plataforma de OpenDota. Llevar estadísticas avanzadas para su aplicación y análisis profundos a sus usuarios.",
"api_details_free_tier": "Prueba gratuita",
"api_details_premium_tier": "Plazo Premium",
"api_details_price": "Precio",
"api_details_price_free": "Gratis",
"api_details_price_prem": "$price por $unit llamadas",
"api_details_key_required": "¿Clave necesaria?",
"api_details_key_required_free": "No \t",
"api_details_key_required_prem": "Sí, requiere de pago",
"api_details_call_limit": "Límite de llamada",
"api_details_call_limit_free": "$limit por mes",
"api_details_call_limit_prem": "Sin límite",
"api_details_rate_limit": "Tasa límite",
"api_details_rate_limit_val": "$num llamadas por minuto",
"api_details_support": "Apoyo",
"api_details_support_free": "Apoyo de la comunidad a través de grupo de la discordia",
"api_details_support_prem": "Soporte prioritario de los desarrolladores del núcleo",
"api_get_key": "Obtener una clave",
"api_docs": "Leer los documentos",
"api_header_details": "Detalles",
"api_charging": "Está cargado $cost por llamada, redondeado al centavo más cercano.",
"api_credit_required": "La obtención de una clave de API requiere un método de pago vinculado. Automáticamente cargaremos a la tarjeta al principio del mes cualquier cargo adeudado.",
"api_failure": "500 errores no cuentan como uso, ya que eso significa que metimos la pata!",
"api_error": "Se ha producido un error con la solicitud. Por favor, inténtalo de nuevo. Si continúa, contáctenos en support@opendota.com.",
"api_login": "Iniciar sesión para acceder a la clave de API",
"api_update_billing": "Actualizar el método de pago",
"api_delete": "Borrar clave",
"api_key_usage": "Para usar su clave, agregue $param como parámetro de consulta a su solicitud de API:",
"api_billing_cycle": "El ciclo de facturación actual termina en $date.",
"api_billed_to": "Automáticamente te facturamos $brand terminando en $last4.",
"api_support": "¿Necesita ayuda? Correo electrónico $email.",
"api_header_usage": "Su uso",
"api_usage_calls": "Llamadas API",
"api_usage_fees": "Tiempo estimado",
"api_month": "Mes",
"api_header_key": "Tu llave",
"api_header_table": "Comenzar gratis. Seguir a un precio ridículamente bajo.",
"app_name": "OpenDota",
"app_language": "Idioma",
"app_localization": "Localización",
"app_description": "Plataforma de datos de código abierto de Dota 2",
"app_about": "Acerca de",
"app_privacy_terms": "Términos y privacidad",
"app_api_docs": "Documentación de la API",
"app_blog": "Blog",
"app_translate": "Traducir",
"app_donate": "Donar",
"app_gravitech": "Un sitio de Gravitech LLC",
"app_powered_by": "funciona con",
"app_donation_goal": "Meta de Donación Mensual",
"app_sponsorship": "Tu patrocinio ayuda a mantener el servicio gratis para todo el mundo.",
"app_twitter": "Seguir en Twitter",
"app_github": "Código fuente en GitHub",
"app_discord": "Chat en Discord",
"app_steam_profile": "Perfil de Steam",
"app_confirmed_as": "Confirmado como",
"app_untracked": "Este usuario no ha visitado la web recientemente, y sus repeticiones de nuevas partidas no serán analizadas automáticamente.",
"app_tracked": "Este usuario ha visitado la web recientemente, y sus repeticiones de nuevas partidas serán analizadas automáticamente.",
"app_cheese_bought": "Queso comprado",
"app_contributor": "Este usuario ha contribuido al desarollo del proyecto OpenDota",
"app_dotacoach": "Pregunta a un Entrenador",
"app_pvgna": "Encuentre una guía",
"app_pvgna_alt": "Encontrar una guía de Dota 2 en Pvgna",
"app_rivalry": "Apuesta por los partidos profesionales",
"app_rivalry_team": "Bet on {0} Matches",
"app_refresh": "Actualizar Historial de Partidas: Añade a la cola una búsqueda para encontrar partidas que faltan debido a la configuración de privacidad",
"app_refresh_label": "Actualizar",
"app_login": "Iniciar sesión",
"app_logout": "Cerrar sesión",
"app_results": "resultado(s)",
"app_report_bug": "Reportar un error",
"app_pro_players": "Jugadores profesionales",
"app_public_players": "Jugadores Públicos",
"app_my_profile": "Mi Perfil",
"barracks_value_1": "Cuerpo a cuerpo inferiores de Dire",
"barracks_value_2": "A distancia inferiores de Dire",
"barracks_value_4": "Cuerpo a cuerpo central de Dire",
"barracks_value_8": "A distancia central de Dire",
"barracks_value_16": "Cuerpo a cuerpo superior de Dire",
"barracks_value_32": "A distancia superior de Dire",
"barracks_value_64": "Cuerpo a cuerpo inferior de Radiant",
"barracks_value_128": "A distancia inferior de Radiant",
"barracks_value_256": "Cuerpo a cuerpo central de Radiant",
"barracks_value_512": "A distancia central de Radiant",
"barracks_value_1024": "Cuerpo a cuerpo superior de Radiant",
"barracks_value_2048": "A distancia superior de Radiant",
"benchmarks_description": "{0} {1} is equal or higher than {2}% of recent performances on this hero",
"fantasy_description": "{0} for {1} points",
"building_melee_rax": "Barracones de Cuerpo a Cuerpo",
"building_range_rax": "Barracones a Distancia",
"building_lasthit": "obtuviste el último golpe",
"building_damage": "daño recibido",
"building_hint": "Los iconos en el mapa tienen información adicional",
"building_denied": "denegado",
"building_ancient": "Ancient",
"CHAT_MESSAGE_TOWER_KILL": "Torre",
"CHAT_MESSAGE_BARRACKS_KILL": "Barracones",
"CHAT_MESSAGE_ROSHAN_KILL": "Roshan",
"CHAT_MESSAGE_AEGIS": "Se hizo con el Aegis",
"CHAT_MESSAGE_FIRSTBLOOD": "Primera sangre",
"CHAT_MESSAGE_TOWER_DENY": "Torre denegada",
"CHAT_MESSAGE_AEGIS_STOLEN": "Robó el Aegis",
"CHAT_MESSAGE_DENIED_AEGIS": "Denegó el Aegis",
"distributions_heading_ranks": "Distribución de niveles de rango",
"distributions_heading_mmr": "Distribución de MMR Individual",
"distributions_heading_country_mmr": "Media de MMR Individual por País",
"distributions_tab_ranks": "Niveles de Rango",
"distributions_tab_mmr": "MMR Individual",
"distributions_tab_country_mmr": "MMR Individual por País",
"distributions_warning_1": "Este conjunto de datos está limitado a jugadores que tienen expuesto su MMR en su perfil y comparten los datos de sus partidas de forma pública.",
"distributions_warning_2": "Los jugadores no tienen que registrarse, pero debido a que los datos provienen de los que deciden compartirlos explícitamente, las medias son probablemente más altas de lo esperado.",
"error": "Error",
"error_message": "¡Ups! Algo ha fallado.",
"error_four_oh_four_message": "La página que estás buscando no se ha encontrado.",
"explorer_title": "Explorador de datos",
"explorer_subtitle": "Estadísticas Profesionales de Dota 2",
"explorer_description": "Ejecutar consultas avanzadas en partidas profesionales (excluyendo ligas amateures)",
"explorer_schema": "Esquema",
"explorer_results": "Resultados",
"explorer_num_rows": "fila(s)",
"explorer_select": "Elegir",
"explorer_group_by": "Agrupar Por",
"explorer_hero": "Héroe",
"explorer_patch": "Parche",
"explorer_min_patch": "Patch Mínimo",
"explorer_max_patch": "Patch Máximo",
"explorer_min_mmr": "MMR Mínimo",
"explorer_max_mmr": "MMR Máximo",
"explorer_min_rank_tier": "Nivel Mínimo",
"explorer_max_rank_tier": "Nivel Máximo",
"explorer_player": "Jugador",
"explorer_league": "Liga",
"explorer_player_purchased": "Compra por el jugador",
"explorer_duration": "Duración",
"explorer_min_duration": "Duración mínima",
"explorer_max_duration": "Duración Máxima",
"explorer_timing": "Hora",
"explorer_uses": "Usos",
"explorer_kill": "Quemar tiempo",
"explorer_side": "Lado",
"explorer_toggle_sql": "Toggle SQL",
"explorer_team": "Equipo Actual",
"explorer_lane_role": "Senda",
"explorer_min_date": "Fecha Mínima",
"explorer_max_date": "Fecha Máxima",
"explorer_hero_combos": "Hero Combos",
"explorer_hero_player": "Héroe-Jugador",
"explorer_player_player": "Jugador-Jugador",
"explorer_sql": "SQL",
"explorer_postgresql_function": "Función de PostgreSQL",
"explorer_table": "Tabla",
"explorer_column": "Columna",
"explorer_query_button": "Table",
"explorer_cancel_button": "Cancelar",
"explorer_table_button": "Tabla",
"explorer_api_button": "API",
"explorer_json_button": "JSON",
"explorer_csv_button": "CSV",
"explorer_donut_button": "Dona",
"explorer_bar_button": "Barra",
"explorer_timeseries_button": "Serie Temporal",
"explorer_chart_unavailable": "Gráfico no disponible, intente usar GROUP BY",
"explorer_value": "Valor",
"explorer_category": "Categoría",
"explorer_region": "Región",
"explorer_picks_bans": "Picks/Bans",
"explorer_counter_picks_bans": "Contrapicks/Bans",
"explorer_organization": "Organización",
"explorer_order": "Orden",
"explorer_asc": "Ascendente",
"explorer_desc": "Descendente",
"explorer_tier": "Tier",
"explorer_having": "Al Menos Estas Muchas Partidas",
"explorer_limit": "Límite",
"explorer_match": "Partida",
"explorer_is_ti_team": "Es TI{number} equipo",
"explorer_mega_comeback": "Ganó contra Mega Creeps",
"explorer_max_gold_adv": "Ventaja Max Gold",
"explorer_min_gold_adv": "Ventaja Min Gold",
"farm_heroes": "Heroes asesinados",
"farm_creeps": "Creeps de linea asesinados",
"farm_neutrals": "Creeps neutrales asesinados (incluye Ancients)",
"farm_ancients": "Creeps ancestrales asesinados",
"farm_towers": "Torres destruidas",
"farm_couriers": "Mensajeros asesinados",
"farm_observers": "Observadores destruidos",
"farm_sentries": "Centinelas destruidos",
"farm_roshan": "Roshans derrotados",
"farm_necronomicon": "Unidades del Necronomicon asesinadas",
"filter_button_text_open": "Filtro",
"filter_button_text_close": "Cerrar",
"filter_hero_id": "Héroe",
"filter_is_radiant": "Lado",
"filter_win": "Resultado",
"filter_lane_role": "Senda",
"filter_patch": "Parche",
"filter_game_mode": "Modo de juego",
"filter_lobby_type": "Tipo de sala",
"filter_date": "Fecha",
"filter_region": "Región",
"filter_with_hero_id": "Héroes aliados",
"filter_against_hero_id": "Héroes enemigos",
"filter_included_account_id": "ID de Cuenta Incluida",
"filter_excluded_account_id": "ID de Cuenta Excluida",
"filter_significant": "Insignificante",
"filter_significant_include": "Incluir",
"filter_last_week": "La semana pasada",
"filter_last_month": "Último mes",
"filter_last_3_months": "Últimos 3 meses",
"filter_last_6_months": "Últimos 6 meses",
"filter_error": "Por favor, selecciona un item del menú",
"filter_party_size": "Tamaño del grupo",
"game_mode_0": "Desconocido",
"game_mode_1": "Elección libre",
"game_mode_2": "Modo capitán",
"game_mode_3": "Selección Aleatoria",
"game_mode_4": "Selección simple",
"game_mode_5": "Todos aleatorio",
"game_mode_6": "Introducción",
"game_mode_7": "Despertar Dire",
"game_mode_8": "Modo Capitán Reverso",
"game_mode_9": "La Greevilación",
"game_mode_10": "Tutorial",
"game_mode_11": "Solo medio",
"game_mode_12": "Menos Jugados",
"game_mode_13": "Selección Limitada",
"game_mode_14": "Compendio",
"game_mode_15": "Personalizado",
"game_mode_16": "Selección con Capitán",
"game_mode_17": "Selección Equilibrada",
"game_mode_18": "Selección de habilidades",
"game_mode_19": "Evento",
"game_mode_20": "All Random Deathmatch",
"game_mode_21": "1v1 Solo Medio",
"game_mode_22": "All Draft",
"game_mode_23": "Turbo",
"game_mode_24": "Mutación",
"general_unknown": "Desconocido",
"general_no_hero": "Ningún héroe",
"general_anonymous": "Anónimo",
"general_radiant": "Radiant",
"general_dire": "Dire",
"general_standard_deviation": "Desviación estándar",
"general_matches": "Partidas",
"general_league": "Liga",
"general_randomed": "Al azar",
"general_repicked": "Reelegir",
"general_predicted_victory": "Pronostico una victoria",
"general_show": "Show",
"general_hide": "Hide",
"gold_reasons_0": "Otros",
"gold_reasons_1": "Muerte",
"gold_reasons_2": "Buyback",
"NULL_gold_reasons_5": "Abandono",
"NULL_gold_reasons_6": "Vender",
"gold_reasons_11": "Edificio",
"gold_reasons_12": "Héroe",
"gold_reasons_13": "Creep",
"gold_reasons_14": "Roshan",
"NULL_gold_reasons_15": "Mensajero",
"header_request": "Solicitar",
"header_distributions": "Rangos",
"header_heroes": "Héroes",
"header_blog": "Blog",
"header_ingame": "En la partida",
"header_matches": "Partidas",
"header_records": "Récords",
"header_explorer": "Explorador",
"header_teams": "Equipos",
"header_meta": "Meta",
"header_scenarios": "Escenarios",
"header_api": "API",
"heading_lhten": "Últimos Golpes a los 10",
"heading_lhtwenty": "Últimos Golpes a los 20",
"heading_lhthirty": "Últimos Golpes a los 30",
"heading_lhforty": "Últimos Golpes a los 40",
"heading_lhfifty": "Últimos Golpes a los 50",
"heading_courier": "Mensajero",
"heading_roshan": "Roshan",
"heading_tower": "Torre",
"heading_barracks": "Barracones",
"heading_shrine": "Santuario",
"heading_item_purchased": "Objeto comprado",
"heading_ability_used": "Habilidad usada",
"heading_item_used": "Item usado",
"heading_damage_inflictor": "Daño infligido",
"heading_damage_inflictor_received": "Daño recebido",
"heading_damage_instances": "Instancias de daños",
"heading_camps_stacked": "Campamentos stackeados",
"heading_matches": "Partidas Recientes",
"heading_heroes": "Héroes Jugados",
"heading_mmr": "Historial de MMR",
"heading_peers": "Jugadores con los que has jugado",
"heading_pros": "Pros con los que has jugado",
"heading_rankings": "Rankings de héroes",
"heading_all_matches": "En todas las partidas",
"heading_parsed_matches": "En partidas analizadas",
"heading_records": "Récords",
"heading_teamfights": "Peleas de equipo",
"heading_graph_difference": "Ventaja Radiant",
"heading_graph_gold": "Oro",
"heading_graph_xp": "Experiencia",
"heading_graph_lh": "Últimos golpes",
"heading_overview": "Resumen",
"heading_ability_draft": "Habilidades Seleccionados",
"heading_buildings": "Mapa de edificios",
"heading_benchmarks": "Benchmarks",
"heading_laning": "Laning",
"heading_overall": "En general",
"heading_kills": "Asesinatos",
"heading_deaths": "Muertes",
"heading_assists": "Asistencias",
"heading_damage": "Daño",
"heading_unit_kills": "Asesinatos de Unidades",
"heading_last_hits": "Últimos golpes",
"heading_gold_reasons": "Fuentes de Oro",
"heading_xp_reasons": "Fuentes de XP",
"heading_performances": "Rendimientos",
"heading_support": "Apoyo",
"heading_purchase_log": "Registro de Compra",
"heading_casts": "Usos",
"heading_objective_damage": "Daño a objetivos",
"heading_runes": "Runas",
"heading_vision": "Visión",
"heading_actions": "Acciones",
"heading_analysis": "Análisis",
"heading_cosmetics": "Cosméticos",
"heading_log": "Registro",
"heading_chat": "Chat",
"heading_story": "Historia",
"heading_fantasy": "Fantasía",
"heading_wardmap": "Mapa de guardianes",
"heading_wordcloud": "Nube de palabras",
"heading_wordcloud_said": "Palabras dichas (chat global)",
"heading_wordcloud_read": "Palabras leídas (chat global)",
"heading_kda": "KLA",
"heading_gold_per_min": "Oro por minuto",
"heading_xp_per_min": "Experiencia por minuto",
"heading_denies": "Denegaciones",
"heading_lane_efficiency_pct": "EFF@10",
"heading_duration": "Duración",
"heading_level": "Nivel",
"heading_hero_damage": "Daño a Héroes",
"heading_tower_damage": "Daño a Torres",
"heading_hero_healing": "Curación a Héroes",
"heading_tower_kills": "Torres destruidas",
"heading_stuns": "Aturdimientos",
"heading_neutral_kills": "Creeps neutrales",
"heading_courier_kills": "Animales mensajeros asesinados",
"heading_purchase_tpscroll": "TPs comprados",
"heading_purchase_ward_observer": "Observadores comprados",
"heading_purchase_ward_sentry": "Centinelas comprados",
"heading_purchase_gem": "Gemas compradas",
"heading_purchase_rapier": "Estoques divinos comprados",
"heading_pings": "Pings en el mapa",
"heading_throw": "Victoria echada a perder",
"heading_comeback": "Remontada",
"heading_stomp": "Baño",
"heading_loss": "Derrota",
"heading_actions_per_min": "Acciones por minuto",
"heading_leaver_status": "Situación del abandonador",
"heading_game_mode": "Modo de juego",
"heading_lobby_type": "Tipo de sala",
"heading_lane_role": "Papel en la senda",
"heading_region": "Región",
"heading_patch": "Parche",
"heading_win_rate": "Porcentaje de victoria",
"heading_is_radiant": "Lado",
"heading_avg_and_max": "Promedios/Máximos",
"heading_total_matches": "Partidas Totales",
"heading_median": "Mediana",
"heading_distinct_heroes": "Distintos Heroes",
"heading_team_elo_rankings": "Rankings Elo del Equipo",
"heading_ability_build": "Build de Habilidades",
"heading_attack": "Ataque base",
"heading_attack_range": "Alcance de ataque",
"heading_attack_speed": "Velocidad de ataque",
"heading_projectile_speed": "Velocidad del proyectil",
"heading_base_health": "Salud",
"heading_base_health_regen": "Regeneración de salud",
"heading_base_mana": "Maná",
"heading_base_mana_regen": "Regeneración de maná",
"heading_base_armor": "Armadura base",
"heading_base_mr": "Resistencia a la magia",
"heading_move_speed": "Velocidad de movimiento",
"heading_turn_rate": "Velocidad de giro",
"heading_legs": "Número de piernas",
"heading_cm_enabled": "Disponible en MC",
"heading_current_players": "Jugadores actuales",
"heading_former_players": "Jugadores Anteriores",
"heading_damage_dealt": "Daños sufridos",
"heading_damage_received": "Daño Recibido",
"show_details": "Mostrar detalles",
"hide_details": "Ocultar detalles",
"subheading_avg_and_max": "in last {0} displayed matches",
"subheading_records": "En partidas clasificatorias. Récords se resetean mensualmente.",
"subheading_team_elo_rankings": "k = 32, init = 1000",
"hero_pro_tab": "Profesional",
"hero_public_tab": "Público",
"hero_pro_heading": "Héroes en partidas profesionales",
"hero_public_heading": "Héroes en partidas publicas (muestra)",
"hero_this_month": "partidas en los últimos 30 días",
"hero_pick_ban_rate": "P*B% profesional",
"hero_pick_rate": "Pick% rofesional",
"hero_ban_rate": "Ban% profesional",
"hero_win_rate": "Win% profesional",
"hero_5000_pick_rate": ">5000 P%",
"hero_5000_win_rate": ">5000 W%",
"hero_4000_pick_rate": "P% 4000",
"hero_4000_win_rate": "W% 4000",
"hero_3000_pick_rate": "P% 3000",
"hero_3000_win_rate": "W% 3000",
"hero_2000_pick_rate": "P% 2000",
"hero_2000_win_rate": "W% 2000",
"hero_1000_pick_rate": "<2000 P%",
"hero_1000_win_rate": "<2000 W%",
"home_login": "Iniciar sesión",
"home_login_desc": "para análisis automático de repeticiones",
"home_parse": "Solicitar",
"home_parse_desc": "una partida específica",
"home_why": "",
"home_opensource_title": "Código Abierto",
"home_opensource_desc": "Todo el proyecto es de código abierto y está disponible para ser modificado y mejorado por los contribuidores.",
"home_indepth_title": "Datos en profundidad",
"home_indepth_desc": "Analizar repeticiones proporciona datos de partidas altamente detallados.",
"home_free_title": "Gratis",
"home_free_desc": "Los servidores son financiados por patrocinadores y el código es mantenido por voluntarios, así que el servicio ofrecido es gratuito.",
"home_background_by": "Imagen de fondo por",
"home_sponsored_by": "Patrocinado por",
"home_become_sponsor": "Sé un Patrocinador",
"items_name": "Nombre del objeto",
"items_built": "Número de veces que este objeto se ha fabricado",
"items_matches": "Número de partidas donde este objeto se ha fabricado",
"items_uses": "Número de veces que este objeto se ha usado",
"items_uses_per_match": "Media de veces que este objeto se ha usado en partidas donde se ha fabricado",
"items_timing": "Media de tiempo que tarda en construir este objeto",
"items_build_pct": "Porcentaje de partidas donde este objeto se ha fabricado",
"items_win_pct": "Porcentaje de partidas ganadas donde este objeto se ha fabricado",
"lane_role_0": "Desconocido",
"lane_role_1": "Segura",
"lane_role_2": "Medio",
"lane_role_3": "Lateral",
"lane_role_4": "Jungla",
"lane_pos_1": "Bot",
"lane_pos_2": "Medio",
"lane_pos_3": "Top",
"lane_pos_4": "Jungla Radiant",
"lane_pos_5": "Jungla Dire",
"leaver_status_0": "Nignuno",
"leaver_status_1": "Abandonó de forma segura",
"leaver_status_2": "Abandono (desconectado)",
"leaver_status_3": "Abandonado",
"leaver_status_4": "Abandono (AFK)",
"leaver_status_5": "Nunca se conectó",
"leaver_status_6": "Nunca se conectó (tiempo de espera superado)",
"lobby_type_0": "Normal",
"lobby_type_1": "Práctica",
"lobby_type_2": "Torneo",
"lobby_type_3": "Tutorial",
"lobby_type_4": "Bots cooperativos",
"lobby_type_5": "MM de Equipo clasificatorio (Legacy)",
"lobby_type_6": "Individual clasificatorio (Legacy)",
"lobby_type_7": "Clasificatoria",
"lobby_type_8": "1 contra 1 en el medio",
"lobby_type_9": "Copa de Batalla",
"match_radiant_win": "Victoria Radiant",
"match_dire_win": "Victoria Dire",
"match_team_win": "Victoria",
"match_ended": "Finalizada",
"match_id": "ID de la Partida",
"match_region": "Región",
"match_avg_mmr": "Media de MMR",
"match_button_parse": "Analizar",
"match_button_reparse": "Volver a analizar",
"match_button_replay": "Repetición",
"match_button_video": "Obtener vídeo",
"match_first_tower": "Primera torre",
"match_first_barracks": "Primeros barracones",
"match_pick": "Elegir",
"match_ban": "Prohibir",
"matches_highest_mmr": "Superior Pública",
"matches_lowest_mmr": "Bajo MMR",
"meta_title": "Meta",
"meta_description": "Ejecutar consultas avanzadas de datos de encuentros públicos muestreados en anterior 24h",
"mmr_not_up_to_date": "¿Por qué el MMR no se a actualizado?",
"npc_dota_beastmaster_boar_#": "Jabalí",
"npc_dota_lesser_eidolon": "Eidolon Menor",
"npc_dota_eidolon": "Eidolon",
"npc_dota_greater_eidolon": "Gran Eidolon",
"npc_dota_dire_eidolon": "Eidolon Dire",
"npc_dota_invoker_forged_spirit": "Espíritu forjado",
"npc_dota_furion_treant_large": "Treant Superior",
"npc_dota_beastmaster_hawk_#": "Halcón",
"npc_dota_lycan_wolf#": "Lobo de Lycan",
"npc_dota_neutral_mud_golem_split_doom": "Fragmento de Doom",
"npc_dota_broodmother_spiderling": "Araña pequeña",
"npc_dota_broodmother_spiderite": "Arañita",
"npc_dota_furion_treant": "Ent",
"npc_dota_unit_undying_zombie": "Zombi",
"npc_dota_unit_undying_zombie_torso": "Zombi",
"npc_dota_brewmaster_earth_#": "Espíritu de Tierra",
"npc_dota_brewmaster_fire_#": "Espíritu de Fuego",
"npc_dota_lone_druid_bear#": "Espíritu Oso",
"npc_dota_brewmaster_storm_#": "Espíritu de la Tormenta",
"npc_dota_visage_familiar#": "Familiar",
"npc_dota_warlock_golem_#": "Golem de Warlock",
"npc_dota_warlock_golem_scepter_#": "Golem de Warlock",
"npc_dota_witch_doctor_death_ward": "Guardián de la muerte",
"npc_dota_tusk_frozen_sigil#": "Sello helado",
"npc_dota_juggernaut_healing_ward": "Guardián sanador",
"npc_dota_techies_land_mine": "Mina de Próximidad",
"npc_dota_shadow_shaman_ward_#": "Guardianes de Serpiente",
"npc_dota_pugna_nether_ward_#": "Guardián Abisal",
"npc_dota_venomancer_plague_ward_#": "Guardián de la Plaga",
"npc_dota_rattletrap_cog": "Engranajes Electrificados",
"npc_dota_templar_assassin_psionic_trap": "Trampa Psiónica",
"npc_dota_techies_remote_mine": "Mina remota",
"npc_dota_techies_stasis_trap": "Trampa Estática",
"npc_dota_phoenix_sun": "Supernova",
"npc_dota_unit_tombstone#": "Lápida",
"npc_dota_treant_eyes": "Ojos en el Bosque",
"npc_dota_gyrocopter_homing_missile": "Misil Buscador",
"npc_dota_weaver_swarm": "El Enjambre",
"objective_tower1_top": "T1",
"objective_tower1_mid": "M1",
"objective_tower1_bot": "B1",
"objective_tower2_top": "T2",
"objective_tower2_mid": "M2",
"objective_tower2_bot": "B2",
"objective_tower3_top": "T3",
"objective_tower3_mid": "M3",
"objective_tower3_bot": "B3",
"objective_rax_top": "RaxT",
"objective_rax_mid": "RaxM",
"objective_rax_bot": "RaxB",
"objective_tower4": "T4",
"objective_fort": "Anc",
"objective_shrine": "Sant",
"objective_roshan": "Rosh",
"tooltip_objective_tower1_top": "Daño realizado a la torre superior de nivel 1",
"tooltip_objective_tower1_mid": "Daño realizado a la torre central de nivel 1",
"tooltip_objective_tower1_bot": "Daño realizado a la torre inferior de nivel 1",
"tooltip_objective_tower2_top": "Daño realizado a la torre superior de nivel 2",
"tooltip_objective_tower2_mid": "Daño realizado a la torre central de nivel 2",
"tooltip_objective_tower2_bot": "Daño realizado a la torre inferior de nivel 2",
"tooltip_objective_tower3_top": "Daño realizado a la torre superior de nivel 3",
"tooltip_objective_tower3_mid": "Daño realizado a la torre central de nivel 3",
"tooltip_objective_tower3_bot": "Daño realizado a la torre inferior de nivel 3",
"tooltip_objective_rax_top": "Daño realizado al barracón superior",
"tooltip_objective_rax_mid": "Daño realizado al barracón central",
"tooltip_objective_rax_bot": "Daño realizado al barracón inferior",
"tooltip_objective_tower4": "Daño realizado a las torres centrales de nivel 4",
"tooltip_objective_fort": "Daño realizado a la fortaleza ancestral",
"tooltip_objective_shrine": "Daño realizado a los santuarios",
"tooltip_objective_roshan": "Daño realizado a Roshan",
"pagination_first": "Primero \t",
"pagination_last": "Último",
"pagination_of": "de",
"peers_none": "Este jugador no tiene iguales.",
"rank_tier_0": "Sin calibrar",
"rank_tier_1": "Heraldo",
"rank_tier_2": "Guardián",
"rank_tier_3": "Cruzado",
"rank_tier_4": "Archon",
"rank_tier_5": "Leyenda",
"rank_tier_6": "Ancient",
"rank_tier_7": "Divino",
"rank_tier_8": "Immortal",
"request_title": "Solicitar un análisis",
"request_match_id": "ID de la Partida",
"request_invalid_match_id": "Touch ID no válido",
"request_error": "Error al obtener datos de la partida",
"request_submit": "Enviar",
"roaming": "Merodeando",
"rune_0": "Doble Daño",
"rune_1": "Velocidad",
"rune_2": "Ilusión",
"rune_3": "Invisibilidad",
"rune_4": "Regeneración",
"rune_5": "Recompensa",
"rune_6": "Arcana",
"rune_7": "Agua",
"search_title": "Buscar por nombre de jugador, coincida con la ID...",
"skill_0": "Habilidad Desconocida",
"skill_1": "Habilidad Normal",
"skill_2": "Habilidad Alta",
"skill_3": "Habilidad Muy Alta",
"story_invalid_template": "(plantilla no valida)",
"story_error": "Un error ocurrió mientras se compilaba la historia de la partida",
"story_intro": "en {date} dos equipos decidieron jugar {game_mode_article} {game_mode} juego de Dota 2 en {region}. El pequeño detalle que no sabían, era que el juego duraría {duration_in_words}",
"story_invalid_hero": "Héroe no reconocido",
"story_fullstop": ".",
"story_list_2": "{1} y {2}",
"story_list_3": "{1}, {2}, y {3}",
"story_list_n": "{i}, {rest}",
"story_firstblood": "la primera sangre fue derramada cuando {killer} mato a {victim} en {time}",
"story_chatmessage": "\"{message}\", {player} {said_verb}",
"story_teamfight": "{winning_team} gano una teamfight tradeando {win_dead} por {lose_dead}, resultando en un incremento de net worth de {net_change}",
"story_teamfight_none_dead": "{winning_team} gano una teamfight matando a {lose_dead} sin perder ningun heroe, reusltando en un incremento de net worth increase de {net_change}",
"story_teamfight_none_dead_loss": "{winning_team} de algún modo ganó una pelea de equipo sin asesinar a nadie, perdió {win_dead}, resultando en un incremento de net worth de {net_change}",
"story_lane_intro": "A los 10 minutos dentro de la partida, las lineas fueron las siguientes:",
"story_lane_radiant_win": "{radiant_players} gano linea de {lane} en contra de {dire_players}",
"story_lane_radiant_lose": "{radiant_players} perdio linea de {lane} contra {dire_players}",
"story_lane_draw": "{radiant_players} empataron en {lane} línea con {dire_players}",
"story_lane_free": "{players} tuvo una linea gratis en {lane}",
"story_lane_empty": "no hubo nadie en la linea de {lane}",
"story_lane_jungle": "{players} farmeo la jungla",
"story_lane_roam": "{players} merodeó",
"story_roshan": "{team} mató a Roshan",
"story_aegis": "{player}{action} el aegis",
"story_gameover": "La partida termino en una {winning_team} victoria al {duration} con una puntuacion de {radiant_score} a {dire_score}",
"story_during_teamfight": "durante la pelea, {events}",
"story_after_teamfight": "despues de la pelea, {events}",
"story_expensive_item": "al {time}, {player} compro {item}, que fue el primer item en el juego con un precio mayor que {price_limit}",
"story_building_destroy": "{building} fue destruido",
"story_building_destroy_player": "{player} destruyo {building}",
"story_building_deny_player": "{player} denego {building}",
"story_building_list_destroy": "{building} fue destruido",
"story_courier_kill": "El mensajero de {team} fue asesinado",
"story_tower": "{team} Tier {tier} {lane} torre",
"story_tower_simple": "una de las torres de {team}",
"story_towers_n": "{n} torres de {team}",
"story_barracks": "{rax_type} de {lane} de {team}",
"story_barracks_both": "los dos de los Barracones de {lane} de {team}",
"story_time_marker": "A los {minutes} minutos",
"story_item_purchase": "{player} compró a {item} a los {time}",
"story_predicted_victory": "{players} predijo que {team} ganaría",
"story_predicted_victory_empty": "Nadie",
"story_networth_diff": "{percent}% / {gold} Diff",
"story_gold": "oro",
"story_chat_asked": "preguntó",
"story_chat_said": "dijo",
"tab_overview": "Resumen",
"tab_matches": "Partidas",
"tab_heroes": "Héroes",
"tab_peers": "Compañeros",
"tab_pros": "Pros",
"tab_activity": "Actividad",
"tab_records": "Récords",
"tab_totals": "Totales",
"tab_counts": "Cuentas",
"tab_histograms": "Histogramas",
"tab_trends": "Tendencias",
"tab_items": "Objetos",
"tab_wardmap": "Mapa de guardianes",
"tab_wordcloud": "Nube de palabras",
"tab_mmr": "MMR",
"tab_rankings": "Clasificaciones",
"tab_drafts": "Draft",
"tab_benchmarks": "Comparaciones",
"tab_performances": "Rendimientos",
"tab_damage": "Daño",
"tab_purchases": "Compras",
"tab_farm": "Farm",
"tab_combat": "Combate",
"tab_graphs": "Gráficas",
"tab_casts": "Usos",
"tab_vision": "Visión",
"tab_objectives": "Objetivos",
"tab_teamfights": "Peleas de equipo",
"tab_actions": "Acciones",
"tab_analysis": "Análisis",
"tab_cosmetics": "Objetos cosméticos",
"tab_log": "Registro",
"tab_chat": "Chat",
"tab_story": "Cuento",
"tab_fantasy": "Fantasía",
"tab_laning": "Laning",
"tab_recent": "Reciente",
"tab_matchups": "Emparejamiento",
"tab_durations": "Duraciones",
"tab_players": "Jugadores",
"placeholder_filter_heroes": "Filtrar héroes",
"td_win": "Victoria",
"td_loss": "Derrota",
"td_no_result": "Sin Resultado",
"th_hero_id": "Héroe",
"th_match_id": "ID",
"th_account_id": "Identifación de Cuenta",
"th_result": "Resultado",
"th_skill": "Habilidad",
"th_duration": "Duración",
"th_games": "MP",
"th_games_played": "Partidas",
"th_win": "% de Victorias",
"th_advantage": "Ventaja",
"th_with_games": "Con",
"th_with_win": "Victoria con %",
"th_against_games": "Contra",
"th_against_win": "Victoria contra %",
"th_gpm_with": "OPM Con",
"th_xpm_with": "EPM Con",
"th_avatar": "Jugador",
"th_last_played": "Último",
"th_record": "Récord",
"th_title": "Título",
"th_category": "Categoría",
"th_matches": "Partidas",
"th_percentile": "Percentil",
"th_rank": "Rango",
"th_items": "Objetos",
"th_stacked": "Campos stackeados",
"th_multikill": "Multiasesinato",
"th_killstreak": "Racha de asesinatos",
"th_stuns": "Stuns",
"th_dead": "Muerto",
"th_buybacks": "Reapariciones pagadas",
"th_biggest_hit": "Golpe más grande",
"th_lane": "Línea",
"th_map": "Mapa",
"th_lane_efficiency": "EFF@10",
"th_lhten": "UG@10",
"th_dnten": "DN@10",
"th_tpscroll": "TP",
"th_ward_observer": "Observador",
"th_ward_sentry": "Centinela",
"th_smoke_of_deceit": "Humo",
"th_dust": "Polvo",
"th_gem": "Gema",
"th_time": "Tiempo",
"th_message": "Mensaje",
"th_heroes": "Héroes",
"th_creeps": "Creeps",
"th_neutrals": "Neutrales",
"th_ancients": "Ancients",
"th_towers": "Torres",
"th_couriers": "Mensajeros",
"th_roshan": "Roshan",
"th_necronomicon": "Necronomicon",
"th_other": "Otros",
"th_cosmetics": "Objetos cosméticos",
"th_damage_received": "Recibido",
"th_damage_dealt": "Provocado",
"th_players": "Jugadores",
"th_analysis": "Análisis",
"th_death": "Muerte",
"th_damage": "Daño",
"th_healing": "Curación",
"th_gold": "O",
"th_xp": "XP",
"th_abilities": "Habilidades",
"th_target_abilities": "Objetivos de Habilidades",
"th_mmr": "MMR",
"th_level": "NVL",
"th_kills": "K",
"th_kills_per_min": "KPM",
"th_deaths": "M",
"th_assists": "A",
"th_last_hits": "UG",
"th_last_hits_per_min": "UGM",
"th_denies": "DN",
"th_gold_per_min": "OPM",
"th_xp_per_min": "EPM",
"th_stuns_per_min": "SPM",
"th_hero_damage": "DH",
"th_hero_damage_per_min": "DHM",
"th_hero_healing": "CH",
"th_hero_healing_per_min": "CHM",
"th_tower_damage": "DT",
"th_tower_damage_per_min": "DTM",
"th_kda": "KMA",
"th_actions_per_min": "APM",
"th_pings": "PNG (M)",
"th_DOTA_UNIT_ORDER_MOVE_TO_POSITION": "MV (P)",
"th_DOTA_UNIT_ORDER_MOVE_TO_TARGET": "MV (T)",
"th_DOTA_UNIT_ORDER_ATTACK_TARGET": "ATK (T)",
"th_DOTA_UNIT_ORDER_ATTACK_MOVE": "ATK (P)",
"th_DOTA_UNIT_ORDER_CAST_POSITION": "CST (P)",
"th_DOTA_UNIT_ORDER_CAST_TARGET": "CST (T)",
"th_DOTA_UNIT_ORDER_CAST_NO_TARGET": "CST (N)",
"th_DOTA_UNIT_ORDER_HOLD_POSITION": "HLD",
"th_DOTA_UNIT_ORDER_GLYPH": "GLIFO",
"th_DOTA_UNIT_ORDER_RADAR": "SCN",
"th_ability_builds": "AB",
"th_purchase_shorthand": "COM",
"th_use_shorthand": "USAR",
"th_duration_shorthand": "DUR",
"th_country": "País",
"th_count": "Cuenta",
"th_sum": "Suma",
"th_average": "Media",
"th_name": "Nombre",
"th_team_name": "Nombre del equipo",
"th_score": "Puntuación",
"th_casts": "Hechizos",
"th_hits": "Golpes",
"th_wins": "Victorias",
"th_losses": "Derrotas",
"th_winrate": "Porcentaje de Victorias",
"th_solo_mmr": "MMR Individual",
"th_party_mmr": "MMR de Grupo",
"th_estimated_mmr": "MMR Estimado",
"th_permanent_buffs": "Buffs",
"th_winner": "Ganador",
"th_played_with": "Mi récord con",
"th_obs_placed": "Guardianes Observadores Colocados",
"th_sen_placed": "Guardianes Centinelas Colocados",
"th_obs_destroyed": "Guardianes Observadores Destruidos",
"th_sen_destroyed": "Guardianes Centinelas Destruidos",
"th_scans_used": "Escaneares usados",
"th_glyphs_used": "Glifos Usados",
"th_legs": "Piernas",
"th_fantasy_points": "Pts de Fantasía",
"th_rating": "Calificación",
"th_teamfight_participation": "Participación",
"th_firstblood_claimed": "Primera sangre",
"th_observers_placed": "Observadores",
"th_camps_stacked": "Stacks",
"th_league": "Liga",
"th_attack_type": "Tipo de Ataque",
"th_primary_attr": "Atributo Primario",
"th_opposing_team": "Equipo Opuesto",
"ward_log_type": "Tipo",
"ward_log_owner": "Dueño",
"ward_log_entered_at": "Colocado",
"ward_log_left_at": "Restantes",
"ward_log_duration": "Esperanza de vida",
"ward_log_killed_by": "Asesinado por",
"log_detail": "Detalle",
"log_heroes": "Héroe especifico",
"tier_professional": "Profesional",
"tier_premium": "Premium",
"time_past": "Hace {0}",
"time_just_now": "justo ahora",
"time_s": "un segundo",
"time_abbr_s": "{0}s",
"time_ss": "{0} segundos",
"time_abbr_ss": "{0}s",
"time_m": "un minuto",
"time_abbr_m": "{0}m",
"time_mm": "{0} minutos",
"time_abbr_mm": "{0}m",
"time_h": "una hora",
"time_abbr_h": "{0}h",
"time_hh": "{0} horas",
"time_abbr_hh": "{0}h",
"time_d": "un día",
"time_abbr_d": "{0}d",
"time_dd": "{0} días",
"time_abbr_dd": "{0}d",
"time_M": "un mes",
"time_abbr_M": "{0}m",
"time_MM": "{0} meses",
"time_abbr_MM": "{0}m",
"time_y": "un año",
"time_abbr_y": "{0}a",
"time_yy": "{0} años",
"time_abbr_yy": "{0}a",
"timeline_firstblood": "derramó la primera sangre",
"timeline_firstblood_key": "derramó la primera sangre al matar a",
"timeline_aegis_picked_up": "recogido",
"timeline_aegis_snatched": "robado",
"timeline_aegis_denied": "denegado",
"timeline_teamfight_deaths": "Muertes",
"timeline_teamfight_gold_delta": "oro delta",
"title_default": "OpenDota - Estadísticas de Dota 2",
"title_template": "%s - OpenDota - Estadísticas de Dota 2",
"title_matches": "Partidas",
"title_request": "Solicitar un análisis",
"title_search": "Buscar",
"title_status": "Estatus",
"title_explorer": "Explorador de datos",
"title_meta": "Meta",
"title_records": "Récords",
"title_api": "La Opendota API: Avanzada estadísticas de Dota 2 para su aplicación",
"tooltip_mmr": "MMR Individual del jugador",
"tooltip_abilitydraft": "Seleccionado en Draft",
"tooltip_level": "Nivel alcanzado por héroe",
"tooltip_kills": "Número de asesinatos por héroe",
"tooltip_deaths": "Número de muertes por héroe",
"tooltip_assists": "Número de asistencias por héroe",
"tooltip_last_hits": "Número de últimos golpes por héroe",
"tooltip_denies": "Número de creeps denegados",
"tooltip_gold": "Total de oro farmeado",
"tooltip_gold_per_min": "Oro farmeado por minuto",
"tooltip_xp_per_min": "Experiencia ganada por minuto",
"tooltip_stuns_per_min": "Segundos de héroe aturdimientos por minuto",
"tooltip_last_hits_per_min": "Últimos golpes por minuto",
"tooltip_kills_per_min": "Asesinatos por minuto",
"tooltip_hero_damage_per_min": "Daño a héroes por minuto",
"tooltip_hero_healing_per_min": "Curacion a héroes por minuto",
"tooltip_tower_damage_per_min": "Daño a torres por minuto",
"tooltip_actions_per_min": "Acciones realizadas por minuto",
"tooltip_hero_damage": "Cantidad de daño héreoes",
"tooltip_tower_damage": "Cantidad de daño torres",
"tooltip_hero_healing": "Cantidad de vida restaurada a héroes",
"tooltip_duration": "Duración de la partida",
"tooltip_first_blood_time": "El tiempo en el que se produjo la primera sangre",
"tooltip_kda": "(Asesinatos + Asistencias) / (Muertes + 1)",
"tooltip_stuns": "Segundos de disable en héroes",
"tooltip_dead": "Tiempo muerto",
"tooltip_buybacks": "Número de buybacks",
"tooltip_camps_stacked": "Campamentos stackeados",
"tooltip_tower_kills": "Número de torres destruidas",
"tooltip_neutral_kills": "Número de creeps neutrales asesinados",
"tooltip_courier_kills": "Número de mensajeros asesinados",
"tooltip_purchase_tpscroll": "Pergaminos de Teletransporte comprados",
"tooltip_purchase_ward_observer": "Guardianes Observadores comprados",
"tooltip_purchase_ward_sentry": "Guardianes Centinelas comprados",
"tooltip_purchase_smoke_of_deceit": "Humos del Engaño comprados",
"tooltip_purchase_dust": "Polvos de la Revelación comprados",
"tooltip_purchase_gem": "Gemas de Visión Verdadera compradas",
"tooltip_purchase_rapier": "Estoques Divinos comprados",
"tooltip_purchase_buyback": "Buybacks comprados",
"tooltip_duration_observer": "Promedio de Vida de Guardianes Observadores",
"tooltip_duration_sentry": "Promedio de Vida de Guardianes Centinelas",
"tooltip_used_ward_observer": "Número de Guardianes Observadores colocados durante la partida",
"tooltip_used_ward_sentry": "Número de Guardianes Centinelas colocados durante la partida",
"tooltip_used_dust": "Número de veces que Polvo de la Aparición fue utilizado durante la partida",
"tooltip_used_smoke_of_deceit": "Número de veces que Humo del Engaño fue utilizado durante la partida",
"tooltip_parsed": "La repetición se ha analizado para obtener datos adicionales",
"tooltip_unparsed": "La repetición de esta partida no se ha analizado aún. No todos los datos están disponibles.",
"tooltip_hero_id": "The hero played",
"tooltip_result": "Si el jugador ganó o perdió",
"tooltip_match_id": "El ID de la partida",
"tooltip_game_mode": "El modo de juego de la partida",
"tooltip_skill": "Los límites de MMR aproximados para las divisiones son 0, 3200 y 3700",
"tooltip_ended": "El tiempo cuando la partida terminó",
"tooltip_pick_order": "Orden en el que el jugador ha elegido",
"tooltip_throw": "Ventaja de oro máxima en una partida perdida",
"tooltip_comeback": "Desventaja de oro máxima en una partida ganada",
"tooltip_stomp": "Ventaja de oro máxima en una partida ganada",
"tooltip_loss": "Desventaja de oro máxima en una partida perdida",
"tooltip_items": "Objetos fabricados",
"tooltip_permanent_buffs": "Permanent buffs such as Flesh Heap stacks or Tomes of Knowledge used",
"tooltip_lane": "Línea basada en la posición en early game",
"tooltip_map": "Mapa de calor de la posición del jugador en el early game",
"tooltip_lane_efficiency": "Porcentaje de oro de línea (creeps+pasivo+inicial) obtenido en los primeros 10 minutos",
"tooltip_lane_efficiency_pct": "Porcentaje de oro de línea (creeps + pasivo + inicio) obtenido a los 10 minutos",
"tooltip_pings": "Número de veces que el jugador hizo ping en el mapa",
"tooltip_DOTA_UNIT_ORDER_MOVE_TO_POSITION": "Número de veces que el jugador se movió a una posición",
"tooltip_DOTA_UNIT_ORDER_MOVE_TO_TARGET": "Número de veces que el jugador se movió a un objetivo",
"tooltip_DOTA_UNIT_ORDER_ATTACK_MOVE": "Número de veces que el jugador atacó a una posición (attack move)",
"tooltip_DOTA_UNIT_ORDER_ATTACK_TARGET": "Número de veces que el jugador atacó a un objetivo",
"tooltip_DOTA_UNIT_ORDER_CAST_POSITION": "Número de veces que el jugador casteó en una posición",
"tooltip_DOTA_UNIT_ORDER_CAST_TARGET": "Número de veces que el jugador casteó en un objetivo",
"tooltip_DOTA_UNIT_ORDER_CAST_NO_TARGET": "Número de veces que el jugador casteó en ningún objetivo",
"tooltip_DOTA_UNIT_ORDER_HOLD_POSITION": "Número de veces que el jugador mantuvo la posición",
"tooltip_DOTA_UNIT_ORDER_GLYPH": "Número de veces que el jugador usó el glifo",
"tooltip_DOTA_UNIT_ORDER_RADAR": "Número de veces que el jugador usó escanear",
"tooltip_last_played": "La última vez que se jugó una partida con este jugador/héroe",
"tooltip_matches": "Partidas jugadas con/contra este jugador",
"tooltip_played_as": "Número de partidas jugadas con este héroe",
"tooltip_played_with": "Número de partidas jugadas con este héroe/jugador en el equipo",
"tooltip_played_against": "Número de partidas jugadas con este jugador/héroe en el equipo enemigo",
"tooltip_tombstone_victim": "Aquí se encuentra",
"tooltip_tombstone_killer": "asesinado por",
"tooltip_win_pct_as": "Porcentaje de victorias con este héroe",
"tooltip_win_pct_with": "Porcentaje de victorias con este jugador/héroe",
"tooltip_win_pct_against": "Porcentaje de victorias contra este jugador/héroe",
"tooltip_lhten": "Últimos golpes a los 10 minutos",
"tooltip_dnten": "Denegaciones a los 10 minutos",
"tooltip_biggest_hit": "Mayor daño infligido a un héroe",
"tooltip_damage_dealt": "Daño causado a héroes por objetos/habilidades",
"tooltip_damage_received": "Daño recibido de héroes por objetos/habilidades",
"tooltip_registered_user": "Usuario registrado",
"tooltip_ability_builds": "Builds de habilidades",
"tooltip_ability_builds_expired": "Los datos de las mejoras de habilidades han expirado para esta partida. Utiliza el formulario de solicitud para recargar los datos.",
"tooltip_multikill": "Multi-kill más larga",
"tooltip_killstreak": "Racha de muertes más larga",
"tooltip_casts": "Número de veces que esta habilidad/objeto fue casteado",
"tooltip_target_abilities": "Cuantas veces cada héroe fue enfocado por las habilidades de este héroe",
"tooltip_hits": "Número de instancias de daño a héroes causados por esta habilidad/objeto",
"tooltip_damage": "Cantidad de daño infligido a héroes por esta habilidad/objeto",
"tooltip_autoattack_other": "Auto Ataque/Otro",
"tooltip_estimated_mmr": "MMR estimado basado en la media de MMR visible de las últimas partidas jugadas por este usuario",
"tooltip_backpack": "Mochila",
"tooltip_others_tracked_deaths": "muertes por Track",
"tooltip_others_track_gold": "oro obtenido por Track",
"tooltip_others_greevils_gold": "oro ganado de Avaricia de Greevil",
"tooltip_advantage": "Calculado por califacación de Wilson",
"tooltip_winrate_samplesize": "Ganar velocidad y muestra el tamaño de",
"tooltip_teamfight_participation": "Amount of participation in teamfights",
"histograms_name": "Histogramas",
"histograms_description": "Porcentajes indican tasas de victoria para la gama rotulada",
"histograms_actions_per_min_description": "Acciones realizadas por minuto",
"histograms_comeback_description": "Máxima desventaja de oro en una partida ganada",
"histograms_lane_efficiency_pct_description": "Porcentaje de oro de línea (creeps + pasivo + inicio) obtenido a los 10 minutos",
"histograms_gold_per_min_description": "Oro farmeado por minuto",
"histograms_hero_damage_description": "Cantidad de daño héreoes",
"histograms_hero_healing_description": "Cantidad de vida restaurada a héroes",
"histograms_level_description": "Nivel alcanzado en un juego",
"histograms_loss_description": "Desventaja de oro máxima en una partida perdida",
"histograms_pings_description": "Número de veces que el jugador hizo ping en el mapa",
"histograms_stomp_description": "Ventaja de oro máxima en una partida ganada",
"histograms_stuns_description": "Segundos de disable en héroes",
"histograms_throw_description": "Ventaja de oro máxima en una partida perdida",
"histograms_purchase_tpscroll_description": "Pergaminos de Teletransporte comprados",
"histograms_xp_per_min_description": "Experiencia ganada por minuto",
"trends_name": "Tendencias",
"trends_description": "Cumulative average over last 500 games",
"trends_tooltip_average": "Prom.",
"trends_no_data": "Lo sentimos, no hay datos para esta gráfica",
"xp_reasons_0": "Otros",
"xp_reasons_1": "Héroe",
"xp_reasons_2": "Creep",
"xp_reasons_3": "Roshan",
"rankings_description": "",
"rankings_none": "Este jugador no está clasificado en ningún héroe.",
"region_0": "Automática",
"region_1": "EE. UU. Oeste",
"region_2": "EE. UU. Este",
"region_3": "Luxemburgo",
"region_5": "Singapur",
"region_6": "Dubái",
"region_7": "Australia",
"region_8": "Estocolmo",
"region_9": "Austria",
"region_10": "Brasil",
"region_11": "Sudáfrica",
"region_12": "China TC Shanghái",
"region_13": "China UC",
"region_14": "Chile",
"region_15": "Perú",
"region_16": "India",
"region_17": "China TC Cantón",
"region_18": "China Zhejiang TC",
"region_19": "Japón",
"region_20": "China Wuhan TC",
"region_25": "China UC 2",
"vision_expired": "Expira después de",
"vision_destroyed": "Destruido después de",
"vision_all_time": "Todo el rato",
"vision_placed_observer": "colocó un Guardián Observador en",
"vision_placed_sentry": "colocó un Guardián Centinela en",
"vision_ward_log": "Registro de Wards",
"chat_category_faction": "Facción",
"chat_category_type": "Tipo",
"chat_category_target": "Objetivo",
"chat_category_other": "Otros",
"chat_filter_text": "Texto",
"chat_filter_phrases": "Frases",
"chat_filter_audio": "Audio",
"chat_filter_spam": "Spam",
"chat_filter_all": "Todos",
"chat_filter_allies": "Aliados",
"chat_filter_spectator": "Espectador",
"chat_filtered": "Filtrado",
"advb_almost": "casi",
"advb_over": "encima",
"advb_about": "acerca de",
"article_before_consonant_sound": "un",
"article_before_vowel_sound": "un",
"statement_long": "conjeturó",
"statement_shouted": "gritó",
"statement_excited": "exclamó",
"statement_normal": "dijo",
"statement_laughed": "rió",
"question_long": "elevó, necesitando respuestas",
"question_shouted": "inquirió",
"question_excited": "interregó",
"question_normal": "preguntó",
"question_laughed": "rió burlonamente",
"statement_response_long": "aconsejó",
"statement_response_shouted": "respondió con frustración",
"statement_response_excited": "exclamó",
"statement_response_normal": "contestó",
"statement_response_laughed": "rió",
"statement_continued_long": "despotricó",
"statement_continued_shouted": "continuó con furia",
"statement_continued_excited": "continuó",
"statement_continued_normal": "agregó",
"statement_continued_laughed": "continuó",
"question_response_long": "aconsejó",
"question_response_shouted": "preguntó en respuesta, de frustración",
"question_response_excited": "disputó",
"question_response_normal": "argumentó",
"question_response_laughed": "rió",
"question_continued_long": "propuso",
"question_continued_shouted": "preguntó con furia",
"question_continued_excited": "preguntó con amor",
"question_continued_normal": "preguntó",
"question_continued_laughed": "preguntó con alegría",
"hero_disclaimer_pro": "Data de partidas profesionales",
"hero_disclaimer_public": "Data de partidas públicas",
"hero_duration_x_axis": "Minutos",
"top_tower": "Torre de Top",
"bot_tower": "Torre de Bottom",
"mid_tower": "Torre de Mid",
"top_rax": "Barracks de Top",
"bot_rax": "Barracones de Bottom",
"mid_rax": "Barracones de Mid",
"tier1": "Tier 1",
"tier2": "Tier 2",
"tier3": "Tier 3",
"tier4": "Tier 4",
"show_consumables_items": "Ver consumibles",
"activated": "Activado",
"rune": "Runa",
"placement": "Ubicación",
"exclude_turbo_matches": "Excluir partidas Turbo",
"scenarios_subtitle": "Explorar las tasas de ganancia de las combinaciones de factores que ocurren en los partidos",
"scenarios_info": "Datos recopilados de partidas en las últimas {0} semanas",
"scenarios_item_timings": "Tiempo de los ítems",
"scenarios_misc": "Misceláneo",
"scenarios_time": "Tiempo",
"scenarios_item": "Ítem",
"scenarios_game_duration": "Duración del juego",
"scenarios_scenario": "Escenario",
"scenarios_first_blood": "El equipo sacó a First Blood",
"scenarios_courier_kill": "El equipo disparó al mensajero enemigo antes de los 3 minutos",
"scenarios_pos_chat_1min": "Todos los miembros del equipo charlaron palabras positivas antes de la marca de 1 minuto",
"scenarios_neg_chat_1min": "Todos los miembros del equipo charlaron palabras positivas antes de la marca de 1 minuto",
"gosu_default": "Recomendación personal",
"gosu_benchmarks": "Obtenga información detallada sobre rendimiento para su héroe, senda y papel",
"gosu_performances": "Obtenga el rendimiento de su control de mapas",
"gosu_laning": "Descubre por qué te perdiste los últimos éxitos",
"gosu_combat": "Descubra por qué los intentos de matar no tuvieron éxito",
"gosu_farm": "Descubre por qué te perdiste los últimos éxitos",
"gosu_vision": "Averigua cuántos héroes murieron bajo tu protección",
"gosu_actions": "Obtenga el tiempo perdido por el uso del mouse frente a las teclas de acceso directo",
"gosu_teamfights": "Consigue a quién apuntar durante las peleas en equipo",
"gosu_analysis": "Obtenga su soporte MMR real",
"back2Top": "Back to Top",
"activity_subtitle": "Click on a day for detailed information"
} | odota/web/src/lang/es-ES.json/0 | {
"file_path": "odota/web/src/lang/es-ES.json",
"repo_id": "odota",
"token_count": 21511
} | 274 |
import { createSelector } from 'reselect';
/**
* Get Hero from heroes by heroId
* @param {Array<Object>} heroes Array of heroes
* @param {string|number} heroId
*/
export const heroSelector = (heroes, heroId) =>
heroes.find(hero => String(hero.id) === String(heroId));
/**
* Return ProPlayer map, where key account_id
* @param {Object} state Redux state
*/
export const proPlayersSelector = createSelector(
state => state.app.proPlayers.data,
data => data.reduce((summary, item) => ({ ...summary, [item.account_id]: { ...item } }), {}),
);
export default {
heroSelector,
proPlayersSelector,
};
| odota/web/src/reducers/selectors.js/0 | {
"file_path": "odota/web/src/reducers/selectors.js",
"repo_id": "odota",
"token_count": 193
} | 275 |
{
"leaver_status": {
"0": {
"games": 5780,
"win": 3681
},
"1": {
"games": 227,
"win": 58
},
"2": {
"games": 1,
"win": 0
},
"3": {
"games": 62,
"win": 7
},
"4": {
"games": 5,
"win": 1
}
},
"game_mode": {
"0": {
"games": 36,
"win": 17
},
"1": {
"games": 2124,
"win": 1430
},
"2": {
"games": 1890,
"win": 1144
},
"3": {
"games": 1430,
"win": 792
},
"4": {
"games": 7,
"win": 6
},
"16": {
"games": 10,
"win": 5
},
"22": {
"games": 578,
"win": 353
}
},
"lobby_type": {
"0": {
"games": 1893,
"win": 1317
},
"1": {
"games": 1889,
"win": 1136
},
"2": {
"games": 30,
"win": 20
},
"7": {
"games": 2244,
"win": 1257
},
"9": {
"games": 19,
"win": 17
}
},
"lane_role": {
"0": {
"games": 4403,
"win": 2789
},
"1": {
"games": 502,
"win": 289
},
"2": {
"games": 504,
"win": 281
},
"3": {
"games": 564,
"win": 329
},
"4": {
"games": 102,
"win": 59
}
},
"region": {
"0": {
"games": 497,
"win": 342
},
"1": {
"games": 210,
"win": 119
},
"2": {
"games": 55,
"win": 30
},
"3": {
"games": 158,
"win": 88
},
"5": {
"games": 778,
"win": 485
},
"6": {
"games": 4,
"win": 3
},
"8": {
"games": 32,
"win": 23
},
"9": {
"games": 7,
"win": 5
},
"12": {
"games": 2436,
"win": 1397
},
"13": {
"games": 24,
"win": 12
},
"17": {
"games": 167,
"win": 109
},
"18": {
"games": 1454,
"win": 982
},
"20": {
"games": 252,
"win": 152
},
"25": {
"games": 1,
"win": 0
}
},
"patch": {
"4": {
"games": 29,
"win": 14
},
"5": {
"games": 6,
"win": 2
},
"6": {
"games": 207,
"win": 134
},
"7": {
"games": 546,
"win": 347
},
"8": {
"games": 509,
"win": 376
},
"9": {
"games": 106,
"win": 67
},
"10": {
"games": 264,
"win": 168
},
"11": {
"games": 395,
"win": 240
},
"12": {
"games": 182,
"win": 119
},
"13": {
"games": 400,
"win": 285
},
"14": {
"games": 246,
"win": 155
},
"15": {
"games": 263,
"win": 155
},
"16": {
"games": 397,
"win": 233
},
"17": {
"games": 212,
"win": 117
},
"18": {
"games": 659,
"win": 409
},
"19": {
"games": 47,
"win": 23
},
"20": {
"games": 107,
"win": 65
},
"21": {
"games": 104,
"win": 63
},
"22": {
"games": 55,
"win": 29
},
"23": {
"games": 92,
"win": 45
},
"24": {
"games": 70,
"win": 33
},
"25": {
"games": 304,
"win": 158
},
"26": {
"games": 243,
"win": 132
},
"27": {
"games": 41,
"win": 26
},
"28": {
"games": 13,
"win": 6
},
"29": {
"games": 51,
"win": 25
},
"30": {
"games": 62,
"win": 40
},
"31": {
"games": 73,
"win": 43
},
"32": {
"games": 59,
"win": 36
},
"33": {
"games": 60,
"win": 38
},
"34": {
"games": 19,
"win": 14
},
"35": {
"games": 25,
"win": 16
},
"36": {
"games": 19,
"win": 9
},
"37": {
"games": 131,
"win": 69
},
"38": {
"games": 79,
"win": 56
}
},
"is_radiant": {
"0": {
"games": 3083,
"win": 1876
},
"1": {
"games": 2992,
"win": 1871
}
}
} | odota/web/testcafe/cachedAjax/players_101695162_counts_.json/0 | {
"file_path": "odota/web/testcafe/cachedAjax/players_101695162_counts_.json",
"repo_id": "odota",
"token_count": 2153
} | 276 |
{
"my_word_counts": {
"zuo": 2,
"ge": 2,
"ren": 2,
"wu": 1,
"gg": 339,
"gl": 23,
"lgd": 1,
"g": 215,
"zheba": 1,
"song": 1,
"le": 13,
"da": 4,
"wan": 3,
"ju": 1,
"bao": 3,
"xiexie": 1,
"zhi": 1,
"chi": 1,
"b": 6,
"wo": 9,
"ye": 1,
"mei": 6,
"kan": 1,
"dao": 4,
"tui": 5,
"bu": 8,
"liao": 1,
"a": 9,
"r": 1,
"shen": 1,
"gang": 1,
"pi": 3,
"xie": 2,
"haode": 1,
"ying": 1,
"guo": 1,
"rdy": 4,
"glhf": 1,
"p": 3,
"sry": 5,
"sb": 1,
"hf": 3,
"tiao": 1,
"you": 5,
"li": 2,
"wode": 1,
"an": 1,
"cuo": 1,
"hao": 6,
"zhe": 2,
"po": 1,
"dian": 1,
"nao": 1,
"ji": 2,
"de": 6,
"lao": 1,
"gh": 2,
"diu": 1,
"nihao": 1,
"hen": 2,
"gong": 1,
"ping": 3,
"nbnb": 1,
"kky": 1,
"sdhqwiudnsiabduiasdhad": 1,
"ka": 7,
"fei": 1,
"wang": 3,
"xia": 2,
"jue": 1,
"ok": 4,
"ig": 1,
"she": 1,
"bei": 1,
"hhh": 1,
"nice": 1,
"ds": 2,
"ma": 1,
"shang": 1,
"shi": 4,
"pin": 1,
"za": 1,
"ap": 1,
"go": 3,
"cun": 1,
"zai": 1,
"dwqeqweqwdasdsaxzc": 1,
"ta": 1,
"diao": 1,
"chu": 2,
"nmb": 2,
"shuai": 1,
"gui": 1,
"xiao": 4,
"qiang": 2,
"tai": 1,
"lihai": 1,
"renma": 1,
"kai": 2,
"zishi": 1,
"bang": 1,
"buzai": 1,
"zo": 1,
"uo": 1,
"yixia": 1,
"gggggggggggggggg": 1,
"glglglglglgl": 1,
"buxing": 1,
"na": 3,
"shenme": 1,
"zheng": 1,
"jiu": 1,
"nimen": 1,
"duoshao": 1,
"men": 1,
"bie": 3,
"y": 1,
"buzou": 1,
"zi": 3,
"lai": 2,
"dang": 1,
"yi": 2,
"ni": 5,
"dan": 1,
"pai": 1,
"maa": 1,
"qiao": 1,
"jidi": 1,
"tuituituit": 1,
"tuituitui": 1,
"ccao": 1,
"tm": 1,
"sha": 1,
"cao": 1,
"bug": 1,
"gei": 1,
"shuang": 1,
"jin": 1,
"qu": 1,
"mai": 1,
"qian": 1,
"huan": 1,
"diannao": 1,
"hg": 1,
"fen": 1,
"mu": 1,
"er": 1,
"deng": 3,
"ba": 1,
"ready": 1,
"qo": 1,
"friend": 1,
"jia": 1,
"wtf": 1,
"gege": 1,
"try": 1,
"s": 2,
"dou": 1,
"god": 1,
"fenzhong": 1,
"shao": 1,
"shu": 1,
"tong": 1,
"pianren": 1,
"kuai": 1,
"pian": 1,
"ggwp": 1,
"hbfgg": 1,
"shiwang": 1,
"women": 2,
"wen": 1,
"fa": 1,
"yu": 1,
"rang": 1,
"haohao": 1,
"solo": 1,
"ruozhi": 1,
"zhuang": 3,
"ai": 1,
"di": 2,
"sheng": 1,
"hui": 1,
"tassa": 1,
"dun": 1,
"wocao": 1,
"laji": 1,
"zheme": 1,
"xiong": 1,
"hi": 1,
"eesama": 1,
"ty": 1
},
"all_word_counts": {
"gg": 3359,
"lin": 1,
"sen": 1,
"chao": 1,
"shuai": 4,
"o": 8,
"wa": 2,
"oo": 10,
"fynb": 1,
"shia": 1,
"god": 56,
"zhe": 22,
"shi": 52,
"dayun": 1,
"haha": 25,
"guan": 7,
"bu": 70,
"liao": 4,
"le": 200,
"fy": 65,
"zuo": 5,
"ge": 44,
"ren": 29,
"wu": 4,
"gtmdwly": 1,
"wly": 1,
"glhf": 209,
"hf": 221,
"gl": 301,
"ggwp": 92,
"ty": 36,
"wp": 123,
"xnova": 8,
"ka": 127,
"nana": 3,
"dc": 4,
"g": 2028,
"ts": 7,
"cant": 23,
"connect": 2,
"to": 60,
"teamspeak": 8,
"glglgl": 15,
"lagged": 1,
"kalke": 1,
"back": 11,
"rdy": 42,
"pgl": 1,
"knocking": 1,
"door": 3,
"or": 12,
"what": 28,
"nvm": 4,
"lag": 43,
"ggg": 11,
"boys": 5,
"kale": 12,
"sec": 39,
"ggwo": 2,
"lgd": 7,
"good": 28,
"luck": 10,
"lol": 50,
"i": 136,
"got": 10,
"flamed": 1,
"pregame": 1,
"he": 35,
"gets": 2,
"whats": 8,
"comin": 1,
"him": 6,
"canya": 1,
"pora": 1,
"otdavat": 1,
"za": 8,
"oracle": 1,
"tihonechko": 1,
"sidim": 1,
"proebuvaem": 1,
"ahaha": 1,
"eto": 3,
"voobwe": 1,
"poebat": 1,
"y": 3,
"mena": 1,
"vp": 1,
"uigrok": 1,
"livai": 1,
"fopr": 1,
"free": 3,
"lane": 5,
"ice": 8,
"mid": 22,
"skils": 1,
"man": 10,
"get": 13,
"the": 40,
"fucking": 18,
"courierman": 1,
"waht": 2,
"domoi": 1,
"colleo": 1,
"mytsor": 1,
"prosto": 3,
"piwet": 1,
"hyinu": 1,
"ya": 9,
"ego": 1,
"v": 17,
"mute": 1,
"dumal": 1,
"chto": 1,
"ti": 11,
"otdhas": 1,
"baraki": 1,
"no": 50,
"vseravno": 1,
"prignul": 1,
"on": 27,
"tebye": 1,
"skazal": 2,
"k": 42,
"burst": 1,
"seems": 4,
"zaebal": 1,
"sdayacya": 1,
"nahui": 1,
"hyi": 1,
"vam": 1,
"tiny": 3,
"bb": 2,
"ez": 14,
"pobeda": 1,
"any": 5,
"tavo": 1,
"fans": 1,
"count": 3,
"it": 38,
"up": 7,
"games": 7,
"over": 5,
"report": 24,
"blue": 11,
"dogshit": 1,
"im": 28,
"just": 14,
"a": 113,
"silencer": 2,
"rsohan": 1,
"its": 31,
"weaver": 3,
"told": 5,
"where": 5,
"fuck": 20,
"is": 70,
"this": 46,
"guy": 9,
"guess": 2,
"so": 27,
"you": 108,
"guys": 18,
"dont": 22,
"deserve": 3,
"win": 9,
"dota": 23,
"think": 6,
"cm": 2,
"does": 5,
"rofl": 20,
"did": 7,
"jsut": 1,
"bashed": 1,
"when": 11,
"paused": 1,
"shit": 20,
"game": 29,
"ur": 24,
"end": 27,
"right": 10,
"are": 21,
"if": 13,
"my": 38,
"didint": 2,
"break": 3,
"his": 8,
"items": 3,
"minutes": 2,
"in": 25,
"and": 34,
"necro": 1,
"u": 71,
"picked": 2,
"me": 53,
"couinter": 1,
"thius": 1,
"would": 3,
"be": 12,
"d": 36,
"xd": 68,
"that": 10,
"bvlink": 1,
"was": 10,
"these": 4,
"lose": 5,
"for": 32,
"sure": 10,
"why": 22,
"m": 7,
"carrying": 1,
"ex": 1,
"dee": 1,
"lmao": 4,
"void": 2,
"am": 6,
"rank": 2,
"calm": 1,
"down": 9,
"hey": 8,
"people": 3,
"with": 21,
"compendium": 1,
"lvl": 1,
"can": 34,
"please": 9,
"tip": 4,
"will": 3,
"happy": 4,
"retard": 4,
"who": 8,
"thinks": 1,
"thanks": 8,
"have": 44,
"priority": 1,
"than": 1,
"go": 238,
"fuckurself": 1,
"stop": 5,
"taking": 1,
"pos": 4,
"sf": 3,
"doing": 5,
"nothing": 5,
"we": 47,
"q": 5,
"hahh": 2,
"bei": 10,
"gao": 8,
"doushi": 2,
"yanyuan": 3,
"w": 18,
"gun": 4,
"ni": 106,
"ma": 46,
"zaizhu": 1,
"-xia": 1,
"wo": 110,
"tp": 6,
"cd": 1,
"zaban": 2,
"pa": 4,
"mskiforev": 1,
"come": 6,
"pig": 2,
"wow": 5,
"rude": 1,
"player": 7,
"noo": 1,
"scared": 1,
"die": 10,
"nice": 13,
"tome": 1,
"tomb": 1,
"lucky": 1,
"skill": 1,
"not": 26,
"teammate": 2,
"saved": 2,
"your": 10,
"ass": 1,
"wait": 31,
"throne": 5,
"say": 12,
"buying": 1,
"waimai": 8,
"tui": 20,
"jinlai": 1,
"wogen": 1,
"mori": 1,
"solo": 3,
"zheba": 1,
"song": 3,
"da": 25,
"wan": 14,
"ju": 6,
"bao": 19,
"xiexie": 4,
"zhi": 11,
"chi": 13,
"okay": 7,
"xm": 1,
"tai": 8,
"hen": 6,
"ba": 24,
"b": 33,
"tiao": 7,
"gei": 10,
"lianjie": 2,
"yixia": 3,
"warlock": 2,
"men": 20,
"yiqi": 3,
"si": 23,
"chulai": 2,
"cnm": 9,
"hahhahahahaa": 1,
"cao": 20,
"mei": 34,
"kan": 15,
"dao": 12,
"ye": 14,
"z": 2,
"zhen": 9,
"islee": 1,
"jidi": 24,
"yong": 4,
"l": 22,
"chishi": 2,
"dage": 2,
"gou": 8,
"tb": 6,
"naga": 2,
"t": 8,
"gua": 3,
"lou": 1,
"sb": 7,
"ok": 62,
"huan": 6,
"nec": 3,
"fu": 8,
"wang": 16,
"yan": 5,
"yuan": 5,
"fw": 2,
"biao": 2,
"ji": 10,
"de": 51,
"lai": 21,
"zi": 10,
"hu": 2,
"best": 3,
"gan": 7,
"sha": 16,
"hahaha": 12,
"s": 19,
"xihuan": 2,
"zhui": 1,
"feng": 5,
"bie": 35,
"qi": 7,
"gen": 1,
"fyzhe": 1,
"yingxiong": 1,
"mingde": 1,
"zan": 3,
"ting": 3,
"wc": 54,
"cai": 4,
"tk": 2,
"jidiba": 1,
"deng": 13,
"san": 1,
"fenz": 2,
"bieji": 1,
"melt": 1,
"ing": 2,
"yi": 24,
"xia": 25,
"zhou": 4,
"dui": 6,
"jubaoyixia": 1,
"snm": 1,
"gungun": 1,
"sqm": 1,
"dada": 1,
"sry": 43,
"r": 9,
"shen": 8,
"gang": 7,
"pi": 9,
"xie": 7,
"zhong": 11,
"ggggg": 2,
"ta": 36,
"hui": 9,
"kaimen": 4,
"done": 7,
"laiu": 1,
"dotajingshen": 1,
"p": 72,
"diannao": 4,
"huaile": 3,
"may": 2,
"thx": 6,
"buxing": 4,
"fang": 7,
"cuo": 5,
"wenzi": 1,
"laoshu": 1,
"jing": 5,
"diubao": 4,
"fight": 2,
"niubi": 2,
"lgdqqq": 1,
"ying": 8,
"dian": 21,
"jin": 10,
"niu": 4,
"bi": 12,
"fygod": 3,
"wr": 2,
"chongqi": 4,
"shang": 10,
"xian": 6,
"now": 14,
"online": 2,
"leile": 1,
"haode": 4,
"hi": 13,
"tssolo": 1,
"meiyong": 1,
"wode": 2,
"duochidian": 1,
"nitama": 1,
"tufu": 2,
"dou": 12,
"qiang": 6,
"bug": 21,
"xiedxie": 1,
"bufangjia": 1,
"rzh": 1,
"gu": 1,
"er": 2,
"tktk": 1,
"vs": 7,
"min": 22,
"guo": 7,
"glgl": 23,
"navi": 1,
"audio": 3,
"gegege": 1,
"crash": 9,
"wtf": 19,
"keep": 3,
"crashing": 1,
"stuff": 4,
"crasjh": 1,
"ddos": 4,
"gaming": 2,
"do": 13,
"hfhf": 14,
"muted": 2,
"all": 26,
"teammates": 1,
"also": 3,
"sound": 13,
"issue": 3,
"again": 12,
"reconnecting": 1,
"maybe": 4,
"h": 6,
"f": 15,
"setting": 4,
"mic": 11,
"fk": 1,
"roshan": 3,
"diy": 1,
"ici": 1,
"wna": 1,
"titi": 1,
"kd": 1,
"tuile": 1,
"bushi": 4,
"congrats": 3,
"grats": 6,
"jiao": 7,
"yisai": 1,
"yidun": 1,
"chui": 5,
"fei": 9,
"xi": 11,
"ahuang": 1,
"qing": 7,
"chiye": 1,
"xiao": 12,
"try": 30,
"hotkey": 2,
"issues": 3,
"gh": 21,
"major": 1,
"haja": 2,
"yin": 3,
"boish": 1,
"gwp": 1,
"np": 6,
"glglglgl": 1,
"bugged": 1,
"worries": 1,
"tech": 1,
"here": 10,
"broke": 1,
"bringing": 1,
"new": 10,
"headset": 1,
"sorry": 29,
"said": 7,
"once": 1,
"gogogo": 4,
"strategy": 1,
"ggl": 1,
"fglll": 1,
"gll": 1,
"glglglglgl": 1,
"hfgl": 3,
"j": 7,
"di": 11,
"hao": 56,
"buhaoyisi": 4,
"guang": 2,
"tian": 3,
"shao": 4,
"eiyouwocao": 1,
"zenme": 1,
"psg": 1,
"yisi": 2,
"gogo": 5,
"bid": 1,
"id": 2,
"ci": 3,
"jianwei": 3,
"en": 10,
"wg": 2,
"geli": 1,
"huskar": 3,
"eeeee": 1,
"alg": 1,
"miss": 3,
"bg": 6,
"noobs": 1,
"wut": 1,
"visage": 1,
"team": 15,
"noob": 4,
"jian": 10,
"pan": 12,
"settings": 5,
"keyboard": 6,
"xiongdi": 4,
"yangyang": 1,
"sbyang": 1,
"nao": 4,
"wenti": 14,
"sbdong": 1,
"diao": 21,
"glllllllll": 1,
"fake": 2,
"jiade": 1,
"jia": 9,
"ei": 1,
"buyinggai": 1,
"qiu": 1,
"ne": 9,
"tt": 5,
"fh": 1,
"hfhfhf": 1,
"haige": 1,
"mo": 4,
"haishi": 2,
"bike": 1,
"zhhongtui": 1,
"zhogn": 1,
"cn": 1,
"li": 8,
"ana": 2,
"sccccccccuh": 1,
"kuaidian": 1,
"yao": 19,
"chifan": 1,
"neng": 7,
"zou": 4,
"an": 7,
"chou": 2,
"support": 2,
"want": 5,
"radiance": 1,
"kazahtan": 1,
"plaer": 1,
"hjere": 1,
"wont": 3,
"brood": 2,
"picker": 2,
"deff": 1,
"joins": 1,
"finish": 3,
"kuang": 3,
"x": 5,
"gonna": 7,
"def": 1,
"pls": 17,
"didnt": 7,
"see": 8,
"boulder": 1,
"wen": 11,
"dog": 4,
"kygo": 3,
"tuituitui": 2,
"ggggggg": 2,
"gratz": 6,
"fwfw": 1,
"gege": 34,
"need": 16,
"help": 6,
"asdhkgashjdas": 1,
"dnt": 1,
"zap": 1,
"sitll": 1,
"ned": 1,
"pause": 9,
"nope": 2,
"yea": 2,
"teams": 3,
"drunk": 1,
"further": 5,
"laoban": 1,
"e": 12,
"banana": 1,
"zhuang": 5,
"tm": 4,
"heh": 1,
"po": 6,
"lao": 12,
"yige": 2,
"diu": 11,
"igues": 1,
"oh": 7,
"suport": 2,
"mean": 6,
"offlane": 1,
"hp": 1,
"wat": 3,
"wrong": 1,
"rubick": 1,
"feeding": 3,
"thsi": 2,
"lost": 9,
"against": 1,
"sd": 3,
"supprots": 1,
"qop": 3,
"bitch": 4,
"pasue": 1,
"fun": 22,
"ggs": 2,
"dubu": 5,
"cor": 1,
"ahh": 4,
"core": 3,
"teclero": 1,
"ranking": 1,
"such": 3,
"hater": 1,
"bs": 2,
"last": 8,
"word": 1,
"oooo": 1,
"nihao": 1,
"kill": 7,
"let": 5,
"wqdlqwdlq": 1,
"ubpause": 1,
"omg": 1,
"rolf": 2,
"qwhgat": 1,
"press": 1,
"random": 6,
"fucker": 3,
"astp": 1,
"ick": 1,
"lastpick": 1,
"moron": 1,
"tinker": 5,
"pick": 10,
"adsyhbnsudasi": 1,
"bros": 1,
"slark": 3,
"gray": 2,
"pink": 2,
"too": 12,
"counter": 1,
"her": 1,
"jack": 1,
"walked": 1,
"boost": 2,
"aand": 1,
"started": 1,
"tlaking": 1,
"runes": 1,
"lastpcik": 1,
"later": 2,
"f-ff": 1,
"sasksa": 1,
"yoi": 1,
"ecxcusme": 1,
"jebaited": 2,
"push": 4,
"plesae": 2,
"dawkdsaj": 1,
"out": 5,
"of": 19,
"agme": 1,
"xdxdxdd": 1,
"zz": 1,
"pleas": 1,
"roflasomdaosd": 1,
"oc": 2,
"gong": 1,
"ping": 27,
"hahah": 5,
"nbnb": 1,
"pc": 19,
"lagging": 9,
"sek": 3,
"leka": 1,
"change": 2,
"from": 2,
"play": 14,
"like": 13,
"works": 4,
"packet": 7,
"loss": 9,
"shuibao": 1,
"huai": 5,
"kp": 2,
"kky": 1,
"sdhqwiudnsiabduiasdhad": 1,
"chu": 9,
"shgang": 1,
"yeshi": 1,
"chongkai": 1,
"youxia": 1,
"ban": 5,
"mah": 1,
"shui": 4,
"dong": 7,
"keyi": 10,
"furion": 1,
"brown": 4,
"little": 1,
"bit": 2,
"yourself": 1,
"hit": 6,
"creep": 1,
"previous": 1,
"attack": 1,
"rax": 4,
"something": 4,
"idk": 4,
"because": 2,
"btr": 1,
"cantp": 1,
"lay": 1,
"shaker": 1,
"habibi": 2,
"habibiii": 1,
"plyaer": 1,
"sk": 5,
"etot": 1,
"chel": 1,
"menya": 1,
"bil": 2,
"proshloi": 1,
"toje": 1,
"-": 16,
"slave": 1,
"hgeroes": 1,
"repeat": 2,
"repaet": 1,
"pathc": 1,
"rash": 1,
"trahs": 1,
"rtghasej": 1,
"n": 10,
"rosh": 1,
"chase": 1,
"walrock": 1,
"job": 1,
"mate": 1,
"false": 1,
"great": 2,
"paleyrs": 1,
"however": 1,
"someone": 3,
"has": 5,
"explain": 2,
"potm": 1,
"buidl": 1,
"she": 5,
"carry": 2,
"rushses": 1,
"eusl": 1,
"hy": 1,
"manta": 3,
"expensive": 1,
"silence": 1,
"had": 2,
"useufl": 1,
"owuld": 1,
"ahve": 1,
"onw": 1,
"teh": 1,
"fucki": 1,
"gname": 1,
"iwwear": 1,
"ooo": 1,
"ud": 1,
"nto": 2,
"use": 1,
"golems": 1,
"creeps": 3,
"pot": 1,
"mcant": 1,
"even": 3,
"fuckin": 5,
"aa": 2,
"talkign": 1,
"lsoit": 1,
"thank": 1,
"veyr": 1,
"much": 4,
"well": 2,
"hero": 9,
"stronger": 1,
"giveu": 1,
"yeds": 1,
"difnase": 1,
"afk": 7,
"baiitng": 1,
"necty": 1,
"ruined": 1,
"cooman": 3,
"ftw": 1,
"thats": 10,
"some": 5,
"delicious": 1,
"suck": 7,
"rage": 2,
"radiant": 2,
"abuser": 2,
"should": 4,
"sutaj": 1,
"se": 1,
"dupe": 1,
"iskreno": 1,
"samo": 1,
"mogu": 1,
"mage": 1,
"rape": 1,
"head": 4,
"cooooooooooman": 1,
"th": 1,
"buyback": 2,
"rd": 3,
"every": 3,
"jebi": 1,
"ga": 4,
"us": 5,
"next": 7,
"commend": 4,
"respect": 1,
"trilted": 1,
"more": 8,
"going": 6,
"feed": 6,
"proimisse": 1,
"srlsy": 1,
"server": 3,
"hope": 4,
"cores": 1,
"dead": 4,
"srsly": 1,
"asxladxsldxsal": 1,
"zakonchite": 1,
"xaxaax": 1,
"xaaaxaaxa": 1,
"xxx": 1,
"xxxxx": 1,
"kitaec": 2,
"poimet": 1,
"missclick": 3,
"blya": 1,
"tualet": 1,
"oi": 1,
"moroz": 2,
"storm": 2,
"etoet": 1,
"happened": 2,
"ebuiy": 1,
"ck": 2,
"premuted": 1,
"suka": 2,
"vtyz": 1,
"ddddddd": 1,
"perelil": 1,
"ggege": 1,
"problem": 12,
"dude": 4,
"yes": 3,
"fine": 4,
"only": 4,
"ruskidogs": 1,
"throw": 1,
"hard": 2,
"victory": 2,
"side": 1,
"mariachi": 1,
"doto": 2,
"ready": 17,
"gf": 3,
"waow": 1,
"yisdi": 1,
"jun": 1,
"meishi": 1,
"junge": 1,
"ode": 1,
"shubiao": 7,
"bo": 2,
"guangge": 1,
"haoxiongdi": 1,
"xxs": 1,
"jue": 1,
"rua": 5,
"buliao": 1,
"women": 5,
"reisen": 1,
"koean": 1,
"ch": 2,
"shuo": 16,
"wei": 3,
"yun": 1,
"hhao": 1,
"erji": 3,
"ig": 8,
"mini": 2,
"yang": 19,
"fan": 8,
"gfg": 1,
"zhenrong": 1,
"namehao": 1,
"wutface": 1,
"anyone": 2,
"know": 4,
"hes": 8,
"teal": 3,
"paid": 2,
"ccnc": 1,
"ehm": 2,
"how": 8,
"one": 11,
"own": 4,
"place": 3,
"ward": 1,
"middle": 1,
"river": 1,
"sentry": 2,
"called": 3,
"na": 17,
"pubs": 1,
"at": 9,
"tower": 2,
"take": 2,
"awshile": 1,
"awnna": 1,
"leave": 3,
"rises": 1,
"lulz": 1,
"ah": 1,
"hullo": 1,
"came": 2,
"dotes": 1,
"shitty": 1,
"winner": 1,
"overrated": 1,
"ult": 1,
"smh": 1,
"dd": 1,
"bot": 2,
"naxi": 1,
"epcc": 1,
"palla": 1,
"vaca": 1,
"concehtuamre": 1,
"pareces": 1,
"retrasadito": 1,
"soy": 1,
"riki": 4,
"peru": 6,
"wind": 1,
"lace": 1,
"clockerino": 1,
"useless": 1,
"ant": 1,
"greedy": 3,
"boots": 1,
"buyer": 3,
"garbage": 1,
"motherucker": 1,
"peruvians": 1,
"enchantrees": 1,
"srry": 2,
"ranked": 1,
"lina": 11,
"beat": 1,
"clowns": 1,
"typing": 1,
"jealous": 1,
"mmr": 10,
"io": 3,
"heals": 1,
"ruiend": 1,
"cry": 3,
"never": 3,
"ezk": 1,
"look": 2,
"by": 1,
"winning": 1,
"raped": 1,
"helped": 1,
"ttytyty": 1,
"alreyad": 1,
"still": 7,
"understand": 3,
"hgow": 1,
"orange": 4,
"talk": 2,
"oops": 1,
"dick": 1,
"stupid": 6,
"space": 1,
"ds": 3,
"killed": 1,
"meo": 1,
"nce": 1,
"then": 3,
"were": 2,
"lvls": 1,
"behind": 1,
"cuz": 2,
"ganked": 1,
"other": 3,
"jungle": 2,
"ancient": 1,
"farm": 2,
"read": 2,
"blind": 1,
"ure": 1,
"awufl": 1,
"chink": 1,
"hurt": 1,
"hahaa": 1,
"soul": 1,
"bane": 1,
"hold": 1,
"ks": 2,
"fail": 1,
"cast": 1,
"echo": 1,
"lmafo": 1,
"jugg": 5,
"bruh": 1,
"od": 2,
"underlvl": 1,
"as": 5,
"reprot": 1,
"percent": 1,
"normal": 2,
"ns": 3,
"yo": 4,
"braindead": 1,
"spic": 1,
"emochu": 2,
"double": 2,
"boyz": 1,
"vann": 1,
"honest": 1,
"sideral": 2,
"boosts": 1,
"theres": 2,
"way": 2,
"ape": 2,
"green": 2,
"past": 1,
"margnin": 1,
"picking": 1,
"seee": 1,
"spam": 3,
"love": 5,
"probably": 2,
"grey": 3,
"eeuu": 2,
"st": 3,
"idc": 1,
"forev": 1,
"comes": 2,
"eu": 2,
"true": 2,
"hack": 1,
"map": 1,
"larry": 3,
"rankend": 1,
"ite": 1,
"gona": 1,
"autoclicker": 1,
"watch": 1,
"suits": 1,
"peace": 1,
"top": 3,
"gmae": 2,
"es": 3,
"mierda": 1,
"shutup": 1,
"faggot": 1,
"honestly": 1,
"gay": 2,
"whys": 1,
"clcokwork": 1,
"viper": 1,
"cancel": 1,
"most": 2,
"annoying": 1,
"piece": 1,
"actually": 8,
"coming": 6,
"reportson": 1,
"ill": 4,
"adick": 1,
"live": 2,
"times": 3,
"nerds": 1,
"lul": 2,
"lil": 1,
"ad": 3,
"caibi": 1,
"bld": 1,
"paoa": 1,
"wcnm": 1,
"wodde": 1,
"dawo": 1,
"derb": 1,
"haaahhah": 1,
"admeme": 1,
"nizhenshi": 1,
"sile": 1,
"male": 1,
"zale": 3,
"hai": 8,
"chai": 2,
"qiuge": 1,
"mabi": 1,
"bushou": 1,
"mai": 9,
"xing": 2,
"broken": 2,
"admin": 4,
"plz": 8,
"limp": 1,
"dies": 1,
"starting": 1,
"admins": 4,
"changing": 3,
"inc": 1,
"hmzz": 1,
"fps": 9,
"drop": 3,
"crazy": 1,
"our": 8,
"kick": 1,
"make": 3,
"pw": 4,
"channel": 2,
"add": 7,
"fix": 9,
"find": 1,
"ip": 1,
"execute": 1,
"set": 3,
"roger": 1,
"ruozhi": 2,
"gggggg": 3,
"crashed": 3,
"wsp": 1,
"welcome": 1,
"many": 3,
"bashes": 1,
"burning": 4,
"wisp": 1,
"after": 2,
"ench": 1,
"hello": 7,
"ddosing": 2,
"fuckign": 1,
"holy": 1,
"crit": 1,
"time": 6,
"c": 5,
"cmon": 1,
"really": 4,
"invoker": 1,
"impressive": 1,
"tree": 1,
"deek": 1,
"worst": 2,
"helllo": 1,
"pain": 1,
"hhh": 1,
"jester": 1,
"bad": 5,
"they": 19,
"mates": 1,
"retarded": 1,
"trade": 1,
"hiope": 1,
"liek": 1,
"kiev": 1,
"hte": 1,
"ufkc": 1,
"thjis": 1,
"palyionmg": 1,
"agree": 1,
"about": 2,
"ruiner": 1,
"nd": 3,
"hjumans": 1,
"swear": 1,
"bots": 1,
"robots": 1,
"noticed": 1,
"real": 1,
"human": 1,
"lie": 3,
"liem": 1,
"eznd": 1,
"meout": 1,
"thjsi": 1,
"sell": 1,
"courier": 2,
"destory": 1,
"miod": 1,
"rly": 1,
"pogchamp": 1,
"trytards": 1,
"tryhards": 2,
"quite": 1,
"remember": 5,
"babyrage": 1,
"bash": 2,
"legit": 1,
"yeah": 10,
"happens": 2,
"dogs": 1,
"nein": 3,
"pudge": 2,
"gameruining": 1,
"dunno": 2,
"quee": 1,
"west": 1,
"there": 5,
"russians": 1,
"talking": 1,
"plays": 3,
"average": 1,
"boosted": 1,
"prollu": 1,
"prolly": 2,
"zhale": 1,
"vgdewang": 1,
"pin": 1,
"cap": 1,
"ap": 3,
"mibbo": 1,
"bixu": 1,
"kaer": 1,
"boyibo": 1,
"mcoming": 1,
"room": 1,
"envy": 2,
"jokes": 1,
"tied": 1,
"dg": 3,
"drank": 1,
"beers": 1,
"wild": 1,
"flower": 1,
"magnus": 3,
"motherfucker": 1,
"dac": 1,
"getting": 2,
"cock": 1,
"virgo": 1,
"tihs": 2,
"mc": 1,
"omfg": 2,
"pms": 1,
"orb": 1,
"hiomp": 1,
"nigga": 1,
"goung": 1,
"party": 1,
"youwenti": 1,
"biabia": 1,
"hepigbudao": 1,
"shiyixia": 1,
"yinggai": 1,
"cun": 1,
"zai": 13,
"geigei": 2,
"gousiin": 1,
"wsm": 1,
"xiang": 5,
"xiong": 3,
"borax": 1,
"sui": 2,
"bian": 2,
"kai": 17,
"nan": 2,
"shou": 10,
"cang": 1,
"gfe": 1,
"fa": 5,
"haoyisi": 1,
"dwqeqweqwdasdsaxzc": 1,
"call": 2,
"rotk": 3,
"ganggang": 2,
"voice": 2,
"ghg": 1,
"fen": 8,
"ai": 3,
"luna": 5,
"goushidage": 1,
"bat": 2,
"shab": 1,
"la": 5,
"tiaoping": 1,
"fade": 2,
"father": 1,
"du": 7,
"ca": 3,
"hunzi": 1,
"nmb": 3,
"tmd": 1,
"xiaku": 1,
"buzai": 4,
"zuofei": 3,
"dr": 1,
"laji": 3,
"bing": 2,
"duishou": 1,
"zheyang": 1,
"chhong": 1,
"caonima": 3,
"duoshao": 2,
"dexue": 1,
"wentile": 1,
"weishenme": 1,
"renma": 2,
"xuzhi": 3,
"qu": 7,
"freeze": 1,
"bp": 4,
"gui": 2,
"pom": 2,
"lihai": 1,
"gogoo": 1,
"ocao": 1,
"nima": 1,
"biyao": 1,
"tma": 1,
"worinige": 1,
"majunju": 1,
"goubi": 1,
"geilaozisi": 1,
"wozhe": 1,
"wd": 1,
"op": 2,
"xihuanwannajia": 1,
"rao": 2,
"yiming": 1,
"nvxia": 1,
"zishi": 1,
"bang": 1,
"zheyekyi": 1,
"kaiba": 1,
"huibulaile": 1,
"kend": 1,
"kun": 1,
"ky": 2,
"xuan": 2,
"spezhaowole": 1,
"obs": 1,
"xin": 7,
"zha": 4,
"ggjidi": 1,
"geb": 1,
"ganma": 3,
"malin": 1,
"zen": 2,
"dongde": 1,
"dongf": 1,
"su": 3,
"yongailingwu": 1,
"fengge": 1,
"haoka": 1,
"chongjinxia": 1,
"dh": 1,
"wocao": 9,
"mian": 2,
"tu": 2,
"mb": 1,
"haipa": 1,
"budiu": 1,
"wai": 4,
"fcb": 1,
"shaodeng": 3,
"fg": 1,
"fthtml": 1,
"ag": 2,
"hg": 3,
"zo": 1,
"uo": 1,
"king": 3,
"tuzi": 1,
"dehencai": 1,
"huang": 1,
"hencan": 1,
"niao": 6,
"fanbu": 1,
"zheme": 2,
"duo": 7,
"wanguowo": 1,
"bushata": 1,
"taba": 1,
"cesuo": 2,
"wangjile": 1,
"ms": 5,
"taika": 1,
"tamen": 2,
"liangge": 1,
"gai": 5,
"shezhi": 1,
"shishi": 1,
"guolai": 1,
"hun": 1,
"shuang": 4,
"ling": 1,
"wm": 1,
"shua": 2,
"ob": 5,
"nimen": 6,
"yiyang": 5,
"shenme": 5,
"buyiyang": 1,
"rep": 1,
"nage": 1,
"zhuangbei": 1,
"jiu": 6,
"shuio": 1,
"zhepan": 1,
"qita": 1,
"gggg": 6,
"wenle": 1,
"cbing": 1,
"lan": 4,
"chong": 7,
"liu": 1,
"jiang": 3,
"problum": 1,
"bathroom": 2,
"already": 1,
"vg": 12,
"lian": 3,
"sao": 1,
"rang": 3,
"tang": 1,
"sl": 1,
"xixi": 3,
"yici": 3,
"aragin": 1,
"sahwo": 1,
"gggggggggggggggg": 1,
"computer": 1,
"kpii": 1,
"baobao": 1,
"hapi": 3,
"glglglglglgl": 1,
"kuai": 5,
"erzi": 1,
"benshi": 2,
"jb": 1,
"zheng": 1,
"sr": 3,
"liaotian": 1,
"gaige": 1,
"tinghui": 1,
"zu": 1,
"pro": 3,
"yyiqi": 1,
"hjapi": 1,
"hoho": 1,
"yaosini": 1,
"shide": 1,
"buzou": 1,
"hah": 2,
"gegegegege": 1,
"close": 1,
"gegegegegege": 1,
"aoe": 1,
"dang": 1,
"memeda": 1,
"tou": 2,
"dan": 2,
"pai": 2,
"maa": 1,
"qiao": 2,
"jianren": 1,
"tuituituit": 1,
"jiaqian": 1,
"huanglu": 1,
"jhahahahha": 1,
"nimabi": 1,
"ccao": 1,
"qipa": 1,
"chonggeqian": 1,
"isi": 1,
"wcxia": 1,
"ditu": 2,
"problems": 2,
"huanbuqi": 1,
"pixie": 4,
"qian": 3,
"lihaile": 1,
"jianpan": 2,
"xiasi": 1,
"puck": 2,
"qiubusha": 1,
"nishuo": 1,
"fensi": 1,
"yc": 1,
"bula": 1,
"pee": 6,
"sht": 1,
"em": 1,
"everyone": 3,
"dire": 1,
"fck": 1,
"jajajajaja": 1,
"pump": 1,
"alrighty": 1,
"uyou": 1,
"bought": 3,
"phase": 1,
"asldjkfmnasjfadfa": 1,
"fajsklfjkaa": 1,
"actualyl": 1,
"retards": 1,
"ditto": 1,
"drow": 3,
"ive": 1,
"played": 3,
"hate": 3,
"aite": 1,
"fueckd": 1,
"strat": 1,
"izi": 1,
"jungla": 2,
"agaisnt": 1,
"supporst": 1,
"bless": 1,
"wouldnt": 1,
"give": 1,
"thought": 4,
"randomed": 1,
"yellow": 6,
"inzi": 1,
"thers": 1,
"vlads": 1,
"those": 1,
"gamer": 1,
"clq": 1,
"proud": 2,
"bsj": 1,
"clqs": 1,
"disciple": 1,
"pretty": 2,
"single": 1,
"handedly": 1,
"won": 3,
"everyones": 1,
"eam": 1,
"brain": 1,
"survives": 1,
"suprise": 1,
"finds": 1,
"another": 2,
"sutpiod": 1,
"hows": 1,
"axe": 2,
"mirana": 1,
"sghit": 1,
"oyt": 1,
"siad": 1,
"mvp": 1,
"centaur": 1,
"nono": 2,
"uouo": 1,
"ask": 1,
"et": 1,
"speaking": 1,
"taunts": 1,
"taunt": 1,
"benjaz": 2,
"xx": 1,
"rnadoming": 1,
"aint": 1,
"causeu": 1,
"firstp": 1,
"icked": 1,
"gr": 1,
"yhero": 1,
"surprised": 1,
"alcheimst": 1,
"avg": 1,
"gameds": 1,
"khezu": 1,
"says": 4,
"mike": 1,
"fukc": 2,
"gook": 1,
"off": 5,
"alright": 2,
"tuinker": 1,
"foever": 1,
"xddx": 1,
"must": 1,
"abed-god": 1,
"spaceeeeeeeee": 1,
"without": 1,
"farmed": 1,
"phoenix": 1,
"hesay": 1,
"buy": 5,
"oconchatumare": 1,
"purple": 1,
"mom": 2,
"ate": 1,
"wel": 1,
"ost": 1,
"conchatumare": 1,
"faggots": 1,
"magnuis": 1,
"abed": 1,
"base": 1,
"bae": 1,
"scythe": 1,
"asdsadsjad": 1,
"rp": 2,
"ggee": 1,
"gegegegegegegegege": 1,
"jaja": 1,
"vamonos": 1,
"muchachos": 1,
"woerrl": 1,
"puta": 1,
"mericon": 1,
"wop": 1,
"wugu": 1,
"ancuo": 1,
"jajaja": 1,
"uge": 1,
"liang": 3,
"shu": 4,
"tong": 3,
"suzhi": 2,
"teng": 2,
"cui": 1,
"hang": 1,
"ke": 1,
"bm": 1,
"replay": 1,
"mu": 3,
"miao": 2,
"buhaoba": 1,
"vgde": 2,
"jie": 3,
"yue": 2,
"sheng": 3,
"duzi": 1,
"hzi": 1,
"jiangshi": 1,
"ben": 1,
"yiji": 1,
"xu": 3,
"ziyang": 1,
"xuzi": 1,
"duihua": 1,
"kou": 5,
"bpshijian": 1,
"sdn": 2,
"piqi": 1,
"hua": 2,
"zhuyi": 1,
"lo": 1,
"budui": 1,
"jieshuo": 1,
"pu": 2,
"pige": 1,
"chang": 1,
"hahahahha": 1,
"zhibo": 1,
"bisai": 1,
"rs": 1,
"aw": 1,
"restarted": 1,
"hax": 1,
"stun": 1,
"trash": 1,
"naix": 1,
"dfucking": 1,
"slardog": 2,
"ls": 1,
"watching": 2,
"lel": 2,
"fighting": 1,
"throwed": 1,
"hamesha": 1,
"mere": 1,
"samnei": 1,
"kyu": 1,
"aisa": 2,
"khelta": 1,
"apakaya": 1,
"mar": 1,
"khelega": 1,
"bohot": 1,
"naach": 1,
"liye": 1,
"babua": 1,
"mad": 1,
"thrower": 1,
"baby": 2,
"fcukin": 6,
"qr": 8,
"idiot": 7,
"gank": 1,
"funny": 1,
"orchid": 3,
"acc": 2,
"delete": 1,
"zzzzzzzzzz": 1,
"alche": 2,
"popls": 1,
"war": 2,
"idol": 1,
"wpow": 1,
"comeback": 1,
"idot": 1,
"ng": 1,
"mga": 1,
"idols": 1,
"always": 2,
"flame": 1,
"hahahaha": 2,
"fly": 4,
"screen": 2,
"stuipd": 1,
"fuc": 1,
"loko": 1,
"gegee": 1,
"njj": 1,
"luckily": 1,
"scored": 1,
"haahahahha": 1,
"ahahhahaahha": 1,
"point": 1,
"sohai": 1,
"watchingbtm": 1,
"bring": 1,
"pride": 1,
"og": 1,
"leh": 1,
"nid": 1,
"show": 1,
"them": 6,
"sea": 3,
"englano": 1,
"hell": 1,
"thatwas": 1,
"sister": 2,
"happned": 1,
"scepter": 1,
"button": 2,
"cringe": 1,
"internet": 2,
"connection": 3,
"ded": 1,
"himself": 3,
"lion": 2,
"join": 3,
"vgr": 9,
"stucked": 1,
"eheh": 1,
"wi": 1,
"reported": 2,
"tq": 1,
"gaijian": 4,
"move": 3,
"pack": 1,
"reconnect": 1,
"laodang": 1,
"accept": 1,
"their": 2,
"fair": 1,
"kk": 3,
"nobody": 1,
"else": 3,
"having": 2,
"ld": 2,
"agreed": 1,
"both": 6,
"hei": 2,
"luo": 1,
"anything": 2,
"restart": 4,
"cannot": 1,
"remake": 2,
"dotareborn": 1,
"rm": 3,
"isps": 1,
"load": 2,
"ours": 2,
"cafe": 1,
"few": 1,
"mins": 3,
"long": 4,
"lets": 6,
"unpause": 3,
"until": 1,
"same": 3,
"turn": 3,
"players": 2,
"shousu": 1,
"ruhe": 1,
"pao": 3,
"jingcai": 1,
"yuyin": 1,
"chaile": 1,
"woyao": 1,
"zaichongqixia": 1,
"dengxiawo": 1,
"woka": 1,
"miaozhun": 1,
"lu": 1,
"meimei": 1,
"h-cup": 25,
"imbatvimbatvcdeca": 1,
"wf": 1,
"juesai": 1,
"jiayou": 1,
"qo": 5,
"giff": 1,
"stole": 1,
"ago": 2,
"zeus": 1,
"together": 1,
"miracle": 1,
"added": 1,
"almost": 1,
"assisinate": 1,
"joke": 1,
"deny": 1,
"omni": 1,
"usinbg": 1,
"ulti": 1,
"tried": 2,
"pokemon": 1,
"catch": 1,
"dx": 1,
"lookin": 1,
"dictionary": 1,
"prbly": 1,
"friend": 1,
"doom": 2,
"life": 2,
"peng": 1,
"sdgfdsg": 1,
"sent": 1,
"invite": 1,
"woi": 1,
"terrible": 1,
"yuntil": 1,
"jka": 1,
"sadasd": 1,
"ravage": 1,
"gj": 1,
"doesnn": 1,
"work": 1,
"gettin": 1,
"terror": 1,
"blade": 4,
"httpswwwtwitchtvimbamusic": 1,
"fml": 1,
"ogo": 1,
"--": 1,
"horse": 3,
"godlike": 1,
"disconnects": 1,
"streak": 1,
"accidentally": 1,
"hits": 1,
"baited": 2,
"kakoi-to": 1,
"sin": 1,
"bladi": 1,
"lc": 1,
"pizdec": 1,
"yebisha": 1,
"feedeli": 1,
"tochnee": 1,
"ggggggggggghgggggggggggggggggggggggggggggggggggggggggggggggf": 1,
"imbatvimbatv": 23,
"ri": 1,
"tama": 1,
"shan": 1,
"gba": 1,
"pen": 1,
"youxi": 2,
"zhegewang": 1,
"zuile": 1,
"gogogogo": 1,
"goggo": 1,
"che": 2,
"liaobuqi": 1,
"goba": 1,
"geng": 2,
"gali": 2,
"fenzhong": 2,
"imbatvh-cup": 2,
"imbatv": 1,
"aabh": 1,
"taizi": 1,
"nog": 1,
"gon": 1,
"niaoniao": 1,
"bieg": 1,
"favourite": 1,
"smb": 1,
"falling": 1,
"asleep": 1,
"wake": 1,
"eta": 2,
"playing": 5,
"ads": 1,
"soon": 2,
"sai": 1,
"xddddd": 1,
"ddddddddddd": 1,
"white": 8,
"rice": 4,
"rocks": 2,
"very": 2,
"tasty": 2,
"hmmm": 1,
"rush": 1,
"russssssss": 1,
"except": 1,
"tell": 1,
"air": 2,
"sky": 2,
"outside": 1,
"masks": 1,
"russia": 1,
"grass": 1,
"simple": 1,
"rise": 1,
"girls": 1,
"wife": 1,
"asian": 1,
"being": 2,
"black": 10,
"someday": 1,
"meet": 1,
"japanese": 1,
"finally": 2,
"element": 2,
"td": 2,
"day": 2,
"fixed": 1,
"bugs": 1,
"idea": 4,
"gold": 1,
"alchemist": 1,
"mass": 1,
"interest": 1,
"profit": 1,
"alchemists": 1,
"used": 1,
"torrent": 2,
"towers": 1,
"slow": 1,
"moves": 1,
"overwatch": 1,
"heroes": 1,
"sad": 1,
"story": 1,
"main": 1,
"dungeon": 1,
"meteor": 1,
"shower": 1,
"playa": 1,
"info": 2,
"least": 1,
"youre": 2,
"breaking": 1,
"heart": 1,
"beda": 1,
"prefer": 1,
"round": 1,
"robin": 1,
"put": 3,
"pull": 1,
"ditka": 1,
"csgo": 1,
"rounds": 1,
"fenrir": 2,
"easy": 1,
"shabi": 2,
"xukong": 1,
"qiong": 1,
"biesha": 1,
"jubao": 3,
"daryl": 2,
"charlie": 1,
"fys": 1,
"lolz": 1,
"frankerz": 1,
"artour": 1,
"quiet": 2,
"wants": 1,
"test": 2,
"eg": 2,
"graphic": 1,
"csomeone": 1,
"disable": 1,
"minimap": 1,
"thing": 2,
"big": 1,
"icon": 1,
"ees": 1,
"fears": 1,
"highlighted": 1,
"scrolls": 1,
"dotaminimapherosize": 1,
"eotk": 1,
"checking": 1,
"momo": 2,
"siss": 1,
"cat": 1,
"btw": 2,
"type": 1,
"ddd": 1,
"lovely": 1,
"name": 2,
"techno": 2,
"could": 1,
"hear": 2,
"left": 1,
"allchat": 1,
"extremeguy": 1,
"listening": 1,
"quietly": 1,
"local": 1,
"returned": 1,
"shiki": 1,
"xun": 1,
"ran": 2,
"tashuo": 1,
"zuole": 1,
"xiaju": 1,
"tmee": 1,
"keyide": 1,
"gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg": 1,
"aaaaaaaaasuan": 1,
"suan": 1,
"ming": 2,
"huoqiang": 1,
"qie": 1,
"xiaowenti": 1,
"dianhua": 3,
"hue": 2,
"aaaaacea": 1,
"youbenshi": 1,
"kao": 1,
"xinshou": 1,
"sasa": 1,
"asdfglklj": 1,
"sdflkgjj": 1,
"jiiu": 1,
"ki": 1,
"zenmele": 3,
"hh": 1,
"ccg": 1,
"lia": 1,
"zabu": 1,
"pianren": 1,
"bluff": 1,
"pian": 3,
"shei": 1,
"glao": 1,
"buie": 1,
"haooe": 1,
"gaygay": 1,
"glglhf": 1,
"uspel": 1,
"xmeg": 1,
"statsbyleo": 1,
"laggings": 1,
"ometimes": 1,
"hbfgg": 1,
"shiwang": 1,
"yu": 2,
"baqi": 1,
"weism": 1,
"dai": 3,
"kaishi": 1,
"kandao": 1,
"woquchuanwazi": 1,
"datuixia": 1,
"niaoge": 1,
"xuxu": 1,
"xz": 1,
"laozi": 2,
"biu": 1,
"pigs": 1,
"afternoon": 1,
"-le": 1,
"wohaola": 1,
"hong": 1,
"shenemn": 1,
"qingkuang": 1,
"muji": 1,
"gaosuowode": 1,
"mimi": 1,
"mao": 1,
"wohui": 1,
"baba": 1,
"mercy": 5,
"haohao": 1,
"lianjin": 1,
"huilai": 1,
"ddg": 1,
"aozou": 1,
"meme": 1,
"zhidao": 1,
"laile": 1,
"cpu": 1,
"minute": 1,
"light": 1,
"yesterday": 1,
"phobos": 2,
"oki": 1,
"wanna": 3,
"might": 1,
"streams": 1,
"network": 4,
"sometimes": 3,
"but": 5,
"stable": 2,
"ligths": 1,
"laochenwocao": 1,
"rotkshuo": 1,
"zanting": 1,
"red": 1,
"bihu": 1,
"bijing": 1,
"nmzl": 1,
"yajn": 1,
"xiu": 2,
"ding": 1,
"tassa": 1,
"dun": 1,
"waii": 1,
"mikasawo": 1,
"ffffff": 1,
"cha": 1,
"biepao": 1,
"nhe": 1,
"nonono": 1,
"nononononono": 1,
"nmsl": 1,
"chougui": 1,
"buwan": 1,
"nmgb": 1,
"gofen": 1,
"guofens": 1,
"esc": 3,
"quan": 1,
"needs": 2,
"changed": 1,
"directional": 1,
"patch": 1,
"chjanged": 1,
"pathing": 1,
"console": 1,
"command": 1,
"fixing": 1,
"keys": 1,
"gaixiajian": 1,
"static": 2,
"ce": 1,
"suo": 1,
"dianzijingji": 1,
"pressed": 1,
"power": 1,
"ee": 3,
"microphone": 1,
"laoj": 1,
"yizhi": 1,
"zhineng": 1,
"zhifa": 1,
"rehost": 1,
"super": 7,
"purpose": 1,
"supposed": 1,
"samepw": 1,
"reborn": 1,
"lags": 1,
"warnutz": 1,
"shout": 1,
"demon": 1,
"sda": 1,
"lhf": 1,
"tebe": 1,
"etaj": 1,
"shas": 1,
"podimuys": 1,
"ggggggggggggggggggggggggggggggggggggggggggggggg": 1,
"shop": 1,
"restarteing": 1,
"haave": 1,
"fuuun": 1,
"pingmu": 1,
"werf": 1,
"stream": 1,
"steam": 2,
"omatter": 1,
"evne": 1,
"chew": 1,
"arm": 1,
"gwei": 1,
"fai": 1,
"zao": 1,
"pounce": 1,
"asked": 1,
"nicely": 1,
"eesama": 1,
"holyshit": 1,
"diaobao": 1,
"matrix": 1,
"asd": 1,
"guofu": 1,
"home": 1,
"esl": 2,
"event": 1,
"checked": 1,
"traffic": 2,
"different": 2,
"vpn": 1,
"shoudl": 1,
"check": 2,
"first": 1,
"feels": 2,
"awful": 1,
"lower": 1,
"high": 2,
"segmented": 1,
"away": 2,
"line": 2,
"jumping": 1,
"ignore": 2,
"number": 1,
"headsets": 1,
"hm": 1,
"everything": 1,
"promise": 1,
"oyu": 1,
"smoke": 1,
"irl": 1,
"wca": 1,
"sdasd": 1,
"flip": 1,
"coiun": 1,
"victorry": 1,
"sumail": 2,
"merci": 1,
"universe": 2,
"options": 1,
"send": 1,
"twitter": 1,
"whos": 1,
"buff": 1,
"retry": 2,
"lr": 1,
"ggwpo": 1,
"wonderful": 1,
"decider": 1,
"match": 1,
"dsometrhing": 1,
"dumb": 1,
"kappa": 2,
"iece": 1,
"turning": 1,
"net": 1,
"graph": 1,
"fast": 1,
"sake": 1,
"urgent": 1,
"fir": 1,
"niuce": 1,
"waifu": 1,
"quickly": 1,
"seconds": 1,
"clown": 1,
"hotkeys": 1,
"houlong": 1,
"jiuming": 1,
"shixia": 1,
"prob": 1,
"ktv": 2,
"downloading": 1,
"tricky": 1,
"ntail": 1,
"sory": 1,
"symphony": 1,
"pauses": 1,
"wasnt": 1,
"gyro": 1,
"dced": 2,
"gone": 2,
"chaneg": 1,
"bind": 1,
"imb": 1,
"boom": 1,
"rersgg": 1,
"den": 1,
"prolavianw": 1,
"shoutout": 5,
"brothers": 1,
"john": 1,
"helping": 1,
"alot": 2,
"atm": 2,
"valvolinefikosmangixrio": 1,
"iphos": 1,
"smart": 1,
"shoutou": 1,
"panagiwta": 1,
"readyu": 1,
"rrf": 1,
"ggggggggggg": 1,
"gz": 2,
"short": 2,
"restroom": 1,
"till": 1,
"-ping": 25,
"dmin": 2,
"censored": 1,
"totally": 1,
"unplayable": 1,
"days": 2,
"nights": 1,
"alrgiht": 1,
"hardcore": 1,
"lik": 1,
"eit": 1,
"ey": 2,
"dread": 1,
"click": 1,
"zoom": 2,
"sexy": 2,
"girl": 1,
"believe": 1,
"norm": 2,
"tak": 1,
"tusich": 1,
"vashe": 1,
"kaifuem": 1,
"mne": 1,
"woaini": 1,
"gtg": 1,
"chuan": 1,
"june": 1,
"resident": 1,
"evil": 1,
"hmm": 1,
"congratz": 1,
"frame": 1,
"lzg": 1,
"isn": 1,
"klasse": 1,
"spiel": 1,
"thoise": 1,
"dives": 1,
"tho": 2,
"damn": 1,
"cocky": 1,
"dive": 1,
"cs": 2,
"xp": 1,
"blitzcrank": 1,
"ohhhhh": 1,
"duibuqi": 1,
"misstype": 1,
"npnp": 1,
"drops": 2,
"lowish": 1,
"der": 2,
"luegt": 1,
"ein": 1,
"popo": 1,
"doch": 1,
"noch": 2,
"ganz": 1,
"gut": 2,
"muede": 1,
"lass": 1,
"beide": 1,
"ffn": 1,
"und": 1,
"pennen": 1,
"redbull": 1,
"zum": 1,
"fruehstueck": 1,
"denkst": 1,
"klassiker": 1,
"hoert": 1,
"sich": 1,
"ac": 1,
"assault": 1,
"cuirass": 1,
"con": 1,
"arctic": 1,
"pole": 1,
"prove": 1,
"das": 1,
"bild": 1,
"vom": 1,
"sieht": 1,
"behindert": 1,
"aus": 1,
"aui": 1,
"bock": 1,
"aufn": 1,
"bissl": 1,
"smash": 1,
"klar": 1,
"goenn": 1,
"ich": 1,
"mir": 1,
"machst": 1,
"captain": 1,
"adrian": 1,
"mans": 2,
"wine": 1,
"barrel": 1,
"botom": 1,
"shield": 2,
"bottom": 1,
"einer": 1,
"geht": 1,
"switching": 1,
"pcs": 1,
"mother": 1,
"padrinho": 1,
"hat": 1,
"brudi": 1,
"gesagt": 1,
"fata": 2,
"wh": 1,
"lied": 1,
"sing": 2,
"wb": 1,
"chicken": 1,
"config": 1,
"sor": 1,
"loda": 1,
"shoulder": 1,
"face": 1,
"sick": 1,
"fiend": 4,
"cleaver": 4,
"dragon": 1,
"thign": 1,
"saw": 2,
"bulba": 1,
"sings": 1,
"penises": 1,
"hjahaha": 1,
"svens": 1,
"edition": 1,
"market": 1,
"named": 1,
"though": 1,
"clan": 1,
"isnt": 1,
"description": 1,
"sven": 1,
"code": 1,
"which": 1,
"cares": 1,
"swords": 1,
"sword": 1,
"lives": 1,
"dotka": 1,
"sho": 1,
"pinyin": 1,
"re": 1,
"qifu": 1,
"cong": 1,
"siji": 1,
"piao": 3,
"ep": 1,
"transtalte": 1,
"happend": 1,
"aiguo": 1,
"kaka": 1,
"chonglianxiashishi": 1,
"zenmeyangle": 1,
"bulaike": 1,
"shengyin": 1,
"alte": 1,
"socke": 1,
"wie": 1,
"kagge": 1,
"grandios": 1,
"eher": 1,
"flutschig": 1,
"oder": 1,
"fest": 1,
"meow": 3,
"rat": 1,
"rocket": 1,
"dazi": 1,
"yixue": 1,
"hongzi": 1,
"start": 1,
"ggggggggg": 1,
"ss": 2,
"lagguuuuu": 1,
"zijiren": 1,
"ziji": 1,
"dotatv": 1,
"tg": 1,
"skype": 1,
"qianmian": 1,
"walking": 1,
"qq": 1,
"lily": 2,
"lms": 1,
"boy": 1,
"rules": 1,
"arealy": 1,
"updated": 1,
"yeap": 1,
"working": 1,
"friends": 1,
"boss": 1,
"resume": 1,
"nyx": 1,
"gggggggggggg": 1,
"charm": 1,
"ddc": 1,
"yancih": 1,
"daili": 1,
"zhu": 2,
"-ms": 1,
"kjale": 1
}
} | odota/web/testcafe/cachedAjax/players_101695162_wordcloud_.json/0 | {
"file_path": "odota/web/testcafe/cachedAjax/players_101695162_wordcloud_.json",
"repo_id": "odota",
"token_count": 25070
} | 277 |
[
{
"table_name": "api_key_usage",
"column_name": "account_id",
"data_type": "bigint"
},
{
"table_name": "api_key_usage",
"column_name": "customer_id",
"data_type": "text"
},
{
"table_name": "api_key_usage",
"column_name": "api_key",
"data_type": "uuid"
},
{
"table_name": "api_key_usage",
"column_name": "usage_count",
"data_type": "bigint"
},
{
"table_name": "api_key_usage",
"column_name": "ip",
"data_type": "text"
},
{
"table_name": "api_key_usage",
"column_name": "timestamp",
"data_type": "timestamp without time zone"
},
{
"table_name": "api_keys",
"column_name": "account_id",
"data_type": "bigint"
},
{
"table_name": "api_keys",
"column_name": "api_key",
"data_type": "uuid"
},
{
"table_name": "api_keys",
"column_name": "customer_id",
"data_type": "text"
},
{
"table_name": "api_keys",
"column_name": "subscription_id",
"data_type": "text"
},
{
"table_name": "competitive_rank",
"column_name": "account_id",
"data_type": "bigint"
},
{
"table_name": "competitive_rank",
"column_name": "rating",
"data_type": "integer"
},
{
"table_name": "cosmetics",
"column_name": "item_id",
"data_type": "integer"
},
{
"table_name": "cosmetics",
"column_name": "name",
"data_type": "text"
},
{
"table_name": "cosmetics",
"column_name": "prefab",
"data_type": "text"
},
{
"table_name": "cosmetics",
"column_name": "creation_date",
"data_type": "timestamp with time zone"
},
{
"table_name": "cosmetics",
"column_name": "image_inventory",
"data_type": "text"
},
{
"table_name": "cosmetics",
"column_name": "image_path",
"data_type": "text"
},
{
"table_name": "cosmetics",
"column_name": "item_description",
"data_type": "text"
},
{
"table_name": "cosmetics",
"column_name": "item_name",
"data_type": "text"
},
{
"table_name": "cosmetics",
"column_name": "item_rarity",
"data_type": "text"
},
{
"table_name": "cosmetics",
"column_name": "item_type_name",
"data_type": "text"
},
{
"table_name": "cosmetics",
"column_name": "used_by_heroes",
"data_type": "text"
},
{
"table_name": "hero_ranking",
"column_name": "account_id",
"data_type": "bigint"
},
{
"table_name": "hero_ranking",
"column_name": "hero_id",
"data_type": "integer"
},
{
"table_name": "hero_ranking",
"column_name": "score",
"data_type": "double precision"
},
{
"table_name": "heroes",
"column_name": "id",
"data_type": "integer"
},
{
"table_name": "heroes",
"column_name": "name",
"data_type": "text"
},
{
"table_name": "heroes",
"column_name": "localized_name",
"data_type": "text"
},
{
"table_name": "heroes",
"column_name": "primary_attr",
"data_type": "text"
},
{
"table_name": "heroes",
"column_name": "attack_type",
"data_type": "text"
},
{
"table_name": "heroes",
"column_name": "roles",
"data_type": "ARRAY"
},
{
"table_name": "heroes",
"column_name": "legs",
"data_type": "integer"
},
{
"table_name": "items",
"column_name": "id",
"data_type": "integer"
},
{
"table_name": "items",
"column_name": "name",
"data_type": "text"
},
{
"table_name": "items",
"column_name": "cost",
"data_type": "integer"
},
{
"table_name": "items",
"column_name": "secret_shop",
"data_type": "smallint"
},
{
"table_name": "items",
"column_name": "side_shop",
"data_type": "smallint"
},
{
"table_name": "items",
"column_name": "recipe",
"data_type": "smallint"
},
{
"table_name": "items",
"column_name": "localized_name",
"data_type": "text"
},
{
"table_name": "leaderboard_rank",
"column_name": "account_id",
"data_type": "bigint"
},
{
"table_name": "leaderboard_rank",
"column_name": "rating",
"data_type": "integer"
},
{
"table_name": "leagues",
"column_name": "leagueid",
"data_type": "bigint"
},
{
"table_name": "leagues",
"column_name": "ticket",
"data_type": "character varying"
},
{
"table_name": "leagues",
"column_name": "banner",
"data_type": "character varying"
},
{
"table_name": "leagues",
"column_name": "tier",
"data_type": "character varying"
},
{
"table_name": "leagues",
"column_name": "name",
"data_type": "character varying"
},
{
"table_name": "match_gcdata",
"column_name": "match_id",
"data_type": "bigint"
},
{
"table_name": "match_gcdata",
"column_name": "cluster",
"data_type": "integer"
},
{
"table_name": "match_gcdata",
"column_name": "replay_salt",
"data_type": "integer"
},
{
"table_name": "match_gcdata",
"column_name": "series_id",
"data_type": "integer"
},
{
"table_name": "match_gcdata",
"column_name": "series_type",
"data_type": "integer"
},
{
"table_name": "match_logs",
"column_name": "match_id",
"data_type": "bigint"
},
{
"table_name": "match_logs",
"column_name": "time",
"data_type": "integer"
},
{
"table_name": "match_logs",
"column_name": "type",
"data_type": "character varying"
},
{
"table_name": "match_logs",
"column_name": "team",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "unit",
"data_type": "character varying"
},
{
"table_name": "match_logs",
"column_name": "key",
"data_type": "character varying"
},
{
"table_name": "match_logs",
"column_name": "value",
"data_type": "integer"
},
{
"table_name": "match_logs",
"column_name": "slot",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "player_slot",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "player1",
"data_type": "integer"
},
{
"table_name": "match_logs",
"column_name": "player2",
"data_type": "integer"
},
{
"table_name": "match_logs",
"column_name": "attackerhero",
"data_type": "boolean"
},
{
"table_name": "match_logs",
"column_name": "targethero",
"data_type": "boolean"
},
{
"table_name": "match_logs",
"column_name": "attackerillusion",
"data_type": "boolean"
},
{
"table_name": "match_logs",
"column_name": "targetillusion",
"data_type": "boolean"
},
{
"table_name": "match_logs",
"column_name": "inflictor",
"data_type": "character varying"
},
{
"table_name": "match_logs",
"column_name": "gold_reason",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "xp_reason",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "valuename",
"data_type": "character varying"
},
{
"table_name": "match_logs",
"column_name": "gold",
"data_type": "integer"
},
{
"table_name": "match_logs",
"column_name": "lh",
"data_type": "integer"
},
{
"table_name": "match_logs",
"column_name": "xp",
"data_type": "integer"
},
{
"table_name": "match_logs",
"column_name": "x",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "y",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "z",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "entityleft",
"data_type": "boolean"
},
{
"table_name": "match_logs",
"column_name": "ehandle",
"data_type": "integer"
},
{
"table_name": "match_logs",
"column_name": "stuns",
"data_type": "real"
},
{
"table_name": "match_logs",
"column_name": "hero_id",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "life_state",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "level",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "kills",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "deaths",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "assists",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "denies",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "attackername_slot",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "targetname_slot",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "sourcename_slot",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "targetsourcename_slot",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "player1_slot",
"data_type": "smallint"
},
{
"table_name": "match_logs",
"column_name": "attackername",
"data_type": "character varying"
},
{
"table_name": "match_logs",
"column_name": "targetname",
"data_type": "character varying"
},
{
"table_name": "match_logs",
"column_name": "sourcename",
"data_type": "character varying"
},
{
"table_name": "match_logs",
"column_name": "targetsourcename",
"data_type": "character varying"
},
{
"table_name": "match_logs",
"column_name": "obs_placed",
"data_type": "integer"
},
{
"table_name": "match_logs",
"column_name": "sen_placed",
"data_type": "integer"
},
{
"table_name": "match_logs",
"column_name": "creeps_stacked",
"data_type": "integer"
},
{
"table_name": "match_logs",
"column_name": "camps_stacked",
"data_type": "integer"
},
{
"table_name": "match_logs",
"column_name": "rune_pickups",
"data_type": "integer"
},
{
"table_name": "match_patch",
"column_name": "match_id",
"data_type": "bigint"
},
{
"table_name": "match_patch",
"column_name": "patch",
"data_type": "text"
},
{
"table_name": "matches",
"column_name": "match_id",
"data_type": "bigint"
},
{
"table_name": "matches",
"column_name": "match_seq_num",
"data_type": "bigint"
},
{
"table_name": "matches",
"column_name": "radiant_win",
"data_type": "boolean"
},
{
"table_name": "matches",
"column_name": "start_time",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "duration",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "tower_status_radiant",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "tower_status_dire",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "barracks_status_radiant",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "barracks_status_dire",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "cluster",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "first_blood_time",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "lobby_type",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "human_players",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "leagueid",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "positive_votes",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "negative_votes",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "game_mode",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "engine",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "picks_bans",
"data_type": "ARRAY"
},
{
"table_name": "matches",
"column_name": "radiant_team_id",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "dire_team_id",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "radiant_team_name",
"data_type": "character varying"
},
{
"table_name": "matches",
"column_name": "dire_team_name",
"data_type": "character varying"
},
{
"table_name": "matches",
"column_name": "radiant_team_complete",
"data_type": "smallint"
},
{
"table_name": "matches",
"column_name": "dire_team_complete",
"data_type": "smallint"
},
{
"table_name": "matches",
"column_name": "radiant_captain",
"data_type": "bigint"
},
{
"table_name": "matches",
"column_name": "dire_captain",
"data_type": "bigint"
},
{
"table_name": "matches",
"column_name": "chat",
"data_type": "ARRAY"
},
{
"table_name": "matches",
"column_name": "objectives",
"data_type": "ARRAY"
},
{
"table_name": "matches",
"column_name": "radiant_gold_adv",
"data_type": "ARRAY"
},
{
"table_name": "matches",
"column_name": "radiant_xp_adv",
"data_type": "ARRAY"
},
{
"table_name": "matches",
"column_name": "teamfights",
"data_type": "ARRAY"
},
{
"table_name": "matches",
"column_name": "version",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "cosmetics",
"data_type": "json"
},
{
"table_name": "matches",
"column_name": "radiant_score",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "dire_score",
"data_type": "integer"
},
{
"table_name": "matches",
"column_name": "draft_timings",
"data_type": "ARRAY"
},
{
"table_name": "mmr_estimates",
"column_name": "account_id",
"data_type": "bigint"
},
{
"table_name": "mmr_estimates",
"column_name": "estimate",
"data_type": "integer"
},
{
"table_name": "notable_players",
"column_name": "account_id",
"data_type": "bigint"
},
{
"table_name": "notable_players",
"column_name": "name",
"data_type": "character varying"
},
{
"table_name": "notable_players",
"column_name": "country_code",
"data_type": "character varying"
},
{
"table_name": "notable_players",
"column_name": "fantasy_role",
"data_type": "integer"
},
{
"table_name": "notable_players",
"column_name": "team_id",
"data_type": "integer"
},
{
"table_name": "notable_players",
"column_name": "team_name",
"data_type": "character varying"
},
{
"table_name": "notable_players",
"column_name": "team_tag",
"data_type": "character varying"
},
{
"table_name": "notable_players",
"column_name": "is_locked",
"data_type": "boolean"
},
{
"table_name": "notable_players",
"column_name": "is_pro",
"data_type": "boolean"
},
{
"table_name": "notable_players",
"column_name": "locked_until",
"data_type": "integer"
},
{
"table_name": "picks_bans",
"column_name": "match_id",
"data_type": "bigint"
},
{
"table_name": "picks_bans",
"column_name": "is_pick",
"data_type": "boolean"
},
{
"table_name": "picks_bans",
"column_name": "hero_id",
"data_type": "integer"
},
{
"table_name": "picks_bans",
"column_name": "team",
"data_type": "smallint"
},
{
"table_name": "picks_bans",
"column_name": "ord",
"data_type": "smallint"
},
{
"table_name": "player_matches",
"column_name": "match_id",
"data_type": "bigint"
},
{
"table_name": "player_matches",
"column_name": "account_id",
"data_type": "bigint"
},
{
"table_name": "player_matches",
"column_name": "player_slot",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "hero_id",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "item_0",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "item_1",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "item_2",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "item_3",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "item_4",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "item_5",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "kills",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "deaths",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "assists",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "leaver_status",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "gold",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "last_hits",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "denies",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "gold_per_min",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "xp_per_min",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "gold_spent",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "hero_damage",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "tower_damage",
"data_type": "bigint"
},
{
"table_name": "player_matches",
"column_name": "hero_healing",
"data_type": "bigint"
},
{
"table_name": "player_matches",
"column_name": "level",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "additional_units",
"data_type": "ARRAY"
},
{
"table_name": "player_matches",
"column_name": "stuns",
"data_type": "real"
},
{
"table_name": "player_matches",
"column_name": "max_hero_hit",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "times",
"data_type": "ARRAY"
},
{
"table_name": "player_matches",
"column_name": "gold_t",
"data_type": "ARRAY"
},
{
"table_name": "player_matches",
"column_name": "lh_t",
"data_type": "ARRAY"
},
{
"table_name": "player_matches",
"column_name": "xp_t",
"data_type": "ARRAY"
},
{
"table_name": "player_matches",
"column_name": "obs_log",
"data_type": "ARRAY"
},
{
"table_name": "player_matches",
"column_name": "sen_log",
"data_type": "ARRAY"
},
{
"table_name": "player_matches",
"column_name": "purchase_log",
"data_type": "ARRAY"
},
{
"table_name": "player_matches",
"column_name": "kills_log",
"data_type": "ARRAY"
},
{
"table_name": "player_matches",
"column_name": "buyback_log",
"data_type": "ARRAY"
},
{
"table_name": "player_matches",
"column_name": "lane_pos",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "obs",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "sen",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "actions",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "pings",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "purchase",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "gold_reasons",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "xp_reasons",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "killed",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "item_uses",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "ability_uses",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "hero_hits",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "damage",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "damage_taken",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "damage_inflictor",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "runes",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "killed_by",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "kill_streaks",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "multi_kills",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "life_state",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "damage_inflictor_received",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "obs_placed",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "sen_placed",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "creeps_stacked",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "camps_stacked",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "rune_pickups",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "obs_left_log",
"data_type": "ARRAY"
},
{
"table_name": "player_matches",
"column_name": "sen_left_log",
"data_type": "ARRAY"
},
{
"table_name": "player_matches",
"column_name": "ability_upgrades_arr",
"data_type": "ARRAY"
},
{
"table_name": "player_matches",
"column_name": "party_id",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "permanent_buffs",
"data_type": "ARRAY"
},
{
"table_name": "player_matches",
"column_name": "backpack_0",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "backpack_1",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "backpack_2",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "runes_log",
"data_type": "ARRAY"
},
{
"table_name": "player_matches",
"column_name": "lane",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "lane_role",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "is_roaming",
"data_type": "boolean"
},
{
"table_name": "player_matches",
"column_name": "firstblood_claimed",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "teamfight_participation",
"data_type": "real"
},
{
"table_name": "player_matches",
"column_name": "towers_killed",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "roshans_killed",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "observers_placed",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "party_size",
"data_type": "integer"
},
{
"table_name": "player_matches",
"column_name": "ability_targets",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "damage_targets",
"data_type": "json"
},
{
"table_name": "player_matches",
"column_name": "dn_t",
"data_type": "ARRAY"
},
{
"table_name": "player_ratings",
"column_name": "account_id",
"data_type": "bigint"
},
{
"table_name": "player_ratings",
"column_name": "match_id",
"data_type": "bigint"
},
{
"table_name": "player_ratings",
"column_name": "solo_competitive_rank",
"data_type": "integer"
},
{
"table_name": "player_ratings",
"column_name": "competitive_rank",
"data_type": "integer"
},
{
"table_name": "player_ratings",
"column_name": "time",
"data_type": "timestamp with time zone"
},
{
"table_name": "players",
"column_name": "account_id",
"data_type": "bigint"
},
{
"table_name": "players",
"column_name": "steamid",
"data_type": "character varying"
},
{
"table_name": "players",
"column_name": "avatar",
"data_type": "character varying"
},
{
"table_name": "players",
"column_name": "avatarmedium",
"data_type": "character varying"
},
{
"table_name": "players",
"column_name": "avatarfull",
"data_type": "character varying"
},
{
"table_name": "players",
"column_name": "profileurl",
"data_type": "character varying"
},
{
"table_name": "players",
"column_name": "personaname",
"data_type": "character varying"
},
{
"table_name": "players",
"column_name": "last_login",
"data_type": "timestamp with time zone"
},
{
"table_name": "players",
"column_name": "full_history_time",
"data_type": "timestamp with time zone"
},
{
"table_name": "players",
"column_name": "cheese",
"data_type": "integer"
},
{
"table_name": "players",
"column_name": "fh_unavailable",
"data_type": "boolean"
},
{
"table_name": "players",
"column_name": "loccountrycode",
"data_type": "character varying"
},
{
"table_name": "players",
"column_name": "last_match_time",
"data_type": "timestamp with time zone"
},
{
"table_name": "public_matches",
"column_name": "match_id",
"data_type": "bigint"
},
{
"table_name": "public_matches",
"column_name": "match_seq_num",
"data_type": "bigint"
},
{
"table_name": "public_matches",
"column_name": "radiant_win",
"data_type": "boolean"
},
{
"table_name": "public_matches",
"column_name": "start_time",
"data_type": "integer"
},
{
"table_name": "public_matches",
"column_name": "duration",
"data_type": "integer"
},
{
"table_name": "public_matches",
"column_name": "avg_mmr",
"data_type": "integer"
},
{
"table_name": "public_matches",
"column_name": "num_mmr",
"data_type": "integer"
},
{
"table_name": "public_matches",
"column_name": "lobby_type",
"data_type": "integer"
},
{
"table_name": "public_matches",
"column_name": "game_mode",
"data_type": "integer"
},
{
"table_name": "public_matches",
"column_name": "avg_rank_tier",
"data_type": "double precision"
},
{
"table_name": "public_matches",
"column_name": "num_rank_tier",
"data_type": "integer"
},
{
"table_name": "public_matches",
"column_name": "cluster",
"data_type": "integer"
},
{
"table_name": "public_player_matches",
"column_name": "match_id",
"data_type": "bigint"
},
{
"table_name": "public_player_matches",
"column_name": "player_slot",
"data_type": "integer"
},
{
"table_name": "public_player_matches",
"column_name": "hero_id",
"data_type": "integer"
},
{
"table_name": "queue",
"column_name": "id",
"data_type": "bigint"
},
{
"table_name": "queue",
"column_name": "type",
"data_type": "text"
},
{
"table_name": "queue",
"column_name": "timestamp",
"data_type": "timestamp with time zone"
},
{
"table_name": "queue",
"column_name": "attempts",
"data_type": "integer"
},
{
"table_name": "queue",
"column_name": "data",
"data_type": "json"
},
{
"table_name": "queue",
"column_name": "next_attempt_time",
"data_type": "timestamp with time zone"
},
{
"table_name": "queue",
"column_name": "priority",
"data_type": "integer"
},
{
"table_name": "rank_tier",
"column_name": "account_id",
"data_type": "bigint"
},
{
"table_name": "rank_tier",
"column_name": "rating",
"data_type": "integer"
},
{
"table_name": "scenarios",
"column_name": "hero_id",
"data_type": "smallint"
},
{
"table_name": "scenarios",
"column_name": "item",
"data_type": "text"
},
{
"table_name": "scenarios",
"column_name": "time",
"data_type": "integer"
},
{
"table_name": "scenarios",
"column_name": "lane_role",
"data_type": "smallint"
},
{
"table_name": "scenarios",
"column_name": "games",
"data_type": "bigint"
},
{
"table_name": "scenarios",
"column_name": "wins",
"data_type": "bigint"
},
{
"table_name": "scenarios",
"column_name": "epoch_week",
"data_type": "integer"
},
{
"table_name": "solo_competitive_rank",
"column_name": "account_id",
"data_type": "bigint"
},
{
"table_name": "solo_competitive_rank",
"column_name": "rating",
"data_type": "integer"
},
{
"table_name": "subscriptions",
"column_name": "account_id",
"data_type": "bigint"
},
{
"table_name": "subscriptions",
"column_name": "customer_id",
"data_type": "character varying"
},
{
"table_name": "subscriptions",
"column_name": "amount",
"data_type": "integer"
},
{
"table_name": "subscriptions",
"column_name": "active_until",
"data_type": "date"
},
{
"table_name": "team_match",
"column_name": "team_id",
"data_type": "bigint"
},
{
"table_name": "team_match",
"column_name": "match_id",
"data_type": "bigint"
},
{
"table_name": "team_match",
"column_name": "radiant",
"data_type": "boolean"
},
{
"table_name": "team_rating",
"column_name": "team_id",
"data_type": "bigint"
},
{
"table_name": "team_rating",
"column_name": "rating",
"data_type": "real"
},
{
"table_name": "team_rating",
"column_name": "wins",
"data_type": "integer"
},
{
"table_name": "team_rating",
"column_name": "losses",
"data_type": "integer"
},
{
"table_name": "team_rating",
"column_name": "last_match_time",
"data_type": "bigint"
},
{
"table_name": "team_scenarios",
"column_name": "scenario",
"data_type": "text"
},
{
"table_name": "team_scenarios",
"column_name": "is_radiant",
"data_type": "boolean"
},
{
"table_name": "team_scenarios",
"column_name": "region",
"data_type": "smallint"
},
{
"table_name": "team_scenarios",
"column_name": "games",
"data_type": "bigint"
},
{
"table_name": "team_scenarios",
"column_name": "wins",
"data_type": "bigint"
},
{
"table_name": "team_scenarios",
"column_name": "epoch_week",
"data_type": "integer"
},
{
"table_name": "teams",
"column_name": "team_id",
"data_type": "bigint"
},
{
"table_name": "teams",
"column_name": "name",
"data_type": "character varying"
},
{
"table_name": "teams",
"column_name": "tag",
"data_type": "character varying"
},
{
"table_name": "teams",
"column_name": "logo_url",
"data_type": "text"
},
{
"table_name": "user_usage",
"column_name": "account_id",
"data_type": "bigint"
},
{
"table_name": "user_usage",
"column_name": "ip",
"data_type": "text"
},
{
"table_name": "user_usage",
"column_name": "usage_count",
"data_type": "bigint"
},
{
"table_name": "user_usage",
"column_name": "timestamp",
"data_type": "timestamp without time zone"
}
] | odota/web/testcafe/cachedAjax/schema.json/0 | {
"file_path": "odota/web/testcafe/cachedAjax/schema.json",
"repo_id": "odota",
"token_count": 13923
} | 278 |
<p align="center">
<a aria-label="open.mp logo" href="https://open.mp">
<img src="https://assets.open.mp/assets/images/assets/wordmark-light-mono.png" width="420" />
</a>
</p>
<p align="center">
<em>open.mp multiplayer game framework</em>
</p>
<p align="center">
<a
href="https://open.mp/docs"
>Wiki</a>
|
<a
href="https://discord.gg/samp"
>Discord</a>
</p>
<p align="center">
A multiplayer mod for Grand Theft Auto: San Andreas that is fully backwards
compatible with San Andreas Multiplayer.
</p>
<p align="center">
<a href="https://www.open.mp">open.mp</a>
</p>
<hr>
# open.mp Web Services
This monorepo contains the web services and documentation for open.mp and SA-MP.
## Overview
- `docs/` Wiki documentation for SA-MP and open.mp in Markdown format including translations.
- `emails/` [MJML](https://mjml.io) email templates for account registration and other things.
- `frontend/` [Next.js](https://nextjs.org) app for the https://open.mp site.
- `prisma/` [Prisma](https://prisma.io/) database models for generating Go code and SQL migrations.
- `app/` Backend API for server listings, accounts, etc.
## Frontend Development
To work on the frontend, you mostly only need to focus on the `frontend/` directory. Run `npm` commands in there such as `npm run dev`. See the readme file in there for more details.
The only files that the frontend need that _are not_ in that directory are `docs/` which it uses to for the https://open.mp/docs pages. `.env` is not used for frontend development.
## Backend/Full Stack Development
When working on the backend, the root of the repository is where you need to be. The server application will assume it's being run from the root, _not_ from within `cmd/`.
To start the API server, use [Taskfile](https://taskfile.dev) and run `task`, the default task is to build and run the API server.
The frontend, by default, only uses the live API. To change this you must edit any URLs from `https://api.open.mp/...` to `http://localhost/...`.
You can run the following command to get a minimal development environment ready:
```
docker-compose -f .\docker-compose.dev.yml up -d
```
The `.dev.yml` Compose configuration contains services that aren't secure or production ready and suitable for local testing.
## Deployment
The frontend is deployed directly to [Vercel](https://vercel.com) from the `master` branch.
The backend is deployed to a server from the `master` branch using the `docker-compose.yml` file. You can simulate a production deployment by running `docker-compose up`.
### Uploading Assets
We host large static assets such as images and videos on an S3-compatible object storage. This runs at `assets.open.mp` and you can use the task `upload-assets` to upload all public assets from `frontend/public`.
The easiest way to do this is via the [Minio client](https://docs.min.io/docs/minio-client-quickstart-guide.html). Once installed, set up an alias called `omp`:
```
mc alias set omp https://assets.open.mp ACCESS_KEY SECRET_KEY
```
Replace the two keys with the real keys.
Then run the task:
```
task upload-assets
```
| openmultiplayer/web/README.md/0 | {
"file_path": "openmultiplayer/web/README.md",
"repo_id": "openmultiplayer",
"token_count": 956
} | 279 |
package server
import (
"errors"
"time"
"github.com/openmultiplayer/web/internal/db"
)
// All contains all the information associated with a game server including the core information, the standard SA:MP
// "rules" and "players" lists as well as any additional fields to enhance the server browsing experience.
type All struct {
IP string `json:"ip"`
Domain *string `json:"dm"`
Core Essential `json:"core"`
Rules map[string]string `json:"ru,omitempty"`
Description *string `json:"description"`
Banner *string `json:"banner"`
Active bool `json:"active"`
Pending bool `json:"pending"`
LastUpdated time.Time `json:"lastUpdated"`
LastActive *time.Time `json:"lastActive"`
}
// Essential stores the standard SA:MP 'info' query fields necessary for server
// lists. The json keys are short to cut down on network traffic since these are
// the objects returned to a listing request which could contain hundreds of
// objects.
type Essential struct {
IP string `json:"ip"`
Hostname string `json:"hn"`
Players int64 `json:"pc"`
MaxPlayers int64 `json:"pm"`
Gamemode string `json:"gm"`
Language string `json:"la"`
Password bool `json:"pa"`
Version string `json:"vn"`
IsOmp bool `json:"omp"`
Partner bool `json:"pr"`
}
// Validate checks the contents of a Server object to ensure all the required fields are valid.
func (server *All) Validate() (errs []error) {
_, addrErrs := AddressFromString(server.Core.IP)
errs = append(errs, addrErrs...)
if len(server.Core.Hostname) < 1 {
errs = append(errs, errors.New("hostname is empty"))
}
if server.Core.MaxPlayers == 0 {
errs = append(errs, errors.New("maxplayers is empty"))
}
if len(server.Core.Gamemode) < 1 {
errs = append(errs, errors.New("gamemode is empty"))
}
return
}
// Example returns an example of a server
func (server All) Example() All {
return All{
Core: Essential{
IP: "127.0.0.1:7777",
Hostname: "SA-MP SERVER CLAN tdm [NGRP] [GF EDIT] [Y_INI] [RUS] [BASIC] [GODFATHER] [REFUNDING] [STRCMP]",
Players: 32,
MaxPlayers: 128,
Gamemode: "Grand Larceny",
Language: "English",
Password: false,
Version: "0.3.7-R2",
},
Rules: map[string]string{
"lagcomp": "On",
"mapname": "San Andreas",
"version": "0.3.7-R2",
"weather": "10",
"weburl": "www.sa-mp.mp",
"worldtime": "10:00",
},
Description: &[]string{"An awesome server! Come and play with us."}[0],
Banner: &[]string{"https://i.imgur.com/Juaezhv.jpg"}[0],
Active: true,
}
}
func dbToAPI(r db.ServerModel) *All {
return &All{
IP: r.IP,
Domain: r.InnerServer.Domain,
Core: Essential{
IP: r.IP,
Hostname: r.Hn,
Players: int64(r.Pc),
MaxPlayers: int64(r.Pm),
Gamemode: r.Gm,
Language: r.La,
Password: r.Pa,
Version: r.Vn,
IsOmp: r.Omp,
Partner: r.Partner,
},
Rules: transformRules(r.Ru()),
Description: r.InnerServer.Description,
Banner: r.InnerServer.Banner,
Active: r.Active,
Pending: r.Pending,
LastUpdated: r.UpdatedAt,
LastActive: r.InnerServer.LastActive,
}
}
func dbToAPISlice(r []db.ServerModel) []All {
result := []All{}
for _, s := range r {
obj := dbToAPI(s)
result = append(result, *obj)
}
return result
}
func transformRules(ru []db.RuleModel) map[string]string {
out := make(map[string]string)
for _, r := range ru {
out[r.Name] = r.Value
}
return out
}
| openmultiplayer/web/app/resources/server/model.go/0 | {
"file_path": "openmultiplayer/web/app/resources/server/model.go",
"repo_id": "openmultiplayer",
"token_count": 1575
} | 280 |
package scraper
import (
"context"
"go.uber.org/zap"
"github.com/openmultiplayer/web/app/resources/server"
"github.com/openmultiplayer/web/app/services/queryer"
)
type SimpleScraper struct {
Q queryer.Queryer
}
func (s *SimpleScraper) Scrape(ctx context.Context, addresses []string) []server.Essential {
zap.L().Debug("starting bulk query", zap.Int("servers", len(addresses)))
result := []server.Essential{}
failures := 0
for i, addr := range addresses {
s, err := s.Q.Query(ctx, addr)
if err != nil {
failures += 1
zap.L().Error("failed", zap.String("addr", addr), zap.Error(err))
continue
}
result = append(result, server.Essential{
IP: s.Address,
Hostname: s.Hostname,
Players: int64(s.Players),
MaxPlayers: int64(s.MaxPlayers),
Gamemode: s.Gamemode,
Language: s.Language,
Password: s.Password,
IsOmp: s.IsOmp,
// Version
})
// TODO:
// Rules
// Ping
if i%10 == 0 {
zap.L().Debug("query progress", zap.Int("n", i), zap.Int("of", len(addresses)))
}
}
zap.L().Debug("finished bulk query",
zap.Int("servers", len(result)),
zap.Int("failures", failures))
return result
}
| openmultiplayer/web/app/services/scraper/simple.go/0 | {
"file_path": "openmultiplayer/web/app/services/scraper/simple.go",
"repo_id": "openmultiplayer",
"token_count": 498
} | 281 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.