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

[5.6] fork marked and remove npm marked dependency #13444

Merged
merged 2 commits into from
Aug 11, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/optimize
/src/fixtures/vislib/mock_data
/src/forked/*
/src/ui/public/angular-bootstrap
/test/fixtures/scenarios
/src/core_plugins/console/public/webpackShims
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@
"less": "2.7.1",
"less-loader": "2.2.3",
"lodash": "3.10.1",
"marked": "0.3.6",
"minimatch": "2.0.10",
"mkdirp": "0.5.1",
"moment": "2.13.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import marked from 'marked';
import marked from '../../../forked/marked/lib/marked';
Copy link
Contributor

@kobelb kobelb Aug 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to shorten this, and the other imports, to ../../../forked/marked

import { uiModules } from 'ui/modules';
import 'angular-sanitize';

Expand Down
1 change: 1 addition & 0 deletions src/forked/marked/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant, as the .gitignore in the project root already has this.

2 changes: 2 additions & 0 deletions src/forked/marked/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unused as we won't be publishing a npm module for this.

test/
5 changes: 5 additions & 0 deletions src/forked/marked/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: node_js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should probably be removed, we won't be using it.

node_js:
- "0.10"
- "0.8"
- "0.6"
22 changes: 22 additions & 0 deletions src/forked/marked/Gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var gulp = require('gulp');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Gulpfile will never be ran, as we're referencing the lib/marked from everything else, and using our own build process.

var uglify = require('gulp-uglify');
var concat = require('gulp-concat');

var preserveFirstComment = function() {
var set = false;

return function() {
if (set) return false;
set = true;
return true;
};
};

gulp.task('uglify', function() {
gulp.src('lib/marked.js')
.pipe(uglify({preserveComments: preserveFirstComment()}))
.pipe(concat('marked.min.js'))
.pipe(gulp.dest('.'));
});

gulp.task('default', ['uglify']);
19 changes: 19 additions & 0 deletions src/forked/marked/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/)

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.
12 changes: 12 additions & 0 deletions src/forked/marked/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
all:
Copy link
Contributor

@kobelb kobelb Aug 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be deleted as well as we won't be building using make but our own build process.

@cp lib/marked.js marked.js
@uglifyjs --comments '/\*[^\0]+?Copyright[^\0]+?\*/' -o marked.min.js lib/marked.js

clean:
@rm marked.js
@rm marked.min.js

bench:
@node test --bench

.PHONY: clean all
Loading