chore: update rollup config

- minify css
- sourcemap
- github action to auto-publish on npm
This commit is contained in:
Faris Ansari 2022-04-28 10:23:58 +05:30
parent aba84bd715
commit 6233b6cd4b
10 changed files with 2168 additions and 2588 deletions

19
.github/workflows/publish.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: Publish on NPM
on:
push:
branches: [ master ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn install
- run: yarn prettier-check
- run: yarn test
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}

164
dist/frappe-gantt.css vendored
View File

@ -1,119 +1,133 @@
.gantt .grid-background { .gantt .grid-background {
fill: none; } fill: none;
}
.gantt .grid-header { .gantt .grid-header {
fill: #ffffff; fill: #ffffff;
stroke: #e0e0e0; stroke: #e0e0e0;
stroke-width: 1.4; } stroke-width: 1.4;
}
.gantt .grid-row { .gantt .grid-row {
fill: #ffffff; } fill: #ffffff;
}
.gantt .grid-row:nth-child(even) { .gantt .grid-row:nth-child(even) {
fill: #f5f5f5; } fill: #f5f5f5;
}
.gantt .row-line { .gantt .row-line {
stroke: #ebeff2; } stroke: #ebeff2;
}
.gantt .tick { .gantt .tick {
stroke: #e0e0e0; stroke: #e0e0e0;
stroke-width: 0.2; } stroke-width: 0.2;
.gantt .tick.thick { }
stroke-width: 0.4; } .gantt .tick.thick {
stroke-width: 0.4;
}
.gantt .today-highlight { .gantt .today-highlight {
fill: #fcf8e3; fill: #fcf8e3;
opacity: 0.5; } opacity: 0.5;
}
.gantt .arrow { .gantt .arrow {
fill: none; fill: none;
stroke: #666; stroke: #666;
stroke-width: 1.4; } stroke-width: 1.4;
}
.gantt .bar { .gantt .bar {
fill: #b8c2cc; fill: #b8c2cc;
stroke: #8D99A6; stroke: #8D99A6;
stroke-width: 0; stroke-width: 0;
transition: stroke-width .3s ease; transition: stroke-width 0.3s ease;
user-select: none; } user-select: none;
}
.gantt .bar-progress { .gantt .bar-progress {
fill: #a3a3ff; } fill: #a3a3ff;
}
.gantt .bar-invalid { .gantt .bar-invalid {
fill: transparent; fill: transparent;
stroke: #8D99A6; stroke: #8D99A6;
stroke-width: 1; stroke-width: 1;
stroke-dasharray: 5; } stroke-dasharray: 5;
.gantt .bar-invalid ~ .bar-label { }
fill: #555; } .gantt .bar-invalid ~ .bar-label {
fill: #555;
}
.gantt .bar-label { .gantt .bar-label {
fill: #fff; fill: #fff;
dominant-baseline: central; dominant-baseline: central;
text-anchor: middle; text-anchor: middle;
font-size: 12px; font-size: 12px;
font-weight: lighter; } font-weight: lighter;
.gantt .bar-label.big { }
fill: #555; .gantt .bar-label.big {
text-anchor: start; } fill: #555;
text-anchor: start;
}
.gantt .handle { .gantt .handle {
fill: #ddd; fill: #ddd;
cursor: ew-resize; cursor: ew-resize;
opacity: 0; opacity: 0;
visibility: hidden; visibility: hidden;
transition: opacity .3s ease; } transition: opacity 0.3s ease;
}
.gantt .bar-wrapper { .gantt .bar-wrapper {
cursor: pointer; cursor: pointer;
outline: none; } outline: none;
.gantt .bar-wrapper:hover .bar { }
fill: #a9b5c1; } .gantt .bar-wrapper:hover .bar {
.gantt .bar-wrapper:hover .bar-progress { fill: #a9b5c1;
fill: #8a8aff; } }
.gantt .bar-wrapper:hover .handle { .gantt .bar-wrapper:hover .bar-progress {
visibility: visible; fill: #8a8aff;
opacity: 1; } }
.gantt .bar-wrapper.active .bar { .gantt .bar-wrapper:hover .handle {
fill: #a9b5c1; } visibility: visible;
.gantt .bar-wrapper.active .bar-progress { opacity: 1;
fill: #8a8aff; } }
.gantt .bar-wrapper.active .bar {
fill: #a9b5c1;
}
.gantt .bar-wrapper.active .bar-progress {
fill: #8a8aff;
}
.gantt .lower-text, .gantt .upper-text { .gantt .lower-text, .gantt .upper-text {
font-size: 12px; font-size: 12px;
text-anchor: middle; } text-anchor: middle;
}
.gantt .upper-text { .gantt .upper-text {
fill: #555; } fill: #555;
}
.gantt .lower-text { .gantt .lower-text {
fill: #333; } fill: #333;
}
.gantt .hide { .gantt .hide {
display: none; } display: none;
}
.gantt-container { .gantt-container {
position: relative; position: relative;
overflow: auto; overflow: auto;
font-size: 12px; } font-size: 12px;
.gantt-container .popup-wrapper { }
position: absolute; .gantt-container .popup-wrapper {
top: 0; position: absolute;
left: 0; top: 0;
background: rgba(0, 0, 0, 0.8); left: 0;
padding: 0; background: rgba(0, 0, 0, 0.8);
color: #959da5; padding: 0;
border-radius: 3px; } color: #959da5;
.gantt-container .popup-wrapper .title { border-radius: 3px;
border-bottom: 3px solid #a3a3ff; }
padding: 10px; } .gantt-container .popup-wrapper .title {
.gantt-container .popup-wrapper .subtitle { border-bottom: 3px solid #a3a3ff;
padding: 10px; padding: 10px;
color: #dfe2e5; } }
.gantt-container .popup-wrapper .pointer { .gantt-container .popup-wrapper .subtitle {
position: absolute; padding: 10px;
height: 5px; color: #dfe2e5;
margin: 0 0 0 -5px; }
border: 5px solid transparent; .gantt-container .popup-wrapper .pointer {
border-top-color: rgba(0, 0, 0, 0.8); } position: absolute;
height: 5px;
margin: 0 0 0 -5px;
border: 5px solid transparent;
border-top-color: rgba(0, 0, 0, 0.8);
}

3514
dist/frappe-gantt.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

1
dist/frappe-gantt.min.css vendored Normal file
View File

@ -0,0 +1 @@
.gantt .grid-background{fill:none}.gantt .grid-header{fill:#fff;stroke:#e0e0e0;stroke-width:1.4}.gantt .grid-row{fill:#fff}.gantt .grid-row:nth-child(even){fill:#f5f5f5}.gantt .row-line{stroke:#ebeff2}.gantt .tick{stroke:#e0e0e0;stroke-width:.2}.gantt .tick.thick{stroke-width:.4}.gantt .today-highlight{fill:#fcf8e3;opacity:.5}.gantt .arrow{fill:none;stroke:#666;stroke-width:1.4}.gantt .bar{fill:#b8c2cc;stroke:#8d99a6;stroke-width:0;transition:stroke-width .3s ease;user-select:none}.gantt .bar-progress{fill:#a3a3ff}.gantt .bar-invalid{fill:rgba(0,0,0,0);stroke:#8d99a6;stroke-width:1;stroke-dasharray:5}.gantt .bar-invalid~.bar-label{fill:#555}.gantt .bar-label{fill:#fff;dominant-baseline:central;text-anchor:middle;font-size:12px;font-weight:lighter}.gantt .bar-label.big{fill:#555;text-anchor:start}.gantt .handle{fill:#ddd;cursor:ew-resize;opacity:0;visibility:hidden;transition:opacity .3s ease}.gantt .bar-wrapper{cursor:pointer;outline:none}.gantt .bar-wrapper:hover .bar{fill:#a9b5c1}.gantt .bar-wrapper:hover .bar-progress{fill:#8a8aff}.gantt .bar-wrapper:hover .handle{visibility:visible;opacity:1}.gantt .bar-wrapper.active .bar{fill:#a9b5c1}.gantt .bar-wrapper.active .bar-progress{fill:#8a8aff}.gantt .lower-text,.gantt .upper-text{font-size:12px;text-anchor:middle}.gantt .upper-text{fill:#555}.gantt .lower-text{fill:#333}.gantt .hide{display:none}.gantt-container{position:relative;overflow:auto;font-size:12px}.gantt-container .popup-wrapper{position:absolute;top:0;left:0;background:rgba(0,0,0,.8);padding:0;color:#959da5;border-radius:3px}.gantt-container .popup-wrapper .title{border-bottom:3px solid #a3a3ff;padding:10px}.gantt-container .popup-wrapper .subtitle{padding:10px;color:#dfe2e5}.gantt-container .popup-wrapper .pointer{position:absolute;height:5px;margin:0 0 0 -5px;border:5px solid rgba(0,0,0,0);border-top-color:rgba(0,0,0,.8)}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -9,12 +9,18 @@
"dev": "rollup -c -w", "dev": "rollup -c -w",
"test": "jest", "test": "jest",
"test:watch": "jest --watch", "test:watch": "jest --watch",
"prettier": "prettier es6 --write \"{src/*,tests/*,rollup.config}.js\"" "prettier": "prettier --write \"{src/*,tests/*,rollup.config}.js\"",
"prettier-check": "prettier --check \"{src/*,tests/*,rollup.config}.js\""
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/frappe/gantt.git" "url": "https://github.com/frappe/gantt.git"
}, },
"files": [
"src",
"dist",
"README.md"
],
"keywords": [ "keywords": [
"gantt", "gantt",
"svg", "svg",
@ -31,15 +37,14 @@
"homepage": "https://github.com/frappe/gantt", "homepage": "https://github.com/frappe/gantt",
"devDependencies": { "devDependencies": {
"babel-preset-env": "^1.6.1", "babel-preset-env": "^1.6.1",
"deepmerge": "^2.0.1",
"eslint": "^4.17.0", "eslint": "^4.17.0",
"eslint-config-prettier": "^2.9.0", "eslint-config-prettier": "^2.9.0",
"eslint-plugin-prettier": "^2.6.0", "eslint-plugin-prettier": "^2.6.0",
"jest": "^22.2.1", "jest": "^22.2.1",
"prettier": "1.10.2", "prettier": "^2.6.2",
"rollup": "^0.55.3", "rollup": "^2.70.2",
"rollup-plugin-sass": "^1.2.2", "rollup-plugin-sass": "^1.2.12",
"rollup-plugin-uglify": "^3.0.0" "rollup-plugin-terser": "^7.0.2"
}, },
"eslintIgnore": [ "eslintIgnore": [
"dist" "dist"

View File

@ -1,25 +1,37 @@
import sass from 'rollup-plugin-sass'; import sass from 'rollup-plugin-sass';
import uglify from 'rollup-plugin-uglify'; import { terser } from 'rollup-plugin-terser';
import merge from 'deepmerge';
const dev = { const dev = {
input: 'src/index.js', input: 'src/index.js',
output: { output: {
name: 'Gantt', name: 'Gantt',
file: 'dist/frappe-gantt.js', file: 'dist/frappe-gantt.js',
format: 'iife' sourcemap: true,
format: 'iife',
}, },
plugins: [ plugins: [
sass({ sass({
output: 'dist/frappe-gantt.css' output: true,
}) }),
] ],
}; };
const prod = merge(dev, { const prod = {
input: 'src/index.js',
output: { output: {
file: 'dist/frappe-gantt.min.js' name: 'Gantt',
file: 'dist/frappe-gantt.min.js',
sourcemap: true,
format: 'iife',
}, },
plugins: [uglify()] plugins: [
}); sass({
output: true,
options: {
outputStyle: 'compressed',
},
}),
terser(),
],
};
export default [dev, prod]; export default [dev, prod];

998
yarn.lock

File diff suppressed because it is too large Load Diff