Commit changes before a long weekend
This commit is contained in:
parent
e250ac0c50
commit
f175d4b96b
@ -13,5 +13,11 @@
|
||||
"react": {
|
||||
"version": "detect"
|
||||
}
|
||||
},
|
||||
"globals": {
|
||||
"cy": true,
|
||||
"context": true,
|
||||
"Cypress": true,
|
||||
"assert": true
|
||||
}
|
||||
}
|
||||
@ -6,6 +6,7 @@
|
||||
],
|
||||
"scripts": {
|
||||
"start": "lerna run lerna:start --parallel",
|
||||
"build:magic": "lerna run lerna:build --parallel",
|
||||
"build": "lerna exec --parallel -- babel --root-mode upward src -d lib --ignore **/*.story.js,**/*.spec.js"
|
||||
},
|
||||
"husky": {
|
||||
|
||||
1
packages/_components/.gitattributes
vendored
1
packages/_components/.gitattributes
vendored
@ -1 +0,0 @@
|
||||
* text eol=lf
|
||||
32
packages/_components/.gitignore
vendored
32
packages/_components/.gitignore
vendored
@ -1,32 +0,0 @@
|
||||
|
||||
# See https://help.github.com/ignore-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
node_modules
|
||||
# Don't track package-lock if we intend to use yarn.lock
|
||||
package-lock.json
|
||||
|
||||
# builds
|
||||
build
|
||||
dist/
|
||||
.rpt2_cache
|
||||
.docz/
|
||||
.yalc
|
||||
yalc.lock
|
||||
|
||||
# Log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
.idea
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
# Can be removed after we update netlify
|
||||
# to use default .docz/ output destination
|
||||
example/
|
||||
@ -1,7 +0,0 @@
|
||||
{
|
||||
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
|
||||
"parser": "babel-eslint",
|
||||
"env": {
|
||||
"jest": true
|
||||
}
|
||||
}
|
||||
3
packages/_core/.vscode/extensions.json
vendored
3
packages/_core/.vscode/extensions.json
vendored
@ -1,3 +0,0 @@
|
||||
{
|
||||
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
|
||||
}
|
||||
29
packages/_core/.vscode/settings.json
vendored
29
packages/_core/.vscode/settings.json
vendored
@ -1,29 +0,0 @@
|
||||
{
|
||||
"editor.rulers": [80, 120],
|
||||
|
||||
// ===
|
||||
// Spacing
|
||||
// ===
|
||||
|
||||
"editor.insertSpaces": true,
|
||||
"editor.tabSize": 2,
|
||||
"editor.trimAutoWhitespace": true,
|
||||
"files.trimTrailingWhitespace": true,
|
||||
"files.eol": "\n",
|
||||
"files.insertFinalNewline": true,
|
||||
"files.trimFinalNewlines": true,
|
||||
|
||||
// ===
|
||||
// Event Triggers
|
||||
// ===
|
||||
|
||||
"editor.formatOnSave": true,
|
||||
"eslint.autoFixOnSave": true,
|
||||
"eslint.run": "onSave",
|
||||
"eslint.validate": [
|
||||
{ "language": "javascript", "autoFix": true },
|
||||
{ "language": "javascriptreact", "autoFix": true }
|
||||
],
|
||||
"prettier.disableLanguages": [],
|
||||
"prettier.endOfLine": "lf"
|
||||
}
|
||||
51
packages/_core/config/webpack.common.js
Normal file
51
packages/_core/config/webpack.common.js
Normal file
@ -0,0 +1,51 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const ExtractCssChunks = require('extract-css-chunks-webpack-plugin');
|
||||
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
return {
|
||||
entry: {
|
||||
app: `${SRC_DIR}/index.js`,
|
||||
},
|
||||
context: SRC_DIR,
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx', '.json', '*'],
|
||||
symlinks: true,
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: [/node_modules/],
|
||||
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,
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new webpack.EnvironmentPlugin(['NODE_ENV']),
|
||||
new ExtractCssChunks({
|
||||
filename: '[name].css',
|
||||
chunkFilename: '[id].css',
|
||||
// hot: true /* only necessary if hot reloading not function*/
|
||||
}),
|
||||
],
|
||||
};
|
||||
};
|
||||
38
packages/_core/config/webpack.prod.js
Normal file
38
packages/_core/config/webpack.prod.js
Normal file
@ -0,0 +1,38 @@
|
||||
const merge = require('webpack-merge');
|
||||
const path = require('path');
|
||||
const common = require('./webpack.common');
|
||||
const pkg = require('./../package.json');
|
||||
|
||||
const ROOT_DIR = path.join(__dirname, './..');
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
const commonConfig = common(env, argv);
|
||||
|
||||
return merge(commonConfig, {
|
||||
mode: 'production',
|
||||
stats: {
|
||||
colors: false,
|
||||
hash: true,
|
||||
timings: true,
|
||||
assets: true,
|
||||
chunks: true,
|
||||
chunkModules: true,
|
||||
modules: true,
|
||||
children: true,
|
||||
warnings: true,
|
||||
},
|
||||
optimization: {
|
||||
minimize: true,
|
||||
sideEffects: true,
|
||||
},
|
||||
output: {
|
||||
path: ROOT_DIR,
|
||||
library: 'ohifCore',
|
||||
libraryTarget: 'umd',
|
||||
filename: pkg.main,
|
||||
auxiliaryComment: 'Test Comment',
|
||||
},
|
||||
});
|
||||
};
|
||||
@ -6,8 +6,10 @@
|
||||
"license": "MIT",
|
||||
"repository": "OHIF/ohif-core",
|
||||
"main": "dist/index.umd.js",
|
||||
"module": "dist/index.es.js",
|
||||
"jsnext:main": "dist/index.es.js",
|
||||
"browser": "dist/index.umd.jd",
|
||||
"module": "src/index.js",
|
||||
"jsnext:main": "src/index.js",
|
||||
"sideEffects": "false",
|
||||
"engines": {
|
||||
"node": ">=8",
|
||||
"npm": ">=5"
|
||||
@ -15,6 +17,7 @@
|
||||
"scripts": {
|
||||
"cm": "npx git-cz",
|
||||
"build": "rollup -c",
|
||||
"lerna:build": "webpack --config config/webpack.prod.js -w -d",
|
||||
"dev": "jest --watch",
|
||||
"start": "rollup -c -w",
|
||||
"test": "jest",
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
67
packages/_i18n/config/webpack.common.js
Normal file
67
packages/_i18n/config/webpack.common.js
Normal file
@ -0,0 +1,67 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const ExtractCssChunks = require('extract-css-chunks-webpack-plugin');
|
||||
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
return {
|
||||
entry: {
|
||||
app: `${SRC_DIR}/index.js`,
|
||||
},
|
||||
context: SRC_DIR,
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx', '.json', '*'],
|
||||
symlinks: true,
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: [/node_modules/],
|
||||
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',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new webpack.EnvironmentPlugin(['NODE_ENV']),
|
||||
new ExtractCssChunks({
|
||||
filename: '[name].css',
|
||||
chunkFilename: '[id].css',
|
||||
// hot: true /* only necessary if hot reloading not function*/
|
||||
}),
|
||||
],
|
||||
};
|
||||
};
|
||||
64
packages/_i18n/config/webpack.prod.js
Normal file
64
packages/_i18n/config/webpack.prod.js
Normal file
@ -0,0 +1,64 @@
|
||||
const merge = require('webpack-merge');
|
||||
const path = require('path');
|
||||
const common = require('./webpack.common');
|
||||
const pkg = require('./../package.json');
|
||||
|
||||
const ROOT_DIR = path.join(__dirname, './..');
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
const commonConfig = common(env, argv);
|
||||
|
||||
return merge(commonConfig, {
|
||||
mode: 'production',
|
||||
stats: {
|
||||
colors: false,
|
||||
hash: true,
|
||||
timings: true,
|
||||
assets: true,
|
||||
chunks: true,
|
||||
chunkModules: true,
|
||||
modules: true,
|
||||
children: true,
|
||||
warnings: true,
|
||||
},
|
||||
optimization: {
|
||||
minimize: true,
|
||||
sideEffects: true,
|
||||
},
|
||||
output: {
|
||||
path: ROOT_DIR,
|
||||
library: 'ohifCornerstoneExtension',
|
||||
libraryTarget: 'umd',
|
||||
filename: pkg.main,
|
||||
auxiliaryComment: 'Test Comment',
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(gif|jpe?g|png|svg)$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 8192,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(ttf|eot|woff|woff2)$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 50000,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
};
|
||||
@ -14,6 +14,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"lerna:build": "webpack --config config/webpack.prod.js -w -d",
|
||||
"prepublishOnly": "npm run build",
|
||||
"pullTranslations": "./pullTranslations.sh"
|
||||
},
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
{
|
||||
"extends": ["react-app", "eslint:recommended", "plugin:react/recommended"],
|
||||
"parser": "babel-eslint",
|
||||
"env": {
|
||||
"jest": true
|
||||
},
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "detect"
|
||||
}
|
||||
},
|
||||
"globals": {
|
||||
"cy": true,
|
||||
"context": true,
|
||||
"Cypress": true,
|
||||
"assert": true
|
||||
}
|
||||
}
|
||||
@ -14,7 +14,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"hello": "webpack --config config/webpack.prod.js -w -d",
|
||||
"lerna:build": "webpack --config config/webpack.prod.js -w -d",
|
||||
"prepublishOnly": "npm run build",
|
||||
"start": "rollup -c -w",
|
||||
"lint": "eslint -c .eslintrc --fix src && prettier --single-quote --write src/**/*.{js,jsx,json,css}"
|
||||
|
||||
67
packages/extension-dicom-html/config/webpack.common.js
Normal file
67
packages/extension-dicom-html/config/webpack.common.js
Normal file
@ -0,0 +1,67 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const ExtractCssChunks = require('extract-css-chunks-webpack-plugin');
|
||||
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
return {
|
||||
entry: {
|
||||
app: `${SRC_DIR}/index.js`,
|
||||
},
|
||||
context: SRC_DIR,
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx', '.json', '*'],
|
||||
symlinks: true,
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: [/node_modules/],
|
||||
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',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new webpack.EnvironmentPlugin(['NODE_ENV']),
|
||||
new ExtractCssChunks({
|
||||
filename: '[name].css',
|
||||
chunkFilename: '[id].css',
|
||||
// hot: true /* only necessary if hot reloading not function*/
|
||||
}),
|
||||
],
|
||||
};
|
||||
};
|
||||
64
packages/extension-dicom-html/config/webpack.prod.js
Normal file
64
packages/extension-dicom-html/config/webpack.prod.js
Normal file
@ -0,0 +1,64 @@
|
||||
const merge = require('webpack-merge');
|
||||
const path = require('path');
|
||||
const common = require('./webpack.common');
|
||||
const pkg = require('./../package.json');
|
||||
|
||||
const ROOT_DIR = path.join(__dirname, './..');
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
const commonConfig = common(env, argv);
|
||||
|
||||
return merge(commonConfig, {
|
||||
mode: 'production',
|
||||
stats: {
|
||||
colors: false,
|
||||
hash: true,
|
||||
timings: true,
|
||||
assets: true,
|
||||
chunks: true,
|
||||
chunkModules: true,
|
||||
modules: true,
|
||||
children: true,
|
||||
warnings: true,
|
||||
},
|
||||
optimization: {
|
||||
minimize: true,
|
||||
sideEffects: true,
|
||||
},
|
||||
output: {
|
||||
path: ROOT_DIR,
|
||||
library: 'ohifCornerstoneExtension',
|
||||
libraryTarget: 'umd',
|
||||
filename: pkg.main,
|
||||
auxiliaryComment: 'Test Comment',
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(gif|jpe?g|png|svg)$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 8192,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(ttf|eot|woff|woff2)$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 50000,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
};
|
||||
@ -14,6 +14,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"lerna:build": "webpack --config config/webpack.prod.js -w -d",
|
||||
"prepublishOnly": "npm run build",
|
||||
"start": "rollup -c -w",
|
||||
"lint": "eslint -c .eslintrc --fix src && prettier --single-quote --write src/**/*.{js,jsx,json,css}"
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
{
|
||||
"extends": [
|
||||
"react-app",
|
||||
"eslint:recommended",
|
||||
"plugin:react/recommended"
|
||||
],
|
||||
"parser": "babel-eslint",
|
||||
"env": {
|
||||
"jest": true
|
||||
},
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "detect",
|
||||
},
|
||||
},
|
||||
}
|
||||
67
packages/extension-dicom-microscopy/config/webpack.common.js
Normal file
67
packages/extension-dicom-microscopy/config/webpack.common.js
Normal file
@ -0,0 +1,67 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const ExtractCssChunks = require('extract-css-chunks-webpack-plugin');
|
||||
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
return {
|
||||
entry: {
|
||||
app: `${SRC_DIR}/index.js`,
|
||||
},
|
||||
context: SRC_DIR,
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx', '.json', '*'],
|
||||
symlinks: true,
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: [/node_modules/],
|
||||
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',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new webpack.EnvironmentPlugin(['NODE_ENV']),
|
||||
new ExtractCssChunks({
|
||||
filename: '[name].css',
|
||||
chunkFilename: '[id].css',
|
||||
// hot: true /* only necessary if hot reloading not function*/
|
||||
}),
|
||||
],
|
||||
};
|
||||
};
|
||||
64
packages/extension-dicom-microscopy/config/webpack.prod.js
Normal file
64
packages/extension-dicom-microscopy/config/webpack.prod.js
Normal file
@ -0,0 +1,64 @@
|
||||
const merge = require('webpack-merge');
|
||||
const path = require('path');
|
||||
const common = require('./webpack.common');
|
||||
const pkg = require('./../package.json');
|
||||
|
||||
const ROOT_DIR = path.join(__dirname, './..');
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
const commonConfig = common(env, argv);
|
||||
|
||||
return merge(commonConfig, {
|
||||
mode: 'production',
|
||||
stats: {
|
||||
colors: false,
|
||||
hash: true,
|
||||
timings: true,
|
||||
assets: true,
|
||||
chunks: true,
|
||||
chunkModules: true,
|
||||
modules: true,
|
||||
children: true,
|
||||
warnings: true,
|
||||
},
|
||||
optimization: {
|
||||
minimize: true,
|
||||
sideEffects: true,
|
||||
},
|
||||
output: {
|
||||
path: ROOT_DIR,
|
||||
library: 'ohifCornerstoneExtension',
|
||||
libraryTarget: 'umd',
|
||||
filename: pkg.main,
|
||||
auxiliaryComment: 'Test Comment',
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(gif|jpe?g|png|svg)$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 8192,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(ttf|eot|woff|woff2)$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 50000,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
};
|
||||
@ -14,6 +14,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"lerna:build": "webpack --config config/webpack.prod.js -w -d",
|
||||
"prepublishOnly": "npm run build",
|
||||
"start": "rollup -c -w",
|
||||
"lint": "eslint -c .eslintrc --fix src && prettier --single-quote --write src/**/*.{js,jsx,json,css}"
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
{
|
||||
"extends": [
|
||||
"react-app",
|
||||
"eslint:recommended",
|
||||
"plugin:react/recommended"
|
||||
],
|
||||
"parser": "babel-eslint",
|
||||
"env": {
|
||||
"jest": true
|
||||
},
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "detect",
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
{
|
||||
"trailingComma": "es5",
|
||||
"printWidth": 80,
|
||||
"proseWrap": "always",
|
||||
"tabWidth": 2,
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"endOfLine": "lf"
|
||||
}
|
||||
67
packages/extension-dicom-pdf/config/webpack.common.js
Normal file
67
packages/extension-dicom-pdf/config/webpack.common.js
Normal file
@ -0,0 +1,67 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const ExtractCssChunks = require('extract-css-chunks-webpack-plugin');
|
||||
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
return {
|
||||
entry: {
|
||||
app: `${SRC_DIR}/index.js`,
|
||||
},
|
||||
context: SRC_DIR,
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx', '.json', '*'],
|
||||
symlinks: true,
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: [/node_modules/],
|
||||
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',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new webpack.EnvironmentPlugin(['NODE_ENV']),
|
||||
new ExtractCssChunks({
|
||||
filename: '[name].css',
|
||||
chunkFilename: '[id].css',
|
||||
// hot: true /* only necessary if hot reloading not function*/
|
||||
}),
|
||||
],
|
||||
};
|
||||
};
|
||||
64
packages/extension-dicom-pdf/config/webpack.prod.js
Normal file
64
packages/extension-dicom-pdf/config/webpack.prod.js
Normal file
@ -0,0 +1,64 @@
|
||||
const merge = require('webpack-merge');
|
||||
const path = require('path');
|
||||
const common = require('./webpack.common');
|
||||
const pkg = require('./../package.json');
|
||||
|
||||
const ROOT_DIR = path.join(__dirname, './..');
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
const commonConfig = common(env, argv);
|
||||
|
||||
return merge(commonConfig, {
|
||||
mode: 'production',
|
||||
stats: {
|
||||
colors: false,
|
||||
hash: true,
|
||||
timings: true,
|
||||
assets: true,
|
||||
chunks: true,
|
||||
chunkModules: true,
|
||||
modules: true,
|
||||
children: true,
|
||||
warnings: true,
|
||||
},
|
||||
optimization: {
|
||||
minimize: true,
|
||||
sideEffects: true,
|
||||
},
|
||||
output: {
|
||||
path: ROOT_DIR,
|
||||
library: 'ohifCornerstoneExtension',
|
||||
libraryTarget: 'umd',
|
||||
filename: pkg.main,
|
||||
auxiliaryComment: 'Test Comment',
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(gif|jpe?g|png|svg)$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 8192,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(ttf|eot|woff|woff2)$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 50000,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
};
|
||||
@ -14,6 +14,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"lerna:build": "webpack --config config/webpack.prod.js -w -d",
|
||||
"prepublishOnly": "npm run build",
|
||||
"start": "rollup -c -w",
|
||||
"lint": "eslint -c .eslintrc --fix src && prettier --single-quote --write src/**/*.{js,jsx,json,css}"
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
@ -1,16 +0,0 @@
|
||||
{
|
||||
"extends": [
|
||||
"react-app",
|
||||
"eslint:recommended",
|
||||
"plugin:react/recommended"
|
||||
],
|
||||
"parser": "babel-eslint",
|
||||
"env": {
|
||||
"jest": true
|
||||
},
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "detect",
|
||||
},
|
||||
},
|
||||
}
|
||||
26
packages/extension-vtk/.gitignore
vendored
26
packages/extension-vtk/.gitignore
vendored
@ -1,26 +0,0 @@
|
||||
|
||||
# See https://help.github.com/ignore-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
node_modules
|
||||
|
||||
# builds
|
||||
build
|
||||
dist
|
||||
.rpt2_cache
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
.idea
|
||||
|
||||
yalc.lock
|
||||
.yalc
|
||||
@ -1,4 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 9
|
||||
- 8
|
||||
@ -11,13 +11,9 @@
|
||||
"npm": ">=5"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "webpack --progress --colors --mode development",
|
||||
"build:release": "webpack --progress --colors --mode production",
|
||||
"start": "webpack --watch --progress --colors --mode development",
|
||||
"prepare": "yarn run build:release",
|
||||
"predeploy": "cd example && yarn install && yarn run build:release",
|
||||
"prepublishOnly": "yarn install && yarn run build:release",
|
||||
"lint": "eslint -c .eslintrc --fix src && prettier --single-quote --write src/**/*.{js,jsx,json,css}"
|
||||
"lerna:build": "webpack --progress --colors --mode production",
|
||||
"lerna:dev": "webpack --watch --progress --colors --mode development",
|
||||
"prepublishOnly": "yarn install && yarn run lerna:build"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@ohif/i18n": "0.2.2",
|
||||
|
||||
@ -13,15 +13,15 @@ const cssRules = [
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
plugins: () => [autoprefixer('last 2 version', 'ie >= 10')]
|
||||
}
|
||||
}
|
||||
]
|
||||
plugins: () => [autoprefixer('last 2 version', 'ie >= 10')],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.glsl$/i,
|
||||
include: /vtk\.js[\/\\]Sources/,
|
||||
loader: 'shader-loader'
|
||||
loader: 'shader-loader',
|
||||
},
|
||||
{
|
||||
test: /\.worker\.js$/,
|
||||
@ -29,9 +29,9 @@ const cssRules = [
|
||||
use: [
|
||||
{
|
||||
loader: 'worker-loader',
|
||||
options: { inline: true, fallback: false }
|
||||
}
|
||||
]
|
||||
options: { inline: true, fallback: false },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
@ -42,17 +42,17 @@ const cssRules = [
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
localIdentName: '[name]-[local]_[sha512:hash:base64:5]',
|
||||
modules: true
|
||||
}
|
||||
modules: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
plugins: () => [autoprefixer('last 2 version', 'ie >= 10')]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
plugins: () => [autoprefixer('last 2 version', 'ie >= 10')],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
var entry = path.join(__dirname, './src/index.js');
|
||||
@ -66,19 +66,40 @@ module.exports = {
|
||||
filename: 'index.umd.js',
|
||||
library: '@ohif/extension-vtk',
|
||||
libraryTarget: 'umd',
|
||||
globalObject: 'this'
|
||||
globalObject: 'this',
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(js|jsx)$/,
|
||||
exclude: /node_modules/,
|
||||
use: ['babel-loader']
|
||||
}
|
||||
].concat(cssRules)
|
||||
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,
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
].concat(cssRules),
|
||||
},
|
||||
resolve: {
|
||||
modules: [path.resolve(__dirname, 'node_modules'), sourcePath]
|
||||
modules: [
|
||||
// Modules specific to this package
|
||||
path.resolve(__dirname, 'node_modules'),
|
||||
// Hoisted Yarn Workspace Modules
|
||||
path.resolve(__dirname, '../../node_modules'),
|
||||
sourcePath,
|
||||
],
|
||||
},
|
||||
externals: [
|
||||
{
|
||||
@ -86,14 +107,14 @@ module.exports = {
|
||||
commonjs: 'cornerstone-core',
|
||||
commonjs2: 'cornerstone-core',
|
||||
amd: 'cornerstone-core',
|
||||
root: 'cornerstone'
|
||||
root: 'cornerstone',
|
||||
},
|
||||
'cornerstone-math': {
|
||||
commonjs: 'cornerstone-math',
|
||||
commonjs2: 'cornerstone-math',
|
||||
amd: 'cornerstone-math',
|
||||
root: 'cornerstoneMath'
|
||||
}
|
||||
root: 'cornerstoneMath',
|
||||
},
|
||||
},
|
||||
'@ohif/i18n',
|
||||
'ohif-core',
|
||||
@ -104,7 +125,7 @@ module.exports = {
|
||||
'react-redux', //: 'ReactRedux',
|
||||
'react-resize-detector', //: 'ReactResizeDetector',
|
||||
'react-viewerbase', //: 'reactViewerbase',
|
||||
'prop-types' //: 'PropTypes'
|
||||
'prop-types', //: 'PropTypes'
|
||||
/*/\b(vtk.js)/*/
|
||||
]
|
||||
],
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user