mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 05:02:23 +08:00
d2106b3de5
* feat: initial support for synced tenants * fix: cleanup * fix: logger now respects logging level * fix: cache now ignores updates issued from itself * feat: print subscriber count * feat: initial nunjucks support * fix: support tenant cache for oidc strategy * fix: replace some constructor initializers with property initializers * fix: audit * [next] Comments and Moderation (#1759) * feat: initial moderation + validation for new comments * fix: added Promiseable type * feat: initial actions impl * feat: more moderation phases * fix: handle settings inheritence * fix: moved settings into new file * fix: defaults and documentation * fix: replace merge with object spread * feat: added integration with akismet * fix: fixed compile * fix: import ordering * fix: merge issue causing build to fail * feat: added gulp, static templates * fix: added compile step back * Fix extract css + remove cross-env
73 lines
2.0 KiB
JavaScript
73 lines
2.0 KiB
JavaScript
const path = require("path");
|
|
const json = require("comment-json");
|
|
const fs = require("fs");
|
|
const del = require("del");
|
|
const gulp = require("gulp");
|
|
const ts = require("gulp-typescript");
|
|
const sourcemaps = require("gulp-sourcemaps");
|
|
const babel = require("gulp-babel");
|
|
const generateTypescriptTypes = require("./scripts/generateSchemaTypes");
|
|
const _ = require("lodash");
|
|
|
|
// Parse the tsconfig.json file (which contains comments).
|
|
const tsconfig = json.parse(fs.readFileSync("./src/tsconfig.json").toString());
|
|
|
|
// Create the typescript project.
|
|
const tsProject = ts.createProject("./src/tsconfig.json");
|
|
|
|
const resolveDistFolder = (...paths) => "./" + path.join("dist", ...paths);
|
|
|
|
gulp.task("clean", () => del([resolveDistFolder()]));
|
|
|
|
gulp.task("server:schema", () => generateTypescriptTypes());
|
|
|
|
gulp.task("server:scripts", () =>
|
|
gulp
|
|
.src([
|
|
"./src/**/*.ts",
|
|
"./src/**/.*.ts",
|
|
// Exclude client files from this, that's for webpack.
|
|
"!./src/core/client/**/*.ts",
|
|
"!./src/core/client/**/.*.ts",
|
|
])
|
|
.pipe(sourcemaps.init())
|
|
.pipe(tsProject())
|
|
.pipe(
|
|
babel({
|
|
plugins: [
|
|
[
|
|
"module-resolver",
|
|
{
|
|
root: [resolveDistFolder()],
|
|
alias: _.reduce(
|
|
tsconfig.compilerOptions.paths,
|
|
(alias, [pathGlob], prefixBlob) => ({
|
|
...alias,
|
|
[prefixBlob.replace(/\/\*/g, "")]: pathGlob
|
|
.replace(/\/\*/g, "")
|
|
.replace(/^\./g, resolveDistFolder()),
|
|
}),
|
|
{}
|
|
),
|
|
},
|
|
],
|
|
],
|
|
})
|
|
)
|
|
.pipe(sourcemaps.write("."))
|
|
.pipe(gulp.dest(resolveDistFolder()))
|
|
);
|
|
|
|
gulp.task("server:static", () =>
|
|
gulp
|
|
.src(["./src/core/server/**/*", "!./src/core/server/**/*.ts"])
|
|
.pipe(gulp.dest(resolveDistFolder() + "/core/server"))
|
|
);
|
|
|
|
gulp.task(
|
|
"server",
|
|
gulp.series("server:schema", gulp.parallel("server:scripts", "server:static"))
|
|
);
|
|
|
|
gulp.task("default", gulp.series("clean", "server"));
|