mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 12:26:15 +02:00
gulp: release bundling
This commit is contained in:
parent
8a53054750
commit
eb38ec7f26
|
|
@ -15,8 +15,11 @@ import gulpif from 'gulp-if';
|
|||
import uglify from 'gulp-uglify';
|
||||
import gulpsass from 'gulp-dart-sass'; // TODO: move to gulp-sass once they removed the node-sass depenency
|
||||
import postcss from 'gulp-postcss';
|
||||
import zip from 'gulp-zip';
|
||||
import glob from 'glob';
|
||||
import path from 'path';
|
||||
import subprocess from 'child_process';
|
||||
import fs from 'fs';
|
||||
|
||||
// css post-processing
|
||||
import cssnano from 'cssnano';
|
||||
|
|
@ -244,10 +247,50 @@ function copyLocales(cb)
|
|||
function live(cb)
|
||||
{
|
||||
watch('./scss/**/*.scss', css);
|
||||
watch(['./js/**/*.js', '!!./js/viewjs/**/*.js'], js);
|
||||
watch(['./js/**/*.js', '!./js/viewjs/**/*.js'], js);
|
||||
watch('./js/vendor.js', vendor);
|
||||
//watch('./js/viewjs/**/*.js', viewjs);
|
||||
viewJStasks.forEach(elem => watch(elem, series([elem])));
|
||||
}
|
||||
|
||||
export { build, js, vendor, viewjs, css, live, clean, resourceFileCopy, copyLocales }
|
||||
function release(cb)
|
||||
{
|
||||
return series(publish, bundle, done => { done(); cb(); })();
|
||||
}
|
||||
|
||||
function bundle(cb)
|
||||
{
|
||||
var version = subprocess.spawnSync('git', ['describe', '--tags'], {
|
||||
cwd: process.cwd(),
|
||||
stdio: 'pipe',
|
||||
});
|
||||
var today = new Date();
|
||||
|
||||
var versionObject = {
|
||||
Version: version.output[1].toString().substring(1).replace('\n', ''),
|
||||
ReleaseDate: today.getFullYear().toString() + "-" + today.getMonth().toString().padStart(2, "0") + "-" + today.getDay().toString().padStart(2, "0"),
|
||||
};
|
||||
|
||||
fs.writeFileSync("version.json", JSON.stringify(versionObject, null, 2));
|
||||
|
||||
return src([
|
||||
'**/*',
|
||||
'!yarn.lock',
|
||||
'!package.json',
|
||||
'!postcss.config.js',
|
||||
'!gulpfile.babel.js',
|
||||
'!composer.json',
|
||||
'!composer.lock',
|
||||
'!node_modules/**',
|
||||
'!js/',
|
||||
'!scss/',
|
||||
'!data/config.php',
|
||||
'!data/storage/**',
|
||||
'!data/grocy.db',
|
||||
'data/.htaccess',
|
||||
'public/.htaccess'
|
||||
]).pipe(zip('grocy-' + versionObject.Version + '.zip'))
|
||||
.pipe(dest('.release'))
|
||||
}
|
||||
|
||||
export { build, js, vendor, viewjs, css, live, clean, resourceFileCopy, copyLocales, publish, release, bundle }
|
||||
|
|
@ -60,6 +60,7 @@
|
|||
"gulp-postcss": "^9.0.0",
|
||||
"gulp-sourcemaps": "^3.0.0",
|
||||
"gulp-uglify": "^3.0.2",
|
||||
"gulp-zip": "^5.1.0",
|
||||
"install": "^0.13.0",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"node-sass-tilde-importer": "^1.0.2",
|
||||
|
|
|
|||
37
yarn.lock
37
yarn.lock
|
|
@ -1979,6 +1979,13 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"buffer-crc32@npm:~0.2.3":
|
||||
version: 0.2.13
|
||||
resolution: "buffer-crc32@npm:0.2.13"
|
||||
checksum: 0340e848d6fd87e49ef6f1067f31b2a8d2e71b433e9bb62ff3d9bc2499146f0be586b5b80b0d099c7110a226161b21cb6cd80162dd5a51d9ebdb03da58b99637
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"buffer-equal@npm:^1.0.0":
|
||||
version: 1.0.0
|
||||
resolution: "buffer-equal@npm:1.0.0"
|
||||
|
|
@ -4633,7 +4640,7 @@ fsevents@~2.3.2:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"get-stream@npm:^5.1.0":
|
||||
"get-stream@npm:^5.1.0, get-stream@npm:^5.2.0":
|
||||
version: 5.2.0
|
||||
resolution: "get-stream@npm:5.2.0"
|
||||
dependencies:
|
||||
|
|
@ -4973,6 +4980,7 @@ fsevents@~2.3.2:
|
|||
gulp-postcss: ^9.0.0
|
||||
gulp-sourcemaps: ^3.0.0
|
||||
gulp-uglify: ^3.0.2
|
||||
gulp-zip: ^5.1.0
|
||||
install: ^0.13.0
|
||||
jquery: 3.5.1
|
||||
jquery-lazy: ^1.7.11
|
||||
|
|
@ -5128,6 +5136,24 @@ fsevents@~2.3.2:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"gulp-zip@npm:^5.1.0":
|
||||
version: 5.1.0
|
||||
resolution: "gulp-zip@npm:5.1.0"
|
||||
dependencies:
|
||||
get-stream: ^5.2.0
|
||||
plugin-error: ^1.0.1
|
||||
through2: ^3.0.1
|
||||
vinyl: ^2.1.0
|
||||
yazl: ^2.5.1
|
||||
peerDependencies:
|
||||
gulp: ">=4"
|
||||
peerDependenciesMeta:
|
||||
gulp:
|
||||
optional: true
|
||||
checksum: f81961d4b5eaab5d3b4f9e3d6d11e4944a2c8d73ebbc44affc586d810864d38bb35c590640e19e1e0d322a0c50738b358ddbf73ca0c1cf45e2e7c2fed5497d19
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"gulp@npm:^4.0.2":
|
||||
version: 4.0.2
|
||||
resolution: "gulp@npm:4.0.2"
|
||||
|
|
@ -12153,3 +12179,12 @@ fsevents@~2.3.2:
|
|||
checksum: 584b402e914284428224d7c6222593dc66f66fbeb6db834c8d951219c402ecb7d1124520244ce98238f314bc9dd9477301d808f77156997a9c0b8ded675e48ee
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"yazl@npm:^2.5.1":
|
||||
version: 2.5.1
|
||||
resolution: "yazl@npm:2.5.1"
|
||||
dependencies:
|
||||
buffer-crc32: ~0.2.3
|
||||
checksum: ee9bd2f57dfe1bdca333749bbb42b5a9e68a39871a31d8eed93b5606b8dfa1a1dda89af5cfd274a455c0f5f5790d743538067f2468d3bc8cd4227cdc94bc6ec3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user