mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-09-23 20:35:47 +00:00
Initial commit
This commit is contained in:
38
gulp/docs.js
Normal file
38
gulp/docs.js
Normal file
@@ -0,0 +1,38 @@
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
|
||||
function gulptasksDocs($, gulp, buildFolder) {
|
||||
gulp.task("docs.convertJsToTs", () => {
|
||||
return gulp
|
||||
.src(path.join("..", "src", "js", "**", "*.js"))
|
||||
.pipe(
|
||||
$.rename(path => {
|
||||
path.extname = ".ts";
|
||||
})
|
||||
)
|
||||
.pipe(gulp.dest(path.join("..", "tsc_temp")));
|
||||
});
|
||||
|
||||
gulp.task("docs.copyTsconfigForHints", () => {
|
||||
const src = fs.readFileSync(path.join("..", "src", "js", "tsconfig.json")).toString();
|
||||
const baseConfig = JSON.parse($.stripJsonComments(src));
|
||||
|
||||
baseConfig.allowJs = false;
|
||||
baseConfig.checkJs = false;
|
||||
baseConfig.declaration = true;
|
||||
baseConfig.noEmit = false;
|
||||
baseConfig.strict = false;
|
||||
baseConfig.strictFunctionTypes = false;
|
||||
baseConfig.strictBindCallApply = false;
|
||||
baseConfig.alwaysStrict = false;
|
||||
baseConfig.composite = true;
|
||||
baseConfig.outFile = "bundled-ts.js";
|
||||
fs.writeFileSync(path.join("..", "tsc_temp", "tsconfig.json"), JSON.stringify(baseConfig));
|
||||
});
|
||||
|
||||
gulp.task("main.prepareDocs", $.sequence("docs.convertJsToTs", "docs.copyTsconfigForHints"));
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
gulptasksDocs,
|
||||
};
|
||||
Reference in New Issue
Block a user