Skip to content
Permalink
Browse files
Merge branch 'new-doc'
  • Loading branch information
pissang committed Dec 31, 2019
2 parents f922ef7 + d24cf45 commit f334050bd6b80ad5df439447b02f014c0302ee4e
Show file tree
Hide file tree
Showing 13 changed files with 167,528 additions and 16 deletions.
@@ -63,16 +63,16 @@ module.exports = {
// optimize: 'none',
name: 'docTool/main',
exclude: ['globalArgs', 'prettyPrint'],
out: 'release/js/docTool/main.js',
baseUrl: './js',
out: 'release/zh/js/docTool/main.js',
baseUrl: './legacy/js',
paths: {
dt: '../vendors/dt/0.0.1',
tpl: '../vendors/dt/0.0.1/tplLoader',
etpl: '../vendors/etpl/3.0.0/etpl.min',
signals: '../vendors/signals/1.0.0/signals.min',
hasher: '../vendors/hasher/1.2.0/hasher.min',
jquery: '../vendors/jquery/jquery.min',
perfectScrollbar: '../vendors/perfect-scrollbar/0.6.8/js/perfect-scrollbar'
dt: '../../vendors/dt/0.0.1',
tpl: '../../vendors/dt/0.0.1/tplLoader',
etpl: '../../vendors/etpl/3.0.0/etpl.min',
signals: '../../vendors/signals/1.0.0/signals.min',
hasher: '../../vendors/hasher/1.2.0/hasher.min',
jquery: '../../vendors/jquery/jquery.min',
perfectScrollbar: '../../vendors/perfect-scrollbar/0.6.8/js/perfect-scrollbar'
},
rawText: {
'globalArgs': 'define(function () {});',
@@ -103,8 +103,8 @@ gulp.task('sass', function () {
gulp.task('less', function () {
// FIXME: where to put css, when using lots of vendor components including css.
return gulp.src([
'js/docTool/ecOption.less',
'js/spreadsheet/spreadsheet.less'
'legacy/js/docTool/ecOption.less',
'legacy/js/spreadsheet/spreadsheet.less'
])
.pipe(less({
paths: ['vendors'],
@@ -116,7 +116,8 @@ gulp.task('less', function () {
.pipe(prefix(['last 15 versions', '> 1%', 'ie 8', 'ie 7'], {
cascade: true
}))
.pipe(gulp.dest('css'));
.pipe(gulp.dest(path.join(TEMP_RELEASE_DIR, 'zh/css')))
.pipe(gulp.dest(path.join(TEMP_RELEASE_DIR, 'en/css')));
});
/**
* Update source code version
@@ -176,14 +177,34 @@ gulp.task('release-spreadsheetJS', function (taskReady) {
);
});

// DEPRECATED Remove this when option3.html is not support ASAP.
gulp.task('release-docJS-old', function (taskReady) {
requirejs.optimize(
config.docToolConfig,
function () {
fse.ensureDirSync('release/en/js/docTool/');
fse.copyFileSync(
'release/zh/js/docTool/main.js',
'release/en/js/docTool/main.js',
);
taskReady();
},
function (error) {
console.error('requirejs task failed', error.message);
process.exit(1);
}
);

});

gulp.task('release-otherJS', function () {
return gulp.src(['js/*.js'])
.pipe(uglify())
.pipe(gulp.dest(path.join(TEMP_RELEASE_DIR, 'zh/js')))
.pipe(gulp.dest(path.join(TEMP_RELEASE_DIR, 'en/js')));
});

gulp.task('release-js', ['release-spreadsheetJS', 'release-otherJS']);
gulp.task('release-js', ['release-spreadsheetJS', 'release-docJS-old', 'release-otherJS']);

gulp.task('copy', ['sass', 'less', 'jade', 'release-js', 'release-clean'], function () {
['vendors', 'images', 'js/spreadsheet', 'asset/map', 'asset/theme', 'builder', 'dist', 'video', 'config'].forEach(function (folder) {
@@ -205,7 +226,16 @@ gulp.task('copy', ['sass', 'less', 'jade', 'release-js', 'release-clean'], funct
gulp.src(patterns)
.pipe(copy(path.join(TEMP_RELEASE_DIR, 'zh'))),
gulp.src(patterns)
.pipe(copy(path.join(TEMP_RELEASE_DIR, 'en')))
.pipe(copy(path.join(TEMP_RELEASE_DIR, 'en'))),

// Move legacy option3.json
gulp.src(['legacy/option3.json'])
.pipe(gulp.dest(path.join(TEMP_RELEASE_DIR, 'zh/documents/'))),
// Move legacy css fonts
gulp.src(['legacy/css/font/*'])
.pipe(gulp.dest(path.join(TEMP_RELEASE_DIR, 'zh/css/font/'))),
gulp.src(['legacy/js/docTool/*.tpl.html'])
.pipe(gulp.dest(path.join(TEMP_RELEASE_DIR, 'zh/js/docTool/')))
]);
});

Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -143,8 +143,7 @@ define(function (require) {

$.getJSON(
docUtil.addVersionArg([
'../documents',
lang.langCode,
'./documents',
schemaName + '.json'
].join('/'))
).done($.proxy(function (schema) {
File renamed without changes.
File renamed without changes.

0 comments on commit f334050

Please sign in to comment.