forked from wpengine/faustjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup config getter/setter (wpengine#945)
- Loading branch information
1 parent
ea72b90
commit 6de8204
Showing
7 changed files
with
65 additions
and
10 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { setConfig } from 'faust-nx'; | ||
import templates from './wp-templates'; | ||
|
||
/** | ||
* @type {import('faust-nx').FaustNXConfig} | ||
**/ | ||
export default setConfig({ | ||
templates, | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { WordPressTemplate } from '../getWordPressProps.js'; | ||
|
||
export interface FaustNXConfig { | ||
templates: { [key: string]: WordPressTemplate }; | ||
} | ||
|
||
let config = {}; | ||
|
||
export function setConfig(_config: FaustNXConfig) { | ||
config = _config; | ||
} | ||
|
||
export function getConfig(): Partial<FaustNXConfig> { | ||
return config; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
import { FaustNXProvider } from './components/FaustNXProvider'; | ||
import { WordPressTemplate } from './components/WordPressTemplate'; | ||
import { getWordPressProps } from './getWordPressProps'; | ||
import { getConfig, setConfig, FaustNXConfig } from './config/index.js'; | ||
|
||
export { FaustNXProvider, WordPressTemplate, getWordPressProps }; | ||
export { | ||
FaustNXProvider, | ||
WordPressTemplate, | ||
getWordPressProps, | ||
getConfig, | ||
setConfig, | ||
FaustNXConfig, | ||
}; |
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