Generate example for codecov issue
This commit is contained in:
parent
d64cdc429e
commit
37f60ba0af
90
.webpack/webpack.common.js
Normal file
90
.webpack/webpack.common.js
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
const path = require("path");
|
||||||
|
const ExtractCssChunks = require("extract-css-chunks-webpack-plugin");
|
||||||
|
|
||||||
|
const SRC_DIR = path.join(__dirname, "../src");
|
||||||
|
const PUBLIC_DIR = path.join(__dirname, "../public");
|
||||||
|
const DIST_DIR = path.join(__dirname, "../dist");
|
||||||
|
|
||||||
|
module.exports = (env, argv, { SRC_DIR, DIST_DIR }) => {
|
||||||
|
return {
|
||||||
|
entry: {
|
||||||
|
app: `${SRC_DIR}/index.js`
|
||||||
|
},
|
||||||
|
context: SRC_DIR,
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.jsx?$/,
|
||||||
|
exclude: [/node_modules/, /packages\\extension/],
|
||||||
|
loader: "babel-loader",
|
||||||
|
options: {
|
||||||
|
// Find babel.config.js in monorepo root
|
||||||
|
// https://babeljs.io/docs/en/options#rootmode
|
||||||
|
rootMode: "upward",
|
||||||
|
presets: [
|
||||||
|
[
|
||||||
|
"@babel/preset-env",
|
||||||
|
{
|
||||||
|
// Do not transform ES6 modules to another format.
|
||||||
|
// Webpack will take care of that.
|
||||||
|
modules: false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.css$/,
|
||||||
|
use: [
|
||||||
|
"style-loader",
|
||||||
|
ExtractCssChunks.loader,
|
||||||
|
{ loader: "css-loader", options: { importLoaders: 1 } },
|
||||||
|
{
|
||||||
|
loader: "postcss-loader",
|
||||||
|
options: {
|
||||||
|
config: {
|
||||||
|
path: "./postcss.config.js"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* This allows us to include web workers in our bundle, and VTK.js
|
||||||
|
* web workers in our bundle. While this increases bundle size, it
|
||||||
|
* cuts down on the number of includes we need for `script tag` usage.
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
test: /\.worker\.js$/,
|
||||||
|
include: /vtk\.js[\/\\]Sources/,
|
||||||
|
use: [
|
||||||
|
{
|
||||||
|
loader: "worker-loader",
|
||||||
|
options: { inline: true, fallback: false }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* This is exclusively used by `vtk.js` to bundle glsl files.
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
test: /\.glsl$/i,
|
||||||
|
include: /vtk\.js[\/\\]Sources/,
|
||||||
|
loader: "shader-loader"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
// Which directories to search when resolving modules
|
||||||
|
modules: [
|
||||||
|
path.resolve(__dirname, "../node_modules"),
|
||||||
|
path.resolve(__dirname, "../../../node_modules"),
|
||||||
|
SRC_DIR
|
||||||
|
],
|
||||||
|
// Attempt to resolve these extensions in order.
|
||||||
|
extensions: [".js", ".jsx", ".json", "*"],
|
||||||
|
// symlinked resources are resolved to their real path, not their symlinked location
|
||||||
|
symlinks: true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
@ -19,10 +19,11 @@
|
|||||||
|
|
||||||
### Global
|
### Global
|
||||||
|
|
||||||
| Commands | | |
|
| Commands | | |
|
||||||
| -------------- | --- | ----------------------------------------------------- |
|
| --------------- | --- | ----------------------------------------------------- |
|
||||||
| `test:unit` | | Jest multi-project test runner; overall coverage |
|
| `build:package` | | Builds commonjs bundles for all projects |
|
||||||
| `test:unit:ci` | | Runs tests in parallel. Reports coverage per project. |
|
| `test:unit` | | Jest multi-project test runner; overall coverage |
|
||||||
|
| `test:unit:ci` | | Runs tests in parallel. Reports coverage per project. |
|
||||||
|
|
||||||
### Local
|
### Local
|
||||||
|
|
||||||
|
|||||||
@ -13,12 +13,12 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"cm": "npx git-cz",
|
"cm": "npx git-cz",
|
||||||
"start": "lerna run lerna:start --parallel",
|
"start": "lerna run lerna:start --parallel",
|
||||||
"build": "lerna run lerna:build --parallel",
|
"build:package": "lerna run build:package --parallel",
|
||||||
"test:ci": "",
|
"test:ci": "",
|
||||||
"test:unit": "jest --collectCoverage",
|
"test:unit": "jest --collectCoverage",
|
||||||
"test:unit:ci": "lerna run test:unit:ci --parallel",
|
"test:unit:ci": "lerna run test:unit:ci --parallel",
|
||||||
"test:e2e": "",
|
"test:e2e": "",
|
||||||
"test:e2e:ci": "lerna run lerna:test:e2e --parallel && codecov",
|
"test:e2e:ci": "lerna run lerna:test:e2e --parallel",
|
||||||
"new-version": "lerna version --conventional-commits --yes",
|
"new-version": "lerna version --conventional-commits --yes",
|
||||||
"build:pwa:ci": ""
|
"build:pwa:ci": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test:unit": "jest --watch",
|
"test:unit": "jest --watch",
|
||||||
"test:unit:ci": "jest --ci --runInBand --collectCoverage",
|
"test:unit:ci": "jest --ci --runInBand --collectCoverage && codecov --flags=core",
|
||||||
"build": "rollup -c",
|
"build": "rollup -c",
|
||||||
"lerna:build": "webpack --config config/webpack.prod.js -w -d",
|
"lerna:build": "webpack --config config/webpack.prod.js -w -d",
|
||||||
"dev": "jest --watch",
|
"dev": "jest --watch",
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test:unit": "jest --watch",
|
"test:unit": "jest --watch",
|
||||||
"test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests",
|
"test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests && codecov --flags=ui",
|
||||||
"dev": "docz dev",
|
"dev": "docz dev",
|
||||||
"lerna:build": "webpack --config config/webpack.prod.js -w -d",
|
"lerna:build": "webpack --config config/webpack.prod.js -w -d",
|
||||||
"build": "rollup -c",
|
"build": "rollup -c",
|
||||||
|
|||||||
@ -14,12 +14,11 @@
|
|||||||
"proxy": "http://localhost:8042",
|
"proxy": "http://localhost:8042",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lerna:start": "cross-env NODE_ENV=development webpack-dev-server --config config/webpack.dev.js --mode development -w -d",
|
"lerna:start": "cross-env NODE_ENV=development webpack-dev-server --config config/webpack.dev.js --mode development -w -d",
|
||||||
|
"build:package": "webpack --config config/webpack.prod.js",
|
||||||
"test:unit": "jest --watch",
|
"test:unit": "jest --watch",
|
||||||
"test:unit:ci": "jest --ci --runInBand --collectCoverage",
|
"test:unit:ci": "jest --ci --runInBand --collectCoverage && codecov --flags=viewer",
|
||||||
"dev": "yarn run preBuild && react-scripts start",
|
"dev": "yarn run preBuild && react-scripts start",
|
||||||
"dev:debug": "react-scripts start",
|
"dev:debug": "react-scripts start",
|
||||||
"build:package": "yarn run preBuild && node --max-old-space-size=4096 node_modules/rollup/bin/rollup -c",
|
|
||||||
"build:package:ci": "yarn run preBuild && node --max-old-space-size=4096 node_modules/rollup/bin/rollup -c",
|
|
||||||
"build:web": "yarn run preBuild && react-scripts --max_old_space_size=4096 build",
|
"build:web": "yarn run preBuild && react-scripts --max_old_space_size=4096 build",
|
||||||
"build:demo:ci": "yarn run preBuild && cross-env PUBLIC_URL=/ REACT_APP_CONFIG=config/demo.js react-scripts --max_old_space_size=4096 build",
|
"build:demo:ci": "yarn run preBuild && cross-env PUBLIC_URL=/ REACT_APP_CONFIG=config/demo.js react-scripts --max_old_space_size=4096 build",
|
||||||
"test:e2e:ci": "start-server-and-test start http://localhost:5000 cy:run:ci",
|
"test:e2e:ci": "start-server-and-test start http://localhost:5000 cy:run:ci",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user