Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
‘npm run clean’ bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Can-Sahin committed Dec 23, 2018
1 parent aded546 commit 411b97d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
12 changes: 7 additions & 5 deletions internals/scripts/clean.js
Expand Up @@ -39,12 +39,14 @@ shell.rm('-rf', 'app/utils');
shell.mv('internals/templates/utils', 'app');

// Replace the files in the root app/ folder
shell.cp('internals/templates/app.js', 'app/app.js');
shell.cp('internals/templates/global-styles.js', 'app/global-styles.js');
shell.cp('internals/templates/i18n.js', 'app/i18n.js');
shell.cp('internals/templates/app.tsx', 'app/app.tsx');
shell.cp('internals/templates/global-styles.ts', 'app/global-styles.ts');
shell.cp('internals/templates/i18n.ts', 'app/i18n.ts');
shell.cp('internals/templates/index.html', 'app/index.html');
shell.cp('internals/templates/reducers.js', 'app/reducers.js');
shell.cp('internals/templates/configureStore.js', 'app/configureStore.js');
shell.cp('internals/templates/reducers.ts', 'app/reducers.ts');
shell.cp('internals/templates/configureStore.ts', 'app/configureStore.ts');

shell.cp('internals/templates/types/index.d.ts', 'app/types/index.d.ts');

// Remove the templates folder
shell.rm('-rf', 'internals/templates');
Expand Down
2 changes: 0 additions & 2 deletions internals/templates/reducers.ts
Expand Up @@ -6,15 +6,13 @@ import { combineReducers } from 'redux';
import { connectRouter } from 'connected-react-router';

import history from 'utils/history';
import globalReducer from 'containers/App/reducer';
import languageProviderReducer from 'containers/LanguageProvider/reducer';

/**
* Merges the main reducer with the router state and dynamically injected reducers
*/
export default function createReducer(injectedReducers = {}) {
const rootReducer = combineReducers({
global: globalReducer,
language: languageProviderReducer,
...injectedReducers,
});
Expand Down
28 changes: 28 additions & 0 deletions internals/templates/types/index.d.ts
@@ -0,0 +1,28 @@
import { Reducer, Store } from 'redux';
import { RouterState } from 'connected-react-router';
import { ILanguageProviderProps } from 'containers/LanguageProvider';

export interface LifeStore extends Store<{}> {
injectedReducers?: any;
injectedSagas?: any;
runSaga(saga: () => IterableIterator<any>, args: any): any;
}

export interface InjectReducerParams {
key: keyof ApplicationRootState;
reducer: Reducer<any, any>;
}

export interface InjectSagaParams {
key: keyof ApplicationRootState;
saga: () => IterableIterator<any>;
mode?: string | undefined;
}

// Your root reducer type, which is your redux state types also
export interface ApplicationRootState {
readonly router: RouterState;
readonly language: ILanguageProviderProps;
// for testing purposes
readonly test: any;
}

0 comments on commit 411b97d

Please sign in to comment.