Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jsdef

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsdef - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

12

bin/jsdef.js

@@ -9,2 +9,11 @@ #!/usr/bin/env node

program.version(cliUtils.getPkgVersion(__dirname + '/..'))
.option('-v, --version')
.option('-c, --changelog')
.parse(process.argv)
if (program.changelog) {
console.log(utils.readFile(__dirname + '/../CHANGELOG.md'));
}
program.command('init-config')

@@ -75,4 +84,1 @@ .option('-k, --projectKey [projectKey]')

})
program.parse(process.argv);
## 0.1.5
- jsdef.confg加上默认excludes全局忽略

@@ -11,3 +10,2 @@ - chokidar watch 文件优化, 只watch includes的文件路径

## 0.1.6
- srcTab部分文件排序(参考IDE文件顺序)

@@ -18,10 +16,12 @@ - 侧边栏树结构搜索允许路径搜索(src, doc部分:dir/dir/file; api部分:aa.bb.cc)

## 0.1.7
- sitemap放在config.dist下
- fix注释不带缩进问题
## 0.1.8
- UI优化: apiBlock带border-left, 且可展缩
- CLI: jsdef --version, jsdef --changelog
- parsing 加上解析时间console
## todolist
- 同def-block内, 点击propName搜索高亮
- def-block展缩功能
- 搜索算法优化(同api, 同src文件提高权重)
{
"name": "jsdef",
"version": "0.1.7",
"version": "0.1.8",
"description": "A tool to parse documentation for javascript in a more straight-forward way",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -310,3 +310,7 @@ var utils = require('./utils');

module.exports = function (jsDefConfig) {
var startTime = +new Date;
var currentTime = +new Date;
console.log('jsdef parsing...');
console.log('start parsing file path...');
var fileList = utils.flattenFiles(jsDefConfig.root, jsDefConfig.excludes);

@@ -319,9 +323,26 @@ var srcFileList = utils.filterFiles(fileList, jsDefConfig.src);

var distPath = jsDefConfig.dist || jsDefConfig.root + '/jsdef';
console.log('finished parsing file path in ' + (+new Date - currentTime) + ' ms');
currentTime = +new Date;
if (srcFileList && srcFileList.length) {
console.log('start parsing source files...');
ret = fileTreeBuilder.buildTree(srcFileList, 'src', jsDefConfig);
files = files.concat(fileTreeBuilder.sortTree(ret.tree));
console.log('finished parsing source files in ' + (+new Date - currentTime) + ' ms');
currentTime = +new Date;
console.log('start sorting source entries...');
var srcTree = fileTreeBuilder.sortTree(ret.tree);
console.log('finished sorting source entries in ' + (+new Date - currentTime) + ' ms');
currentTime = +new Date;
files = files.concat(srcTree);
files = files.concat(ret.apiTree);
console.log('start writing raw source...');
utils.writeFile(

@@ -332,2 +353,5 @@ distPath + '/output-src.js', (jsDefConfig.development

console.log('finished writing raw source in ' + (+new Date - currentTime) + ' ms');
currentTime = +new Date;
Object.assign(contentMap, ret.contentMap);

@@ -344,11 +368,27 @@ }

if (docFileList && docFileList.length) {
console.log('start building sitemap...');
var sitemap = fileTreeBuilder.buildSiteMap(docFileList, jsDefConfig);
console.log('finished building sitemap in ' + (+new Date - currentTime) + ' ms');
currentTime = +new Date;
console.log('start parsing doc file...');
ret = fileTreeBuilder.buildTree(sitemap.fileList, 'doc', jsDefConfig, sitemap.replaceMap);
files = files.concat(ret.tree);
console.log('finished writing doc file in ' + (+new Date - currentTime) + ' ms');
currentTime = +new Date;
console.log('start writing raw doc...');
utils.writeFile(
distPath + '/output-doc.js', (jsDefConfig.development
? 'module.exports =' : 'var outputDoc = ') + JSON.stringify(ret.contentMap, null, 3)
);
);
console.log('finished writing raw doc in ' + (+new Date - currentTime) + ' ms');
currentTime = +new Date;
Object.assign(contentMap, ret.contentMap);

@@ -362,2 +402,4 @@ }

}
console.log('start writing raw file-tree...');

@@ -374,3 +416,7 @@ utils.writeFile(

);
console.log('jsdef parsing completed');
console.log('finished writing raw file-tree in ' + (+new Date - currentTime) + ' ms');
currentTime = +new Date;
console.log('jsdef parsing completed in ' + (+new Date - startTime) + ' ms');
// return {

@@ -377,0 +423,0 @@ // files: files,

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc