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 {
fill: none; }
fill: none;
}
.gantt .grid-header {
fill: #ffffff;
stroke: #e0e0e0;
stroke-width: 1.4; }
stroke-width: 1.4;
}
.gantt .grid-row {
fill: #ffffff; }
fill: #ffffff;
}
.gantt .grid-row:nth-child(even) {
fill: #f5f5f5; }
fill: #f5f5f5;
}
.gantt .row-line {
stroke: #ebeff2; }
stroke: #ebeff2;
}
.gantt .tick {
stroke: #e0e0e0;
stroke-width: 0.2; }
.gantt .tick.thick {
stroke-width: 0.4; }
stroke-width: 0.2;
}
.gantt .tick.thick {
stroke-width: 0.4;
}
.gantt .today-highlight {
fill: #fcf8e3;
opacity: 0.5; }
opacity: 0.5;
}
.gantt .arrow {
fill: none;
stroke: #666;
stroke-width: 1.4; }
stroke-width: 1.4;
}
.gantt .bar {
fill: #b8c2cc;
stroke: #8D99A6;
stroke-width: 0;
transition: stroke-width .3s ease;
user-select: none; }
transition: stroke-width 0.3s ease;
user-select: none;
}
.gantt .bar-progress {
fill: #a3a3ff; }
fill: #a3a3ff;
}
.gantt .bar-invalid {
fill: transparent;
stroke: #8D99A6;
stroke-width: 1;
stroke-dasharray: 5; }
.gantt .bar-invalid ~ .bar-label {
fill: #555; }
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; }
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; }
transition: opacity 0.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; }
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; }
text-anchor: middle;
}
.gantt .upper-text {
fill: #555; }
fill: #555;
}
.gantt .lower-text {
fill: #333; }
fill: #333;
}
.gantt .hide {
display: none; }
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, 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 transparent;
border-top-color: rgba(0, 0, 0, 0.8); }
font-size: 12px;
}
.gantt-container .popup-wrapper {
position: absolute;
top: 0;
left: 0;
background: rgba(0, 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 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",
"test": "jest",
"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": {
"type": "git",
"url": "https://github.com/frappe/gantt.git"
},
"files": [
"src",
"dist",
"README.md"
],
"keywords": [
"gantt",
"svg",
@ -31,15 +37,14 @@
"homepage": "https://github.com/frappe/gantt",
"devDependencies": {
"babel-preset-env": "^1.6.1",
"deepmerge": "^2.0.1",
"eslint": "^4.17.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-prettier": "^2.6.0",
"jest": "^22.2.1",
"prettier": "1.10.2",
"rollup": "^0.55.3",
"rollup-plugin-sass": "^1.2.2",
"rollup-plugin-uglify": "^3.0.0"
"prettier": "^2.6.2",
"rollup": "^2.70.2",
"rollup-plugin-sass": "^1.2.12",
"rollup-plugin-terser": "^7.0.2"
},
"eslintIgnore": [
"dist"

View File

@ -1,25 +1,37 @@
import sass from 'rollup-plugin-sass';
import uglify from 'rollup-plugin-uglify';
import merge from 'deepmerge';
import { terser } from 'rollup-plugin-terser';
const dev = {
input: 'src/index.js',
output: {
name: 'Gantt',
file: 'dist/frappe-gantt.js',
format: 'iife'
sourcemap: true,
format: 'iife',
},
plugins: [
sass({
output: 'dist/frappe-gantt.css'
})
]
output: true,
}),
],
};
const prod = merge(dev, {
const prod = {
input: 'src/index.js',
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];

998
yarn.lock

File diff suppressed because it is too large Load Diff