-
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): Begin typing the redux code (#20457)
* chore(gatsby): Begin typing the redux code * fix tests * undo file resets * move files for git history; * fix a test * some changes to try to address test failures * try to fix this.. * fix imports for es6 code exports * fix more tests * Fix types and async code * undo * isolate different tests * activate all of CI again
- Loading branch information
1 parent
7d4d212
commit 42da5af
Showing
13 changed files
with
235 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
const babelPreset = require(`babel-preset-gatsby-package`)() | ||
module.exports = require(`babel-jest`).createTransformer(babelPreset) | ||
module.exports = require(`babel-jest`).createTransformer({ | ||
...babelPreset, | ||
overrides: [ | ||
...(babelPreset.overrides || []), | ||
{ | ||
test: `**/*.ts`, | ||
plugins: [[`@babel/plugin-transform-typescript`, { isTSX: true }]], | ||
}, | ||
], | ||
}) |
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 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 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,12 @@ | ||
import v8 from "v8" | ||
import { readFileSync, writeFileSync } from "fs-extra" | ||
import { IReduxState } from "./types" | ||
|
||
const file = (): string => `${process.cwd()}/.cache/redux.state` | ||
|
||
export const readFromCache = (): IReduxState => | ||
v8.deserialize(readFileSync(file())) | ||
|
||
export const writeToCache = (contents: IReduxState): void => { | ||
writeFileSync(file(), v8.serialize(contents)) | ||
} |
Oops, something went wrong.