-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use latest d2-app-scripts to build tree-shakable library (#840)
* fix: use latest d2-app-scripts to build tree-shakable library * fix: upgrade all dhis2 dependencies * fix: correctly merge babel configurations * chore: correct jest ignore patterns
- Loading branch information
Showing
6 changed files
with
140 additions
and
359 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,4 +1,31 @@ | ||
const makeBabelConfig = require('@dhis2/cli-app-scripts/config/makeBabelConfig.js') | ||
|
||
module.exports = { | ||
addons: ['@storybook/preset-create-react-app'], | ||
stories: ['../src/**/*.stories.@(js|mdx)'], | ||
babel: async config => { | ||
// currently styled-jsx is configured the same way for prod and | ||
// dev so it doesn't matter what the mode is here. | ||
const mode = 'production' | ||
|
||
const custom = makeBabelConfig({ | ||
moduleType: 'es', | ||
mode, | ||
}) | ||
|
||
// ensure that our custom babel configuration is merged properly | ||
// with the storybook babel configuration. | ||
return { | ||
...config, | ||
presets: [ | ||
...config.presets, | ||
...custom.presets, | ||
], | ||
plugins: [ | ||
...config.plugins, | ||
...custom.plugins, | ||
...custom.env[mode].plugins, | ||
], | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ const config = { | |
type: 'lib', | ||
|
||
entryPoints: { | ||
lib: './src/index', | ||
lib: './src/index.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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
module.exports = { | ||
testPathIgnorePatterns: ['/node_modules/', '/build/'], | ||
setupFilesAfterEnv: ['<rootDir>/config/setupEnzyme.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 |
---|---|---|
@@ -1,10 +1,15 @@ | ||
{ | ||
"name": "@dhis2/analytics", | ||
"version": "16.0.12", | ||
"main": "./build/cjs/lib.js", | ||
"module": "./build/es/lib.js", | ||
"main": "./build/cjs/index.js", | ||
"module": "./build/es/index.js", | ||
"exports": { | ||
"import": "./build/es/index.js", | ||
"require": "./build/cjs/index.js" | ||
}, | ||
"sideEffects": [ | ||
"./src/locales/index.js" | ||
"./build/es/locales/index.js", | ||
"./build/cjs/locales/index.js" | ||
], | ||
"repository": "[email protected]:dhis2/analytics.git", | ||
"author": "Jennifer Jones Arnesen <[email protected]>", | ||
|
@@ -26,11 +31,11 @@ | |
"validate-push": "yarn test" | ||
}, | ||
"devDependencies": { | ||
"@dhis2/app-runtime": "^2.6.1", | ||
"@dhis2/cli-app-scripts": "^5.5.1", | ||
"@dhis2/app-runtime": "^2.8.0", | ||
"@dhis2/cli-app-scripts": "^6.0.0", | ||
"@dhis2/cli-style": "^7.2.2", | ||
"@dhis2/d2-i18n": "^1.0.6", | ||
"@dhis2/ui": "^6.5.1", | ||
"@dhis2/d2-i18n": "^1.1.0", | ||
"@dhis2/ui": "^6.5.3", | ||
"@sambego/storybook-state": "^2.0.1", | ||
"@storybook/addons": "^6.1.14", | ||
"@storybook/preset-create-react-app": "^3.1.5", | ||
|
@@ -43,9 +48,9 @@ | |
"typeface-roboto": "^0.0.75" | ||
}, | ||
"peerDependencies": { | ||
"@dhis2/app-runtime": "^2.6.1", | ||
"@dhis2/d2-i18n": "^1.0.6", | ||
"@dhis2/ui": "^6.5.1", | ||
"@dhis2/app-runtime": "^2", | ||
"@dhis2/d2-i18n": "^1.1", | ||
"@dhis2/ui": "^6.5.2", | ||
"prop-types": "^15", | ||
"react": "^16.3", | ||
"react-dom": "^16.3", | ||
|
@@ -69,9 +74,5 @@ | |
}, | ||
"files": [ | ||
"build" | ||
], | ||
"resolutions": { | ||
"@dhis2/ui": "^6.5.0", | ||
"styled-jsx": "3.3.2" | ||
} | ||
] | ||
} |
Oops, something went wrong.