Skip to content

Commit

Permalink
Merge pull request #11380 from IgniteUI/sstoychev/use-child-process-e…
Browse files Browse the repository at this point in the history
…xit-code-131

fix(cd): resolving an issue with typedoc erros being swallowed - 13.1
  • Loading branch information
ChronosSF committed Apr 20, 2022
2 parents eebec83 + 792e579 commit 83db40d
Showing 1 changed file with 41 additions and 37 deletions.
78 changes: 41 additions & 37 deletions gulpfile.js
Expand Up @@ -14,7 +14,7 @@ const sassdoc = require('sassdoc');
const path = require('path');
const EventEmitter = require('events').EventEmitter;
const { series } = require('gulp');
const {spawnSync} = require('child_process');
const { spawnSync } = require('child_process');
const slash = require('slash');

const STYLES = {
Expand Down Expand Up @@ -136,9 +136,11 @@ module.exports.copySchematics = (cb) => {
};

const typedocBuildTheme = (cb) => {
spawnSync(`typedoc`, [TYPEDOC.PROJECT_PATH,
"--tsconfig",
path.join(__dirname,"tsconfig.typedoc.json")], { stdio: 'inherit', shell: true });
spawnSync(`typedoc`, [
TYPEDOC.PROJECT_PATH,
"--tsconfig",
path.join(__dirname, "tsconfig.typedoc.json")],
{ stdio: 'inherit', shell: true });
cb();
};
typedocBuildTheme.displayName = 'typedoc-build:theme';
Expand Down Expand Up @@ -168,9 +170,9 @@ function typedocWatchFunc(cb) {
slash(path.join(TYPEDOC_THEME.SRC, 'assets', 'css', '/**/*.{scss,sass}')),
slash(path.join(TYPEDOC_THEME.SRC, '/**/*.hbs')),
slash(path.join(TYPEDOC_THEME.SRC, 'assets', 'images', '/**/*.{png,jpg,gif}')),
], series(typedocBuildTheme, browserReload));
], series(typedocBuildTheme, browserReload));

cb();
cb();
}


Expand All @@ -181,27 +183,29 @@ const TYPEDOC = {
};

function typedocBuildExportFn(cb) {
spawnSync('typedoc', [
const childProcess = spawnSync('typedoc', [
TYPEDOC.PROJECT_PATH,
"--generate-json",
TYPEDOC.EXPORT_JSON_PATH,
"--tags",
"--params",
"--tsconfig",
path.join(__dirname,"tsconfig.typedoc.json")],
path.join(__dirname, "tsconfig.typedoc.json")],
{ stdio: 'inherit', shell: true });
process.exitCode = childProcess.status || 0;
cb();
}

function typedocImportJsonFn(cb) {
spawnSync('typedoc', [
const childProcess = spawnSync('typedoc', [
TYPEDOC.PROJECT_PATH,
"--generate-from-json",
TYPEDOC.EXPORT_JSON_PATH,
"--warns",
"--tsconfig",
path.join(__dirname,"tsconfig.typedoc.json")],
{ stdio: 'inherit', shell: true});
path.join(__dirname, "tsconfig.typedoc.json")],
{ stdio: 'inherit', shell: true });
process.exitCode = childProcess.status || 0;
cb();
}

Expand All @@ -215,31 +219,31 @@ function cleanTypedocOutputDirFn(cb) {
cb();
}

function typedocBuildDocsJA (cb) {
spawnSync('typedoc',[
TYPEDOC.PROJECT_PATH,
'--generate-from-json',
slash(path.join(__dirname, 'i18nRepo', 'typedoc', 'ja')),
'--templateStrings',
TYPEDOC.TEMPLATE_STRINGS_PATH,
'--warns',
'--localize',
'jp',
"--tsconfig",
path.join(__dirname,"tsconfig.typedoc.json")], { stdio: 'inherit', shell: true });

cb();
function typedocBuildDocsJA(cb) {
const childProcess = spawnSync('typedoc', [
TYPEDOC.PROJECT_PATH,
'--generate-from-json',
slash(path.join(__dirname, 'i18nRepo', 'typedoc', 'ja')),
'--templateStrings',
TYPEDOC.TEMPLATE_STRINGS_PATH,
'--warns',
'--localize',
'jp',
"--tsconfig",
path.join(__dirname, "tsconfig.typedoc.json")], { stdio: 'inherit', shell: true });
process.exitCode = childProcess.status || 0;
cb();
}

function typedocBuildDocsEN (cb) {
spawnSync('typedoc', [
TYPEDOC.PROJECT_PATH,
'--localize',
'en',
"--tsconfig",
path.join(__dirname,"tsconfig.typedoc.json")], { stdio: 'inherit', shell: true});

cb();
function typedocBuildDocsEN(cb) {
const childProcess = spawnSync('typedoc', [
TYPEDOC.PROJECT_PATH,
'--localize',
'en',
"--tsconfig",
path.join(__dirname, "tsconfig.typedoc.json")], { stdio: 'inherit', shell: true });
process.exitCode = childProcess.status || 0;
cb();
}

const SASSDOC = {
Expand Down Expand Up @@ -271,7 +275,7 @@ function sassdocBuildJson(cb) {
function sassdocImportJson(cb) {
const options = JSON.parse(fs.readFileSync(SASSDOC.OPTIONS, 'utf8'));

const {render, importDir} = argv;
const { render, importDir } = argv;

options.render = render;
options.json_dir = importDir;
Expand All @@ -283,7 +287,7 @@ function sassdocImportJson(cb) {
cb();
}

function sassdocBuildJA (cb) {
function sassdocBuildJA(cb) {
const pathTranslations = path.join(__dirname, 'i18nRepo', 'sassdoc', 'ja');
const options = JSON.parse(fs.readFileSync(SASSDOC.OPTIONS, 'utf8'));

Expand All @@ -298,7 +302,7 @@ function sassdocBuildJA (cb) {
cb();
}

function sassdocBuildEN (cb) {
function sassdocBuildEN(cb) {
const options = JSON.parse(fs.readFileSync(SASSDOC.OPTIONS, 'utf8'));

options.lang = 'en';
Expand Down

0 comments on commit 83db40d

Please sign in to comment.