Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cd): resolving an issue with typedoc erros being swallowed - 13.1 #11380

Merged
merged 6 commits into from Apr 20, 2022
Merged
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