-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve test command, support dotenv files, add postcss (#52)
* fix: support all the icon variants and update index.html * feat: add Roboto typeface to shell * chore: dynamically import AppAdapter to create a separate chunk * fix: target node for tests * fix: remove reference to non-existent manifest.json * feat: improve jest config, support snapshots and watch, add postcss * chore: automatically include app name in browser title * chore: re-add DOCTYPE declaration to index.html * chore: name app bundles (app-adapter is external) * chore: delete unused manifest.json
- Loading branch information
Showing
27 changed files
with
3,851 additions
and
258 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
module.exports = { | ||
verbose: true, | ||
transform: JSON.stringify({ | ||
transform: { | ||
'^.+\\.[t|j]sx?$': require.resolve('./jest.transform.js'), | ||
}), | ||
}, | ||
moduleNameMapper: { | ||
'^.+\\.(css|less)$': require.resolve('./jest.identity.mock.js'), | ||
}, | ||
} |
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 @@ | ||
module.exports = {} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const fs = require('fs') | ||
const dotenvExpand = require('dotenv-expand') | ||
const dotenv = require('dotenv') | ||
|
||
const { reporter } = require('@dhis2/cli-helpers-engine') | ||
|
||
module.exports = (paths, NODE_ENV) => { | ||
/* | ||
* Heavily inspired by create-react-app | ||
* https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/config/env.js | ||
*/ | ||
|
||
const dotenvFiles = [ | ||
NODE_ENV && `${paths.dotenv}.${NODE_ENV}.local`, | ||
NODE_ENV && `${paths.dotenv}.${NODE_ENV}`, | ||
NODE_ENV !== 'test' && `${paths.dotenv}.local`, | ||
paths.dotenv, | ||
] | ||
|
||
dotenvFiles | ||
.filter(Boolean) | ||
.filter(fs.existsSync) | ||
.forEach(dotenvFile => { | ||
dotenvExpand( | ||
dotenv.config({ | ||
path: dotenvFile, | ||
}) | ||
) | ||
}) | ||
|
||
reporter.debug('ENV', process.env) | ||
} |
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
Oops, something went wrong.