Skip to content

Commit eb4c8e0

Browse files
authored
Merge pull request #3689 from IgniteUI/api-docs-gulp-7.1.x
Modify gulp api docs tasks in order to follow the build steps
2 parents ce163ab + 37d61bf commit eb4c8e0

File tree

2 files changed

+15
-31
lines changed

2 files changed

+15
-31
lines changed

gulpfile.js

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,6 @@ gulp.task('sassdoc-build', [
273273
'sassdoc-js'
274274
])
275275

276-
const TRANSLATIONS_REPO = {
277-
NAME: 'igniteui-angular-api-i18n',
278-
LINK: `https://github.com/IgniteUI/igniteui-angular-api-i18n`
279-
};
280-
281276
const DOCS_OUTPUT_PATH = path.join(__dirname, 'dist', 'igniteui-angular', 'docs');
282277

283278
const TYPEDOC = {
@@ -298,28 +293,20 @@ gulp.task('typedoc-build:import', ['typedoc-build'],
298293
shell.task(`typedoc ${TYPEDOC.PROJECT_PATH} --generate-from-json ${TYPEDOC.EXPORT_JSON_PATH}`)
299294
);
300295

301-
gulp.task('clean-translations:localization:repo', () => {
302-
del.sync(`${DOCS_OUTPUT_PATH}/${TRANSLATIONS_REPO.NAME}`)
303-
});
304-
305296
gulp.task('create:docs-output-path', () => {
306297
!fs.existsSync(DOCS_OUTPUT_PATH) && fs.mkdirSync(DOCS_OUTPUT_PATH);
307298
});
308299

309-
gulp.task('copy-translations:localization:repo', ['clean-translations:localization:repo', 'create:docs-output-path'],
310-
shell.task(`git -C ${DOCS_OUTPUT_PATH} clone ${TRANSLATIONS_REPO.LINK}`)
311-
);
312-
313300
gulp.task('typedoc:clean-docs-dir', () => {
314301
del.sync(`${DOCS_OUTPUT_PATH}typescript`)
315302
});
316303

317-
gulp.task('typedoc-build:doc:ja:localization', ['typedoc-build', 'typedoc:clean-docs-dir', 'copy-translations:localization:repo'],
318-
shell.task(`typedoc ${TYPEDOC.PROJECT_PATH} --generate-from-json ${DOCS_OUTPUT_PATH}\\${TRANSLATIONS_REPO.NAME}\\typedoc\\ja --templateStrings ${TYPEDOC.TEMPLATE_STRINGS_PATH} --localize jp`)
304+
gulp.task('typedoc-build:doc:ja:localization', ['typedoc-build', 'create:docs-output-path', 'typedoc:clean-docs-dir'],
305+
shell.task(`typedoc ${TYPEDOC.PROJECT_PATH} --generate-from-json ${path.join(__dirname, 'i18nRepo', 'typedoc', 'ja')} --templateStrings ${TYPEDOC.TEMPLATE_STRINGS_PATH} --localize jp`)
319306
);
320307

321-
gulp.task('typedoc-build:doc:en:localization', ['typedoc-build', 'typedoc:clean-docs-dir', 'copy-translations:localization:repo'],
322-
shell.task(`typedoc ${TYPEDOC.PROJECT_PATH} --generate-from-json ${DOCS_OUTPUT_PATH}\\${TRANSLATIONS_REPO.NAME}\\typedoc\\en --localize en`)
308+
gulp.task('typedoc-build:doc:en:localization', ['typedoc-build', 'create:docs-output-path', 'typedoc:clean-docs-dir'],
309+
shell.task(`typedoc ${TYPEDOC.PROJECT_PATH} --localize en`)
323310
);
324311

325312
const SASSDOC = {
@@ -348,8 +335,8 @@ gulp.task('sassdoc-build:import', () => {
348335
.pipe(sassdoc(options))
349336
});
350337

351-
gulp.task('sassdoc-build:doc:ja:localizaiton', ['sassdoc-build', 'sassdoc:clean-docs-dir', 'copy-translations:localization:repo'], () => {
352-
const pathTranslations = path.join(DOCS_OUTPUT_PATH, TRANSLATIONS_REPO.NAME, 'sassdoc', 'ja');
338+
gulp.task('sassdoc-build:doc:ja:localizaiton', ['sassdoc-build', 'sassdoc:clean-docs-dir'], () => {
339+
const pathTranslations = path.join(__dirname, 'i18nRepo', 'sassdoc', 'ja');
353340
const options = JSON.parse(fs.readFileSync(SASSDOC.OPTIONS, 'utf8'));
354341

355342
options.lang = 'jp';
@@ -360,13 +347,10 @@ gulp.task('sassdoc-build:doc:ja:localizaiton', ['sassdoc-build', 'sassdoc:clean-
360347
.pipe(sassdoc(options));
361348
});
362349

363-
gulp.task('sassdoc-build:doc:en:localizaiton', ['sassdoc-build', 'sassdoc:clean-docs-dir', 'copy-translations:localization:repo'], () => {
364-
const pathTranslations = path.join(DOCS_OUTPUT_PATH, TRANSLATIONS_REPO.NAME, 'sassdoc', 'en');
350+
gulp.task('sassdoc-build:doc:en:localizaiton', ['sassdoc-build', 'sassdoc:clean-docs-dir'], () => {
365351
const options = JSON.parse(fs.readFileSync(SASSDOC.OPTIONS, 'utf8'));
366352

367353
options.lang = 'en';
368-
options.render = argv.render;
369-
options.json_dir = pathTranslations;
370354

371355
return gulp.src(`${SASSDOC.PROJECT_PATH}/**/*.scss`)
372356
.pipe(sassdoc(options));

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
"typedoc-build:import": "gulp typedoc-build:import",
2424
"sassdoc-build:export": "gulp sassdoc-build:export --convert true && gulp sassdoc:clean-docs-dir",
2525
"sassdoc-build:import": "gulp sassdoc-build:import --render true",
26-
"build:typedoc:ja:production": "set NODE_ENV=production && gulp typedoc-build:doc:ja:localization && gulp clean-translations:localization:repo",
27-
"build:typedoc:ja:staging": "set NODE_ENV=staging && gulp typedoc-build:doc:ja:localization && gulp clean-translations:localization:repo",
28-
"build:typedoc:en:production": "set NODE_ENV=production && gulp typedoc-build:doc:en:localization && gulp clean-translations:localization:repo",
29-
"build:typedoc:en:staging": "set NODE_ENV=staging && gulp typedoc-build:doc:en:localization && gulp clean-translations:localization:repo",
30-
"build:sassdoc:en:production": "set NODE_ENV=production && set SASSDOC_LANG=en && gulp sassdoc-build:doc:en:localizaiton --render true && gulp clean-translations:localization:repo",
31-
"build:sassdoc:en:staging": "set NODE_ENV=staging && set SASSDOC_LANG=en && gulp sassdoc-build:doc:en:localizaiton --render true && gulp clean-translations:localization:repo",
32-
"build:sassdoc:ja:production": "set NODE_ENV=production && set SASSDOC_LANG=jp && gulp sassdoc-build:doc:ja:localizaiton --render true && gulp clean-translations:localization:repo",
33-
"build:sassdoc:ja:staging": "set NODE_ENV=staging && set SASSDOC_LANG=jp && gulp sassdoc-build:doc:ja:localizaiton --render true && gulp clean-translations:localization:repo",
26+
"build:typedoc:ja:production": "set NODE_ENV=production && gulp typedoc-build:doc:ja:localization",
27+
"build:typedoc:ja:staging": "set NODE_ENV=staging && gulp typedoc-build:doc:ja:localization",
28+
"build:typedoc:en:production": "set NODE_ENV=production && gulp typedoc-build:doc:en:localization",
29+
"build:typedoc:en:staging": "set NODE_ENV=staging && gulp typedoc-build:doc:en:localization",
30+
"build:sassdoc:en:production": "set NODE_ENV=production && set SASSDOC_LANG=en && gulp sassdoc-build:doc:en:localizaiton",
31+
"build:sassdoc:en:staging": "set NODE_ENV=staging && set SASSDOC_LANG=en && gulp sassdoc-build:doc:en:localizaiton",
32+
"build:sassdoc:ja:production": "set NODE_ENV=production && set SASSDOC_LANG=jp && gulp sassdoc-build:doc:ja:localizaiton --render true",
33+
"build:sassdoc:ja:staging": "set NODE_ENV=staging && set SASSDOC_LANG=jp && gulp sassdoc-build:doc:ja:localizaiton --render true",
3434
"postinstall": "gulp copy-git-hooks"
3535
},
3636
"private": true,

0 commit comments

Comments
 (0)