mirror of
https://github.com/bpatrik/pigallery2.git
synced 2025-04-23 12:18:59 +02:00
Fixing missing frontend release build and cleaning up package.json
This commit is contained in:
parent
5ad9a65a01
commit
ab19dc577f
41
gulpfile.ts
41
gulpfile.ts
@ -35,16 +35,14 @@ const getSwitch = (name: string, def: string = null): string => {
|
|||||||
return def;
|
return def;
|
||||||
};
|
};
|
||||||
|
|
||||||
gulp.task('build-backend', function(): any {
|
gulp.task('build-backend', (): any =>
|
||||||
return gulp.src([
|
gulp.src([
|
||||||
'src/common/**/*.ts',
|
'src/common/**/*.ts',
|
||||||
'src/backend/**/*.ts',
|
'src/backend/**/*.ts',
|
||||||
'benchmark/**/*.ts'], {base: '.'})
|
'benchmark/**/*.ts'], {base: '.'})
|
||||||
.pipe(tsBackendProject())
|
.pipe(tsBackendProject())
|
||||||
.js
|
.js
|
||||||
.pipe(gulp.dest('./release'));
|
.pipe(gulp.dest('./release')));
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
const createDynamicTranslationFile = async (language: string): Promise<void> => {
|
const createDynamicTranslationFile = async (language: string): Promise<void> => {
|
||||||
@ -137,22 +135,19 @@ const getLanguages = (): any[] | string[] => {
|
|||||||
gulp.task('build-frontend', ((): any => {
|
gulp.task('build-frontend', ((): any => {
|
||||||
const tasks = [];
|
const tasks = [];
|
||||||
createFrontendTask('build-frontend-release default', 'all',
|
createFrontendTask('build-frontend-release default', 'all',
|
||||||
'ng build --prod --no-progress');
|
'ng build --prod --no-progress --output-path=./release/dist');
|
||||||
tasks.push('build-frontend-release default');
|
tasks.push('build-frontend-release default');
|
||||||
return gulp.series(...tasks);
|
return gulp.series(...tasks);
|
||||||
})());
|
})());
|
||||||
|
|
||||||
gulp.task('copy-static', function(): any {
|
gulp.task('copy-static', (): any => gulp.src([
|
||||||
return gulp.src([
|
|
||||||
'src/backend/model/diagnostics/blank.jpg',
|
'src/backend/model/diagnostics/blank.jpg',
|
||||||
'README.md',
|
'README.md',
|
||||||
// 'package-lock.json', should not add, it keeps optional packages optional even with --force-opt-packages.
|
// 'package-lock.json', should not add, it keeps optional packages optional even with --force-opt-packages.
|
||||||
'LICENSE'], {base: '.'})
|
'LICENSE'], {base: '.'})
|
||||||
.pipe(gulp.dest('./release'));
|
.pipe(gulp.dest('./release')));
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('copy-package', function(): any {
|
gulp.task('copy-package', (): any => gulp.src([
|
||||||
return gulp.src([
|
|
||||||
'package.json'], {base: '.'})
|
'package.json'], {base: '.'})
|
||||||
.pipe(jeditor((json: {
|
.pipe(jeditor((json: {
|
||||||
devDependencies: { [key: string]: string },
|
devDependencies: { [key: string]: string },
|
||||||
@ -161,7 +156,13 @@ gulp.task('copy-package', function(): any {
|
|||||||
optionalDependencies: { [key: string]: string },
|
optionalDependencies: { [key: string]: string },
|
||||||
buildTime: string,
|
buildTime: string,
|
||||||
buildCommitHash: string
|
buildCommitHash: string
|
||||||
}): { devDependencies: { [p: string]: string }; scripts: { [p: string]: string }; dependencies: { [p: string]: string }; optionalDependencies: { [p: string]: string }; buildTime: string; buildCommitHash: string } => {
|
}): {
|
||||||
|
devDependencies: { [p: string]: string };
|
||||||
|
scripts: { [p: string]: string };
|
||||||
|
dependencies: { [p: string]: string };
|
||||||
|
optionalDependencies: { [p: string]: string };
|
||||||
|
buildTime: string; buildCommitHash: string
|
||||||
|
} => {
|
||||||
delete json.devDependencies;
|
delete json.devDependencies;
|
||||||
json.scripts = {start: 'node ./src/backend/index.js'};
|
json.scripts = {start: 'node ./src/backend/index.js'};
|
||||||
|
|
||||||
@ -191,15 +192,13 @@ gulp.task('copy-package', function(): any {
|
|||||||
|
|
||||||
return json;
|
return json;
|
||||||
}))
|
}))
|
||||||
.pipe(gulp.dest('./release'));
|
.pipe(gulp.dest('./release')));
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
gulp.task('zip-release', function(): any {
|
gulp.task('zip-release', (): any =>
|
||||||
return gulp.src(['release/**/*'], {base: './release'})
|
gulp.src(['release/**/*'], {base: './release'})
|
||||||
.pipe(zip('pigallery2.zip'))
|
.pipe(zip('pigallery2.zip'))
|
||||||
.pipe(gulp.dest('.'));
|
.pipe(gulp.dest('.')));
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('create-release', gulp.series('build-frontend', 'build-backend', 'copy-static', 'copy-package', 'zip-release'));
|
gulp.task('create-release', gulp.series('build-frontend', 'build-backend', 'copy-static', 'copy-package', 'zip-release'));
|
||||||
|
|
||||||
@ -277,10 +276,10 @@ const merge = async (list: any[], cb: (err?: any) => void): Promise<void> => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
gulp.task('update-translation-only', function(cb): void {
|
gulp.task('update-translation-only', (cb): void => {
|
||||||
translate(getLanguages(), cb).catch(console.error);
|
translate(getLanguages(), cb).catch(console.error);
|
||||||
});
|
});
|
||||||
gulp.task('merge-translation-only', function(cb): void {
|
gulp.task('merge-translation-only', (cb): void => {
|
||||||
merge(getLanguages(), cb).catch(console.error);
|
merge(getLanguages(), cb).catch(console.error);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -133,7 +133,6 @@
|
|||||||
"remap-istanbul": "0.13.0",
|
"remap-istanbul": "0.13.0",
|
||||||
"rxjs": "6.6.7",
|
"rxjs": "6.6.7",
|
||||||
"rxjs-compat": "6.6.7",
|
"rxjs-compat": "6.6.7",
|
||||||
"terser": "5.6.1",
|
|
||||||
"ts-helpers": "1.1.2",
|
"ts-helpers": "1.1.2",
|
||||||
"ts-node": "9.1.1",
|
"ts-node": "9.1.1",
|
||||||
"tslint": "6.1.3",
|
"tslint": "6.1.3",
|
||||||
@ -142,12 +141,6 @@
|
|||||||
"xml2js": "0.4.23",
|
"xml2js": "0.4.23",
|
||||||
"zone.js": "0.11.4"
|
"zone.js": "0.11.4"
|
||||||
},
|
},
|
||||||
"//": [
|
|
||||||
"TODO: remove terser version lock once webpack is fixed"
|
|
||||||
],
|
|
||||||
"resolutions": {
|
|
||||||
"natives": "1.1.3"
|
|
||||||
},
|
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@ffmpeg-installer/ffmpeg": "1.0.20",
|
"@ffmpeg-installer/ffmpeg": "1.0.20",
|
||||||
"@ffprobe-installer/ffprobe": "1.1.0",
|
"@ffprobe-installer/ffprobe": "1.1.0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user