Skip to content

Commit

Permalink
Revert "refactor(dirs) move shared code into consistent location"
Browse files Browse the repository at this point in the history
This reverts commit 5b0d3bb.

create-react-app does not compile symlinked files:

facebook/create-react-app#3547
  • Loading branch information
Tim Stirrat committed Apr 3, 2018
1 parent 4cc8d59 commit f703c3b
Show file tree
Hide file tree
Showing 19 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## other configuration excluded from example...
exclude_patterns:
- "functions/shared/service/api/"
- "functions/service/api/"
- "src/shared/service/api/"
8 changes: 4 additions & 4 deletions functions/cli/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import * as admin from 'firebase-admin';
import jBinary = require('jbinary');

import { Physique, Player, PlayerAbilities, PlayerMotion } from '../shared/service/api';
import { Physique, Player, PlayerAbilities, PlayerMotion } from '../service/api';
import { EditFile, Player as PlayerBinary } from '../typesets/edit-file';

const serviceAccount = require(`${__dirname}/../../../config/service-account.json`);
Expand All @@ -12,9 +12,9 @@ const serviceAccount = require(`${__dirname}/../../../config/service-account.jso
*/
export async function load(
fileName: string,
limit = 100,
offset = 0,
batchSize = 500
limit: number = 100,
offset: number = 0,
batchSize: number = 500
) {
if (batchSize > 500) {
throw new Error('batch size cannot be > 500');
Expand Down
2 changes: 2 additions & 0 deletions functions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ exports.search = functions.https.onRequest(async (req, res) => {
const client = createClient(functions.config().es);
const response = await search(client, query);
console.log('[search] search complete', response);
console.log('updated with cors');
return res.set(CORS_HEADERS).send(response);
} catch (e) {
console.warn('[search] search failed with', e);
Expand Down Expand Up @@ -102,6 +103,7 @@ exports.suggest = functions.https.onRequest(async (req, res) => {
const client = createClient(functions.config().es);
const response = await suggest(client, query);
console.log('[suggest] suggest complete', response);
console.log('updated with cors');
return res.set(CORS_HEADERS).send(response);
} catch (e) {
console.warn('[suggest] suggest failed with', e);
Expand Down
4 changes: 2 additions & 2 deletions functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"test": "jest",
"watch": "tsc --watch -p ./",
"protos":
"pbjs -w commonjs -t static-module -o shared/service/api/index.js shared/service/api.proto shared/service/common.proto shared/service/player.proto",
"pbjs -w commonjs -t static-module -o service/api/index.js service/api.proto service/common.proto service/player.proto",
"api":
"yarn run protos; pbts -o shared/service/api/index.d.ts shared/service/api/index.js",
"yarn run protos; pbts -o service/api/index.d.ts service/api/index.js",
"deploy": "yarn build && firebase deploy --only functions",
"cli": "yarn build && node build/cli/index.js"
},
Expand Down
2 changes: 1 addition & 1 deletion functions/search.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Client } from 'elasticsearch';

import * as search from './search';
import { Country, Player } from './shared/service/api';
import { Country, Player } from './service/api';

describe('search', () => {
// tslint:disable-next-line:variable-name
Expand Down
2 changes: 1 addition & 1 deletion functions/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as AWS from 'aws-sdk';
import * as elasticsearch from 'elasticsearch';
import * as HttpAmazonESConnector from 'http-aws-es';

import { Player } from './shared/service/api';
import { Player } from './service/api';

export interface ClientConfig {
access_key_id?: string;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion functions/typesets/edit-file-test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import jBinary = require('jbinary');

import { Foot, PlayingStyle, Position, Skill } from '../shared/service/api';
import { Foot, PlayingStyle, Position, Skill } from '../service/api';
import { EditFile, Player } from './edit-file';

const attrs64File = `${__dirname}/../test/player-attrs-64.bin`;
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { Helmet } from 'react-helmet';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';

import { Player } from '../../../functions/service/api';
import * as search from '../../actions/search';
import { Loading } from '../../components/Loading';
import { PlayerTable } from '../../components/PlayerTable';
import * as fromRoot from '../../reducers';
import { Player } from '../../shared/service/api';

interface QueryParams {
query?: string;
Expand Down
1 change: 0 additions & 1 deletion src/shared

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions src/shared/service
File renamed without changes.
File renamed without changes.

0 comments on commit f703c3b

Please # to comment.