Skip to content

ci: rework sassdoc build and bump theme and localization to 2.0.0 #15943

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

Open
wants to merge 5 commits into
base: 20.0.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ jobs:
run: npm run build:migrations
- name: Build TypeDoc & SassDoc
run: |
npm run build:typedoc:en:production
npm run build:sassdoc:en:production
npm run build:docs
- name: Test
run: |
npm run test:lib
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ src/**/*.js
src/**/*.js.map
src/**/*.css.map

# Typedoc Theme
# Typedoc and SassDoc Themes
extras/sassdoc/**/*
extras/docs/themes/typedoc/bin
extras/docs/themes/sassdoc/node_modules
extras/docs/themes/sassdoc/sassdoc/*
Expand Down
95 changes: 0 additions & 95 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
'use strict';

const del = require('del');
const gulp = require('gulp');
const process = require('process');
const fs = require('fs');
const argv = require('yargs').argv;
const sassdoc = require('sassdoc');
const path = require('path');
const { series } = require('gulp');
const slash = require('slash');

const DOCS_OUTPUT_PATH = slash(path.join(__dirname, 'dist', 'igniteui-angular', 'docs'));

module.exports.copyGitHooks = async (cb) => {

if (process.env.AZURE_PIPELINES || process.env.TRAVIS || process.env.CI || !fs.existsSync('.git')) {
return;
}
Expand Down Expand Up @@ -88,93 +80,6 @@ module.exports.copySchematics = (cb) => {
};


function createDocsOutputDirFn(cb) {
!fs.existsSync(DOCS_OUTPUT_PATH) && fs.mkdirSync(DOCS_OUTPUT_PATH);
cb();
}

const SASSDOC = {
PROJECT_PATHS: [
`${path.join(__dirname, 'projects', 'igniteui-angular', 'src', 'lib', 'core', 'styles')}/**/*.scss`,
`${path.join(__dirname, 'node_modules', 'igniteui-theming', 'sass')}/**/*.scss`
],
DEST: path.join(DOCS_OUTPUT_PATH, 'sass'),
OPTIONS: path.join(__dirname, '.sassdocrc'),
};

const sassdocCleanOutputDir = (cb) => {
del.sync(SASSDOC.DEST);
cb();
}

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

const { convert, exportDir } = argv;

options.convert = convert;
options.exportDir = exportDir;

gulp.src(SASSDOC.PROJECT_PATHS)
.pipe(sassdoc(options));

cb();

}

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

const { render, importDir } = argv;

options.render = render;
options.json_dir = importDir;
options.shellStringsPath = path.join(__dirname, 'extras', 'template', 'strings', 'shell-strings.json');

gulp.src(SASSDOC.PROJECT_PATHS)
.pipe(sassdoc(options));

cb();
}

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

options.lang = 'jp';
options.render = argv.render;
options.json_dir = pathTranslations;
options.shellStringsPath = path.join(__dirname, 'extras', 'template', 'strings', 'shell-strings.json');

gulp.src(SASSDOC.PROJECT_PATHS)
.pipe(sassdoc(options));

cb();
}

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

options.lang = 'en';
options.shellStringsPath = path.join(__dirname, 'extras', 'template', 'strings', 'shell-strings.json');

gulp.src(SASSDOC.PROJECT_PATHS)
.pipe(sassdoc(options));

cb();
}

module.exports.createDocsOutputDir = createDocsOutputDirFn;

/**
* Sassdoc build tasks
*/
module.exports.sassdocCleanOutputDir = sassdocCleanOutputDir;
module.exports.sassdocImportJson = sassdocImportJson;
module.exports.sassdocBuildJson = sassdocBuildJson;
module.exports.sassdocBuildJA = series(sassdocCleanOutputDir, sassdocBuildJA);
module.exports.sassdocBuildEN = series(sassdocCleanOutputDir, sassdocBuildEN);

module.exports.copyPackageForElements = (cb) => {
return gulp.src([
path.join(__dirname, 'projects/igniteui-angular-elements/package.json')
Expand Down
Loading
Loading