-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(gatsby): Migrate reducers/index to TypeScript (#23877)
* Change file extension from JS to TS * Change reducer config export to ES6 module * Change imports and exports to ES6 modules * Change reducers import on redux index to use ES6 modules * Update reducers imports and exports * Comment unused codes * Update merge conflicts * Update nodesReducer module name * Update last-action state type * Fix merge conflicts * Revert api test snapshot * ops, actually fix merge conflicts Co-authored-by: Michal Piechowiak <[email protected]>
- Loading branch information
1 parent
75f059e
commit 3aec087
Showing
7 changed files
with
71 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { nodesReducer } from "./nodes" | ||
import { reducer as logReducer } from "gatsby-cli/lib/reporter/redux/reducer" | ||
import { pagesReducer } from "./pages" | ||
import { redirectsReducer } from "./redirects" | ||
import { schemaReducer } from "./schema" | ||
import { staticQueryComponentsReducer } from "./static-query-components" | ||
import { statusReducer } from "./status" | ||
import { webpackReducer } from "./webpack" | ||
import { pageDataReducer } from "./page-data" | ||
import { themesReducer } from "./themes" | ||
import { webpackCompilationHashReducer } from "./webpack-compilation-hash" | ||
import { configReducer } from "./config" | ||
import { lastActionReducer } from "./last-action" | ||
import { jobsV2Reducer } from "./jobsv2" | ||
import { pageDataStatsReducer } from "./page-data-stats" | ||
import { componentsReducer } from "./components" | ||
import { componentDataDependenciesReducer } from "./component-data-dependencies" | ||
import { babelrcReducer } from "./babelrc" | ||
import { jobsReducer } from "./jobs" | ||
import { nodesByTypeReducer } from "./nodes-by-type" | ||
import programReducer from "./program" | ||
import { resolvedNodesCacheReducer } from "./resolved-nodes" | ||
import { nodesTouchedReducer } from "./nodes-touched" | ||
import { flattenedPluginsReducer } from "./flattened-plugins" | ||
import schemaCustomizationReducer from "./schema-customization" | ||
import inferenceMetadataReducer from "./inference-metadata" | ||
|
||
/** | ||
* @property exports.nodesTouched Set<string> | ||
*/ | ||
export { | ||
programReducer as program, | ||
nodesReducer as nodes, | ||
nodesByTypeReducer as nodesByType, | ||
resolvedNodesCacheReducer as resolvedNodesCache, | ||
nodesTouchedReducer as nodesTouched, | ||
lastActionReducer as lastAction, | ||
flattenedPluginsReducer as flattenedPlugins, | ||
configReducer as config, | ||
schemaReducer as schema, | ||
pagesReducer as pages, | ||
statusReducer as status, | ||
componentDataDependenciesReducer as componentDataDependencies, | ||
componentsReducer as components, | ||
staticQueryComponentsReducer as staticQueryComponents, | ||
jobsReducer as jobs, | ||
jobsV2Reducer as jobsV2, | ||
webpackReducer as webpack, | ||
webpackCompilationHashReducer as webpackCompilationHash, | ||
redirectsReducer as redirects, | ||
babelrcReducer as babelrc, | ||
schemaCustomizationReducer as schemaCustomization, | ||
themesReducer as themes, | ||
logReducer as logs, | ||
inferenceMetadataReducer as inferenceMetadata, | ||
pageDataStatsReducer as pageDataStats, | ||
pageDataReducer as pageData, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { IGatsbyState, ActionsUnion } from "../types" | ||
|
||
export const lastAction = ( | ||
_state: IGatsbyState["lastAction"], | ||
export const lastActionReducer = ( | ||
_state: unknown, | ||
action: ActionsUnion | ||
): IGatsbyState["lastAction"] => action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters