mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-07 01:26:42 +02:00
Remove 'fs' as dependency
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mermaid",
|
||||
"version": "7.0.12",
|
||||
"version": "7.0.13",
|
||||
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
||||
"main": "dist/mermaid.core.js",
|
||||
"keywords": [
|
||||
|
@@ -731,12 +731,12 @@ exports.parser = parser;
|
||||
exports.Parser = parser.Parser;
|
||||
exports.parse = function () { return parser.parse.apply(parser, arguments); };
|
||||
exports.main = function commonjsMain(args) {
|
||||
if (!args[1]) {
|
||||
console.log('Usage: '+args[0]+' FILE');
|
||||
process.exit(1);
|
||||
}
|
||||
var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||
return exports.parser.parse(source);
|
||||
// if (!args[1]) {
|
||||
// console.log('Usage: '+args[0]+' FILE');
|
||||
// process.exit(1);
|
||||
// }
|
||||
// var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||
// return exports.parser.parse(source);
|
||||
};
|
||||
if (typeof module !== 'undefined' && require.main === module) {
|
||||
exports.main(process.argv.slice(1));
|
||||
|
@@ -621,12 +621,12 @@ exports.parser = parser;
|
||||
exports.Parser = parser.Parser;
|
||||
exports.parse = function () { return parser.parse.apply(parser, arguments); };
|
||||
exports.main = function commonjsMain(args) {
|
||||
if (!args[1]) {
|
||||
console.log('Usage: '+args[0]+' FILE');
|
||||
process.exit(1);
|
||||
}
|
||||
var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||
return exports.parser.parse(source);
|
||||
// if (!args[1]) {
|
||||
// console.log('Usage: '+args[0]+' FILE');
|
||||
// process.exit(1);
|
||||
// }
|
||||
// var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||
// return exports.parser.parse(source);
|
||||
};
|
||||
if (typeof module !== 'undefined' && require.main === module) {
|
||||
exports.main(process.argv.slice(1));
|
||||
|
@@ -731,12 +731,12 @@ exports.parser = parser;
|
||||
exports.Parser = parser.Parser;
|
||||
exports.parse = function () { return parser.parse.apply(parser, arguments); };
|
||||
exports.main = function commonjsMain(args) {
|
||||
if (!args[1]) {
|
||||
console.log('Usage: '+args[0]+' FILE');
|
||||
process.exit(1);
|
||||
}
|
||||
var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||
return exports.parser.parse(source);
|
||||
// if (!args[1]) {
|
||||
// console.log('Usage: '+args[0]+' FILE');
|
||||
// process.exit(1);
|
||||
// }
|
||||
// var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||
// return exports.parser.parse(source);
|
||||
};
|
||||
if (typeof module !== 'undefined' && require.main === module) {
|
||||
exports.main(process.argv.slice(1));
|
||||
|
@@ -952,12 +952,12 @@ exports.parser = parser;
|
||||
exports.Parser = parser.Parser;
|
||||
exports.parse = function () { return parser.parse.apply(parser, arguments); };
|
||||
exports.main = function commonjsMain(args) {
|
||||
if (!args[1]) {
|
||||
console.log('Usage: '+args[0]+' FILE');
|
||||
process.exit(1);
|
||||
}
|
||||
var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||
return exports.parser.parse(source);
|
||||
// if (!args[1]) {
|
||||
// console.log('Usage: '+args[0]+' FILE');
|
||||
// process.exit(1);
|
||||
// }
|
||||
// var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||
// return exports.parser.parse(source);
|
||||
};
|
||||
if (typeof module !== 'undefined' && require.main === module) {
|
||||
exports.main(process.argv.slice(1));
|
||||
|
@@ -647,12 +647,12 @@ exports.parser = parser;
|
||||
exports.Parser = parser.Parser;
|
||||
exports.parse = function () { return parser.parse.apply(parser, arguments); };
|
||||
exports.main = function commonjsMain(args) {
|
||||
if (!args[1]) {
|
||||
console.log('Usage: '+args[0]+' FILE');
|
||||
process.exit(1);
|
||||
}
|
||||
var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||
return exports.parser.parse(source);
|
||||
// if (!args[1]) {
|
||||
// console.log('Usage: '+args[0]+' FILE');
|
||||
// process.exit(1);
|
||||
// }
|
||||
// var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||
// return exports.parser.parse(source);
|
||||
};
|
||||
if (typeof module !== 'undefined' && require.main === module) {
|
||||
exports.main(process.argv.slice(1));
|
||||
|
@@ -687,12 +687,12 @@ exports.parser = parser;
|
||||
exports.Parser = parser.Parser;
|
||||
exports.parse = function () { return parser.parse.apply(parser, arguments); };
|
||||
exports.main = function commonjsMain(args) {
|
||||
if (!args[1]) {
|
||||
console.log('Usage: '+args[0]+' FILE');
|
||||
process.exit(1);
|
||||
}
|
||||
var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||
return exports.parser.parse(source);
|
||||
// if (!args[1]) {
|
||||
// console.log('Usage: '+args[0]+' FILE');
|
||||
// process.exit(1);
|
||||
// }
|
||||
// var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||
// return exports.parser.parse(source);
|
||||
};
|
||||
if (typeof module !== 'undefined' && require.main === module) {
|
||||
exports.main(process.argv.slice(1));
|
||||
|
@@ -797,12 +797,12 @@ exports.parser = parser;
|
||||
exports.Parser = parser.Parser;
|
||||
exports.parse = function () { return parser.parse.apply(parser, arguments); };
|
||||
exports.main = function commonjsMain(args) {
|
||||
if (!args[1]) {
|
||||
console.log('Usage: '+args[0]+' FILE');
|
||||
process.exit(1);
|
||||
}
|
||||
var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||
return exports.parser.parse(source);
|
||||
// if (!args[1]) {
|
||||
// console.log('Usage: '+args[0]+' FILE');
|
||||
// process.exit(1);
|
||||
// }
|
||||
// var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||
// return exports.parser.parse(source);
|
||||
};
|
||||
if (typeof module !== 'undefined' && require.main === module) {
|
||||
exports.main(process.argv.slice(1));
|
||||
|
3
todo.md
3
todo.md
@@ -9,7 +9,6 @@
|
||||
- Get familar with jison
|
||||
- git graph requires a blank line at the end. why?
|
||||
- Move cli to mermaid-cli project ?
|
||||
- Remove 'fs' as dependency
|
||||
- Remove 'lodash' as dependency
|
||||
- https://github.com/lodash/babel-plugin-lodash
|
||||
- https://www.npmjs.com/package/lodash-webpack-plugin
|
||||
@@ -23,3 +22,5 @@
|
||||
- Generate them into system temp folder instead
|
||||
- Replace phantomjs with Chrome headless
|
||||
- `yarn jest` is disabled
|
||||
- Don't manually change jison generated files
|
||||
- Removed 'fs' dependency from it
|
||||
|
@@ -16,7 +16,6 @@ export const jsConfig = () => {
|
||||
entry: {
|
||||
mermaid: './src/mermaid.js'
|
||||
},
|
||||
externals: ['fs'],
|
||||
output: {
|
||||
path: path.join(__dirname, './dist/'),
|
||||
filename: '[name].js',
|
||||
|
@@ -5,7 +5,7 @@ import { jsConfig, lessConfig } from './webpack.config.base'
|
||||
const config = jsConfig()
|
||||
|
||||
const coreConfig = jsConfig()
|
||||
coreConfig.externals = [nodeExternals(), 'fs']
|
||||
coreConfig.externals = [nodeExternals()]
|
||||
coreConfig.output.filename = '[name].core.js'
|
||||
|
||||
const cssConfig = lessConfig()
|
||||
|
Reference in New Issue
Block a user