From 4ae88ee21c4c8e3214d11a5798ef094d3b4eaf81 Mon Sep 17 00:00:00 2001 From: Jonathan Berney Date: Tue, 12 Sep 2017 10:30:10 -0700 Subject: [PATCH] Fix code syntax highlighting, remove deprecated files [#150374399] Signed-off-by: Ming Xiao --- src/css/code/code.scss | 4 +- src/{ => js}/prismjs/README.md | 0 src/{ => js}/prismjs/index.js | 0 src/prismjs/LICENSE | 21 ----------- src/prismjs/package.json | 25 ------------- tasks/css-components.js | 17 +-------- tasks/dev.js | 3 +- tasks/js-components.js | 23 ++++++++++++ tasks/react-components.js | 21 +---------- tasks/release-prepare.js | 67 ---------------------------------- 10 files changed, 29 insertions(+), 152 deletions(-) rename src/{ => js}/prismjs/README.md (100%) rename src/{ => js}/prismjs/index.js (100%) delete mode 100644 src/prismjs/LICENSE delete mode 100644 src/prismjs/package.json create mode 100644 tasks/js-components.js delete mode 100644 tasks/release-prepare.js diff --git a/src/css/code/code.scss b/src/css/code/code.scss index 4108999f8..c5cd6d14a 100644 --- a/src/css/code/code.scss +++ b/src/css/code/code.scss @@ -9,8 +9,8 @@ color: inherit; } -.pre-scrollable { - overflow-y: auto; //bootstrap override +pre.pre-scrollable { + overflow-y: scroll; //bootstrap override } .inline-dark { diff --git a/src/prismjs/README.md b/src/js/prismjs/README.md similarity index 100% rename from src/prismjs/README.md rename to src/js/prismjs/README.md diff --git a/src/prismjs/index.js b/src/js/prismjs/index.js similarity index 100% rename from src/prismjs/index.js rename to src/js/prismjs/index.js diff --git a/src/prismjs/LICENSE b/src/prismjs/LICENSE deleted file mode 100644 index a35001930..000000000 --- a/src/prismjs/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Pivotal Software, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/prismjs/package.json b/src/prismjs/package.json deleted file mode 100644 index 8b8eba6d9..000000000 --- a/src/prismjs/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "pui-prismjs", - "version": "0.0.1", - "description": "A default build of PrismJS for Pivotal UI", - "repository": { - "type": "git", - "url": "https://github.com/pivotal-cf/pivotal-ui.git" - }, - "keywords": [ - "pivotal ui", - "pivotal ui modularized", - "prism", - "prismjs", - "syntax highlighting" - ], - "author": "Pivotal Software, Inc", - "license": "MIT", - "bugs": { - "url": "https://github.com/pivotal-cf/pivotal-ui/issues" - }, - "homepage": "http://styleguide.pivotal.io/", - "dependencies": { - "prismjs": "^0.0.1" - } -} diff --git a/tasks/css-components.js b/tasks/css-components.js index 8c8cbe785..0d5480fcb 100644 --- a/tasks/css-components.js +++ b/tasks/css-components.js @@ -38,19 +38,4 @@ gulp.task('css-build', callback => runSequence('css-clean', [ 'css-build-src', 'css-build-assets', 'css-build-variables-and-mixins-package' -], callback)); - -gulp.task('css-publish', ['css-build'], async () => { - if (!argv.component) { - return new Error('Usage: gulp css-publish --component '); - } - - const publish = argv.dry ? publishFakePackages() : publishPackages(); - - await publish([ - { - name: `pui-css-${argv.component}`, - dir: path.join('dist', 'css', argv.component) - } - ]); -}); +], callback)); \ No newline at end of file diff --git a/tasks/dev.js b/tasks/dev.js index 7cae89223..e55c79be8 100644 --- a/tasks/dev.js +++ b/tasks/dev.js @@ -39,5 +39,6 @@ gulp.task('build', [ 'build-readme', 'build-package', 'css-build', - 'react-build' + 'react-build', + 'js-build' ]); diff --git a/tasks/js-components.js b/tasks/js-components.js new file mode 100644 index 000000000..991f4d164 --- /dev/null +++ b/tasks/js-components.js @@ -0,0 +1,23 @@ +import del from 'del'; +import gulp from 'gulp'; +import path from 'path'; +import runSequence from 'run-sequence'; +import {publishPackages} from './helpers/publish-helper'; + +const plugins = require('gulp-load-plugins')(); +const argv = require('yargs').argv; + +const COPYRIGHT = '/*(c) Copyright 2015 Pivotal Software, Inc. All Rights Reserved.*/\n'; +const buildFolder = 'dist/js'; + +gulp.task('js-build-src', function() { + return gulp.src('src/js/**/*.js') + .pipe(plugins.plumber()) + .pipe(plugins.babel()) + .pipe(plugins.header(COPYRIGHT)) + .pipe(gulp.dest(buildFolder)); +}); + +gulp.task('js-clean', callback => del([buildFolder], callback)); + +gulp.task('js-build', callback => runSequence('js-clean', 'js-build-src', callback)); \ No newline at end of file diff --git a/tasks/react-components.js b/tasks/react-components.js index b1990422d..94d8ad764 100644 --- a/tasks/react-components.js +++ b/tasks/react-components.js @@ -1,12 +1,8 @@ import del from 'del'; import gulp from 'gulp'; -import path from 'path'; import runSequence from 'run-sequence'; -import {publishPackages} from './helpers/publish-helper'; const plugins = require('gulp-load-plugins')(); -const argv = require('yargs').argv; - const COPYRIGHT = '/*(c) Copyright 2015 Pivotal Software, Inc. All Rights Reserved.*/\n'; const buildFolder = 'dist/react'; @@ -20,19 +16,4 @@ gulp.task('react-build-src', function() { gulp.task('react-clean', callback => del([buildFolder], callback)); -gulp.task('react-build', callback => runSequence('react-clean', 'react-build-src', callback)); - -gulp.task('react-publish', ['react-build'], async () => { - if (!argv.component) { - return new Error('Usage: gulp react-publish --component '); - } - - const publish = argv.dry ? publishFakePackages() : publishPackages(); - - await publish([ - { - name: `pui-react-${argv.component}`, - dir: path.join('dist', 'react', argv.component) - } - ]); -}); +gulp.task('react-build', callback => runSequence('react-clean', 'react-build-src', callback)); \ No newline at end of file diff --git a/tasks/release-prepare.js b/tasks/release-prepare.js deleted file mode 100644 index 658f0b96c..000000000 --- a/tasks/release-prepare.js +++ /dev/null @@ -1,67 +0,0 @@ -/* eslint no-console-log:0 no-alert:0 */ - -import {exec} from 'child_process'; -import gulp from 'gulp'; -import {merge, map, readArray} from 'event-stream'; -import path from 'path'; -import promisify from 'es6-promisify'; -import runSequence from 'run-sequence'; -import {log, colors} from 'gulp-util'; -import {argv} from 'yargs'; - -import {getNewVersion} from './helpers/version-helper'; -import { - componentsWithChanges, - componentsToUpdate, - updatePackageJsons -} from './helpers/package-version-helper'; -import {writeFileSync} from 'jsonfile'; - -const execPromise = promisify(exec); - -gulp.task('release-update-version', (done) => { - (async function () { - const packageJsonPath = path.join(process.cwd(), 'package.json'); - - const jsonContents = require(packageJsonPath); - - let userVersion = argv.version; - - if (!userVersion) { - throw new Error('missing version'); - } - - jsonContents.version = userVersion; - - writeFileSync(packageJsonPath, jsonContents, {spaces: 2}); - delete require.cache[packageJsonPath]; - done(); - })(); -}); - -gulp.task('release-update-package-versions', (done) => { - componentsWithChanges().then((components) => { - readArray(components) - .pipe(componentsToUpdate()) - .pipe(updatePackageJsons()) - .pipe(gulp.dest('.')) - .on('end', done); - }); -}); - -gulp.task('release-commit', () => - execPromise( - `git add package.json \ - src/pivotal-ui/components/*/package.json \ - src/pivotal-ui-react/*/package.json \ - && git commit -m "v${getNewVersion()}"` - ) -); - -gulp.task('release-prepare', (done) => - runSequence( - 'release-update-version', - 'release-update-package-versions', - done - ) -);