diff --git a/extensions/oni-plugin-csv-reader/package.json b/extensions/oni-plugin-csv-reader/package.json new file mode 100644 index 0000000000..9ca6288965 --- /dev/null +++ b/extensions/oni-plugin-csv-reader/package.json @@ -0,0 +1,31 @@ +{ + "name": "oni-plugin-csv-reader", + "version": "1.0.0", + "description": "A CSV Reader plugin for Oni", + "main": "lib/index.js", + "author": "A. Sowemimo", + "license": "MIT", + "engines": { + "oni": "^0.2.6" + }, + "scripts": { + "build": "rimraf lib && tsc", + "test": "jest" + }, + "dependencies": { + "oni-api": "^0.0.46", + "oni-types": "^0.0.8", + "papaparse": "^4.6.0", + "react": "^16.4.2" + }, + "devDependencies": { + "@types/papaparse": "^4.5.4", + "rimraf": "^2.6.2", + "typescript": "^2.9.2" + }, + "peerDependencies": { + "jest": "^23.5.0", + "styled-components": "^3.2.6", + "react-virtualized": "^9.19.1" + } +} diff --git a/extensions/oni-plugin-csv-reader/src/index.tsx b/extensions/oni-plugin-csv-reader/src/index.tsx new file mode 100644 index 0000000000..2c5bbe2763 --- /dev/null +++ b/extensions/oni-plugin-csv-reader/src/index.tsx @@ -0,0 +1,298 @@ +import * as Oni from "oni-api" +import * as React from "react" +import * as path from "path" +import styled from "styled-components" +import { ParseResult } from "papaparse" + +import { parseCsvString } from "./utils" + +const isCompatible = (buf: Oni.EditorBufferEventArgs) => { + const ext = path.extname(buf.filePath) + return ext === ".csv" +} + +interface IPreviewConfig { + rowsPerPage: number + previewBackgroundColor: string + hasHeader: boolean +} + +interface IProps { + log: (...args: any[]) => void + setupCommand: (c: Oni.Commands.ICommand) => void + title: string + config: IPreviewConfig + context: Oni.BufferLayerRenderContext +} + +interface IState { + rows: ParseResult["data"] + error: string + isShowing: boolean + currentPage: number + pageSize: number + currentSection: ParseResult["data"] +} + +const Title = styled<{ titleColor?: string }, "h4">("h4")` + width: 100%; + text-align: center; + color: ${p => p.titleColor || "white"}; +` + +const Table = styled.table` + border-radius: 8px; + width: 90%; +` + +const TableBody = styled.tbody` + width: 100%; + height: 100%; + overflow: hidden; + &:hover { + overflow: overlay; + } +` + +const TableHeader = styled.thead` + background-color: rgba(100, 100, 100, 0.5); +` +const TableRow = styled.tr`` + +const TableCell = styled.td` + background-color: white; + text-align: center; +` + +const Container = styled<{ previewBackgroundColor?: string }, "div">("div")` + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + position: relative; + z-index: 3; + background-color: ${p => p.previewBackgroundColor}; + pointer-events: all; +` + +interface IIndicator { + changePage: (evt: any) => void + page: number +} + +const IndicatorCircle = styled<{}, "div">("div")` + width: 3rem; + height: 3rem; + border-radius: 50%; + background-color: whitesmoke; + position: absolute; + bottom: 2rem; + right: 2rem; + box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; +` + +const PageIndicator: React.SFC = ({ changePage, page }) => { + return ( + + {page} + + ) +} + +class CSVReader extends React.Component { + state: IState = { + rows: [], + error: null, + currentSection: [], + currentPage: 1, + isShowing: true, + pageSize: this.props.config.rowsPerPage, + } + + async componentDidMount() { + this._setupCommands() + await this._loadCsv() + } + + async componentDidUpdate(prevProps: IProps) { + if (prevProps.context.visibleLines !== this.props.context.visibleLines) { + await this._loadCsv() + } + } + + public togglePreview = () => this.setState({ isShowing: !this.state.isShowing }) + + public changePage = (step: number = 0) => { + const { currentPage, rows, pageSize } = this.state + const noOfPages = Math.ceil(rows.length / pageSize) + const nextPage = currentPage + step + const pageToUse = nextPage > noOfPages ? 1 : nextPage + const indexOfLastItem = pageToUse * pageSize + const indexOfFirstItem = indexOfLastItem - pageSize + const nextSection = this.state.rows.slice(indexOfFirstItem, indexOfLastItem) + this.setState({ currentSection: nextSection, currentPage: pageToUse }) + } + + public convertLines = async () => { + const lines = this.props.context.visibleLines.join("\n") + try { + const { data, errors } = await parseCsvString(lines) + this.props.log("[Oni Plugin CSV Reader - Result]", data) + return data + } catch (error) { + this.props.log("[Oni Plugin CSV Reader - Error]", error) + this.setState({ error: error.message }) + return [] + } + } + + _loadCsv = async () => { + const rows = await this.convertLines() + this.setState({ rows }, this.changePage) + } + + _setupCommands = () => { + this.props.setupCommand({ + name: "", + detail: "", + command: "oni.csv.preview.toggle", + execute: this.togglePreview, + }) + + this.props.setupCommand({ + name: "", + detail: "", + command: "oni.csv.preview.next", + execute: () => this.changePage(1), + }) + + this.props.setupCommand({ + name: "", + detail: "", + command: "oni.csv.preview.previous", + execute: () => this.changePage(-1), + }) + } + + _orNull(el: T, comp: S) { + return el ? comp : null + } + + _renderHeader = (hasHeader: boolean) => { + const [firstItem] = this.state.currentSection + if (!hasHeader || !firstItem) { + return null + } + if (firstItem) { + return ( + + + {Object.keys(firstItem).map((key, idx) => + this._orNull(key, {key}), + )} + + + ) + } + } + + _renderBody = () => { + return ( + + {this.state.currentSection.map((row, rowIdx) => ( + + {Object.values(row).map((item, idx) => + this._orNull( + item, + {item}, + ), + )} + + ))} + + ) + } + + render() { + const { config } = this.props + const { isShowing, currentPage, error } = this.state + return ( + isShowing && ( + + {!error ? ( + <> + {this.props.title} + + {this._renderHeader(config.hasHeader)} + {this._renderBody()} +
+ this.changePage(1)} + /> + + ) : ( + {error} + )} +
+ ) + ) + } +} + +class CSVReaderLayer implements Oni.BufferLayer { + constructor(private _oni: Oni.Plugin.Api, private _title: string) {} + + private _defaultConfig: IPreviewConfig = { + rowsPerPage: 30, + previewBackgroundColor: "rgba(0, 0, 0, 0.8)", + hasHeader: true, + } + + public log = (...args: any[]) => { + this._oni.log.info(...args) + } + + public getConfig = () => { + const config = this._oni.configuration.getValue("experimental.csv.preview") + return config || this._defaultConfig + } + + public setupCommand = (command: Oni.Commands.ICommand) => { + this._oni.commands.registerCommand(command) + } + + public get id() { + return "oni.csv.reader" + } + + render(context: Oni.BufferLayerRenderContext) { + return ( + + ) + } +} + +export const activate = (oni: Oni.Plugin.Api) => { + oni.editors.activeEditor.onBufferEnter.subscribe(async buf => { + const title = `CSV PREVIEW - "${buf.filePath}"` + const layer = new CSVReaderLayer(oni, title) + if (isCompatible(buf)) { + oni.editors.activeEditor.activeBuffer.addLayer(layer) + } + }) +} diff --git a/extensions/oni-plugin-csv-reader/src/utils.ts b/extensions/oni-plugin-csv-reader/src/utils.ts new file mode 100644 index 0000000000..98b73218ab --- /dev/null +++ b/extensions/oni-plugin-csv-reader/src/utils.ts @@ -0,0 +1,30 @@ +import * as Papa from "papaparse" + +/** + * Converts CSV to HTML Table + * + */ + +export function parseCsvToRowsAndColumn(csvText: string, csvColumnDelimiter = "\t") { + const rows = csvText.split("\n") + const rowsWithColumns = rows.map(row => { + return row.split(csvColumnDelimiter) + }) + + return rowsWithColumns +} + +export function parseCsvString(csvString: string) { + return new Promise((resolve, reject) => { + const result = Papa.parse(csvString, { + header: true, + skipEmptyLines: true, + complete: results => { + resolve(results) + }, + error(error) { + reject(error) + }, + }) + }) +} diff --git a/extensions/oni-plugin-csv-reader/tsconfig.json b/extensions/oni-plugin-csv-reader/tsconfig.json new file mode 100644 index 0000000000..c71a5d2969 --- /dev/null +++ b/extensions/oni-plugin-csv-reader/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "moduleResolution": "node", + "preserveConstEnums": true, + "outDir": "./lib", + "jsx": "react", + "lib": ["dom", "es2017"], + "declaration": true, + "sourceMap": true, + "target": "es2015", + "skipLibCheck": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": ["node_modules"] +} diff --git a/package.json b/package.json index 5526ff7554..0baecc499e 100644 --- a/package.json +++ b/package.json @@ -5,14 +5,7 @@ "homepage": "https://www.onivim.io", "version": "0.3.7", "description": "Code editor with a modern twist on modal editing - powered by neovim.", - "keywords": [ - "vim", - "neovim", - "text", - "editor", - "ide", - "vim" - ], + "keywords": ["vim", "neovim", "text", "editor", "ide", "vim"], "main": "./lib/main/src/main.js", "bin": { "oni": "./lib/cli/src/cli.js", @@ -50,39 +43,23 @@ "mac": { "artifactName": "${productName}-${version}-osx.${ext}", "category": "public.app-category.developer-tools", - "target": [ - "dmg" - ], - "files": [ - "bin/osx/**/*" - ] + "target": ["dmg"], + "files": ["bin/osx/**/*"] }, "linux": { "artifactName": "${productName}-${version}-${arch}-linux.${ext}", "maintainer": "bryphe@outlook.com", - "target": [ - "tar.gz", - "deb", - "rpm" - ] + "target": ["tar.gz", "deb", "rpm"] }, "win": { - "target": [ - "zip", - "dir" - ], - "files": [ - "bin/x86/**/*" - ] + "target": ["zip", "dir"], + "files": ["bin/x86/**/*"] }, "fileAssociations": [ { "name": "ADA source", "role": "Editor", - "ext": [ - "adb", - "ads" - ] + "ext": ["adb", "ads"] }, { "name": "Compiled AppleScript", @@ -102,20 +79,12 @@ { "name": "ASP document", "role": "Editor", - "ext": [ - "asp", - "asa" - ] + "ext": ["asp", "asa"] }, { "name": "ASP.NET document", "role": "Editor", - "ext": [ - "aspx", - "ascx", - "asmx", - "ashx" - ] + "ext": ["aspx", "ascx", "asmx", "ashx"] }, { "name": "BibTeX bibliography", @@ -130,13 +99,7 @@ { "name": "C++ source", "role": "Editor", - "ext": [ - "cc", - "cp", - "cpp", - "cxx", - "c++" - ] + "ext": ["cc", "cp", "cpp", "cxx", "c++"] }, { "name": "C# source", @@ -161,10 +124,7 @@ { "name": "Clojure source", "role": "Editor", - "ext": [ - "clj", - "cljs" - ] + "ext": ["clj", "cljs"] }, { "name": "Comma separated values", @@ -179,20 +139,12 @@ { "name": "CGI script", "role": "Editor", - "ext": [ - "cgi", - "fcgi" - ] + "ext": ["cgi", "fcgi"] }, { "name": "Configuration file", "role": "Editor", - "ext": [ - "cfg", - "conf", - "config", - "htaccess" - ] + "ext": ["cfg", "conf", "config", "htaccess"] }, { "name": "Cascading style sheet", @@ -217,10 +169,7 @@ { "name": "Erlang source", "role": "Editor", - "ext": [ - "erl", - "hrl" - ] + "ext": ["erl", "hrl"] }, { "name": "F-Script source", @@ -230,32 +179,17 @@ { "name": "Fortran source", "role": "Editor", - "ext": [ - "f", - "for", - "fpp", - "f77", - "f90", - "f95" - ] + "ext": ["f", "for", "fpp", "f77", "f90", "f95"] }, { "name": "Header", "role": "Editor", - "ext": [ - "h", - "pch" - ] + "ext": ["h", "pch"] }, { "name": "C++ header", "role": "Editor", - "ext": [ - "hh", - "hpp", - "hxx", - "h++" - ] + "ext": ["hh", "hpp", "hxx", "h++"] }, { "name": "Go source", @@ -265,28 +199,17 @@ { "name": "GTD document", "role": "Editor", - "ext": [ - "gtd", - "gtdlog" - ] + "ext": ["gtd", "gtdlog"] }, { "name": "Haskell source", "role": "Editor", - "ext": [ - "hs", - "lhs" - ] + "ext": ["hs", "lhs"] }, { "name": "HTML document", "role": "Editor", - "ext": [ - "htm", - "html", - "phtml", - "shtml" - ] + "ext": ["htm", "html", "phtml", "shtml"] }, { "name": "Include file", @@ -326,10 +249,7 @@ { "name": "JavaScript source", "role": "Editor", - "ext": [ - "js", - "htc" - ] + "ext": ["js", "htc"] }, { "name": "Java Server Page", @@ -354,14 +274,7 @@ { "name": "Lisp source", "role": "Editor", - "ext": [ - "lisp", - "cl", - "l", - "lsp", - "mud", - "el" - ] + "ext": ["lisp", "cl", "l", "lsp", "mud", "el"] }, { "name": "Log file", @@ -381,12 +294,7 @@ { "name": "Markdown document", "role": "Editor", - "ext": [ - "markdown", - "mdown", - "markdn", - "md" - ] + "ext": ["markdown", "mdown", "markdn", "md"] }, { "name": "Makefile source", @@ -396,29 +304,17 @@ { "name": "Mediawiki document", "role": "Editor", - "ext": [ - "wiki", - "wikipedia", - "mediawiki" - ] + "ext": ["wiki", "wikipedia", "mediawiki"] }, { "name": "MIPS assembler source", "role": "Editor", - "ext": [ - "s", - "mips", - "spim", - "asm" - ] + "ext": ["s", "mips", "spim", "asm"] }, { "name": "Modula-3 source", "role": "Editor", - "ext": [ - "m3", - "cm3" - ] + "ext": ["m3", "cm3"] }, { "name": "MoinMoin document", @@ -438,28 +334,17 @@ { "name": "OCaml source", "role": "Editor", - "ext": [ - "ml", - "mli", - "mll", - "mly" - ] + "ext": ["ml", "mli", "mll", "mly"] }, { "name": "Mustache document", "role": "Editor", - "ext": [ - "mustache", - "hbs" - ] + "ext": ["mustache", "hbs"] }, { "name": "Pascal source", "role": "Editor", - "ext": [ - "pas", - "p" - ] + "ext": ["pas", "p"] }, { "name": "Patch file", @@ -469,11 +354,7 @@ { "name": "Perl source", "role": "Editor", - "ext": [ - "pl", - "pod", - "perl" - ] + "ext": ["pl", "pod", "perl"] }, { "name": "Perl module", @@ -483,80 +364,47 @@ { "name": "PHP source", "role": "Editor", - "ext": [ - "php", - "php3", - "php4", - "php5" - ] + "ext": ["php", "php3", "php4", "php5"] }, { "name": "PostScript source", "role": "Editor", - "ext": [ - "ps", - "eps" - ] + "ext": ["ps", "eps"] }, { "name": "Property list", "role": "Editor", - "ext": [ - "dict", - "plist", - "scriptSuite", - "scriptTerminology" - ] + "ext": ["dict", "plist", "scriptSuite", "scriptTerminology"] }, { "name": "Python source", "role": "Editor", - "ext": [ - "py", - "rpy", - "cpy", - "python" - ] + "ext": ["py", "rpy", "cpy", "python"] }, { "name": "R source", "role": "Editor", - "ext": [ - "r", - "s" - ] + "ext": ["r", "s"] }, { "name": "Ragel source", "role": "Editor", - "ext": [ - "rl", - "ragel" - ] + "ext": ["rl", "ragel"] }, { "name": "Remind document", "role": "Editor", - "ext": [ - "rem", - "remind" - ] + "ext": ["rem", "remind"] }, { "name": "reStructuredText document", "role": "Editor", - "ext": [ - "rst", - "rest" - ] + "ext": ["rst", "rest"] }, { "name": "HTML with embedded Ruby", "role": "Editor", - "ext": [ - "rhtml", - "erb" - ] + "ext": ["rhtml", "erb"] }, { "name": "SQL with embedded Ruby", @@ -566,28 +414,17 @@ { "name": "Ruby source", "role": "Editor", - "ext": [ - "rb", - "rbx", - "rjs", - "rxml" - ] + "ext": ["rb", "rbx", "rjs", "rxml"] }, { "name": "Sass source", "role": "Editor", - "ext": [ - "sass", - "scss" - ] + "ext": ["sass", "scss"] }, { "name": "Scheme source", "role": "Editor", - "ext": [ - "scm", - "sch" - ] + "ext": ["scm", "sch"] }, { "name": "Setext document", @@ -635,10 +472,7 @@ { "name": "SWIG source", "role": "Editor", - "ext": [ - "i", - "swg" - ] + "ext": ["i", "swg"] }, { "name": "Tcl source", @@ -648,20 +482,12 @@ { "name": "TeX document", "role": "Editor", - "ext": [ - "tex", - "sty", - "cls" - ] + "ext": ["tex", "sty", "cls"] }, { "name": "Plain text document", "role": "Editor", - "ext": [ - "text", - "txt", - "utf8" - ] + "ext": ["text", "txt", "utf8"] }, { "name": "Textile document", @@ -681,32 +507,17 @@ { "name": "XML document", "role": "Editor", - "ext": [ - "xml", - "xsd", - "xib", - "rss", - "tld", - "pt", - "cpt", - "dtml" - ] + "ext": ["xml", "xsd", "xib", "rss", "tld", "pt", "cpt", "dtml"] }, { "name": "XSL stylesheet", "role": "Editor", - "ext": [ - "xsl", - "xslt" - ] + "ext": ["xsl", "xslt"] }, { "name": "Electronic business card", "role": "Editor", - "ext": [ - "vcf", - "vcard" - ] + "ext": ["vcf", "vcard"] }, { "name": "Visual Basic source", @@ -716,10 +527,7 @@ { "name": "YAML document", "role": "Editor", - "ext": [ - "yaml", - "yml" - ] + "ext": ["yaml", "yml"] }, { "name": "Text document", @@ -781,8 +589,10 @@ "scripts": { "precommit": "pretty-quick --staged", "prepush": "yarn run build && yarn run lint", - "build": "yarn run build:browser && yarn run build:webview_preload && yarn run build:main && yarn run build:plugins && yarn run build:cli", - "build-debug": "yarn run build:browser-debug && yarn run build:main && yarn run build:plugins", + "build": + "yarn run build:browser && yarn run build:webview_preload && yarn run build:main && yarn run build:plugins && yarn run build:cli", + "build-debug": + "yarn run build:browser-debug && yarn run build:main && yarn run build:plugins", "build:browser": "webpack --config browser/webpack.production.config.js", "build:browser-debug": "webpack --config browser/webpack.debug.config.js", "build:main": "cd main && tsc -p tsconfig.json", @@ -790,66 +600,98 @@ "build:cli": "cd cli && tsc -p tsconfig.json", "build:plugin:oni-plugin-typescript": "cd vim/core/oni-plugin-typescript && yarn run build", "build:plugin:oni-plugin-git": "cd vim/core/oni-plugin-git && yarn run build", - "build:plugin:oni-plugin-markdown-preview": "cd extensions/oni-plugin-markdown-preview && yarn run build", + "build:plugin:oni-plugin-markdown-preview": + "cd extensions/oni-plugin-markdown-preview && yarn run build", "build:plugin:oni-plugin-quickopen": "cd extensions/oni-plugin-quickopen && yarn run build", + "build:plugin:oni-plugin-csv-reader": + "cd extensions/oni-plugin-csv-reader && yarn run build", "build:test": "yarn run build:test:unit && yarn run build:test:integration", "build:test:integration": "cd test && tsc -p tsconfig.json", "build:test:unit": "run-s build:test:unit:*", - "build:test:unit:browser": "rimraf lib_test/browser && cd browser && tsc -p tsconfig.test.json", + "build:test:unit:browser": + "rimraf lib_test/browser && cd browser && tsc -p tsconfig.test.json", "build:test:unit:main": "rimraf lib_test/main && cd main && tsc -p tsconfig.test.json", "build:webview_preload": "cd webview_preload && tsc -p tsconfig.json", "check-cached-binaries": "node build/script/CheckBinariesForBuild.js", "copy-icons": "node build/CopyIcons.js", - "debug:test:unit:browser": "cd browser && tsc -p tsconfig.test.json && electron-mocha --interactive --debug --renderer --require testHelpers.js --recursive ../lib_test/browser/test", - "demo:screenshot": "yarn run build:test && cross-env DEMO_TEST=HeroScreenshot mocha -t 30000000 lib_test/test/Demo.js", - "demo:video": "yarn run build:test && cross-env DEMO_TEST=HeroDemo mocha -t 30000000 lib_test/test/Demo.js", - "dist:win:x86": "cross-env ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=1 build --arch ia32 --publish never", - "dist:win:x64": "cross-env ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=1 build --arch x64 --publish never", - "pack:win": "node build/BuildSetupTemplate.js && innosetup-compiler dist/setup.iss --verbose --O=dist", + "debug:test:unit:browser": + "cd browser && tsc -p tsconfig.test.json && electron-mocha --interactive --debug --renderer --require testHelpers.js --recursive ../lib_test/browser/test", + "demo:screenshot": + "yarn run build:test && cross-env DEMO_TEST=HeroScreenshot mocha -t 30000000 lib_test/test/Demo.js", + "demo:video": + "yarn run build:test && cross-env DEMO_TEST=HeroDemo mocha -t 30000000 lib_test/test/Demo.js", + "dist:win:x86": + "cross-env ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=1 build --arch ia32 --publish never", + "dist:win:x64": + "cross-env ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=1 build --arch x64 --publish never", + "pack:win": + "node build/BuildSetupTemplate.js && innosetup-compiler dist/setup.iss --verbose --O=dist", "test": "yarn run test:unit && yarn run test:integration", - "test:setup": "yarn run build:test:integration && mocha -t 120000 --recursive lib_test/test/setup", - "test:integration": "yarn run build:test:integration && mocha -t 120000 lib_test/test/CiTests.js --bail", + "test:setup": + "yarn run build:test:integration && mocha -t 120000 --recursive lib_test/test/setup", + "test:integration": + "yarn run build:test:integration && mocha -t 120000 lib_test/test/CiTests.js --bail", "test:unit:react": "jest --config ./jest.config.js ./ui-tests", "test:unit:react:watch": "jest --config ./jest.config.js ./ui-tests --watch", "test:unit:react:coverage": "jest --config ./jest.config.js ./ui-tests --coverage", - "test:unit:browser": "yarn run build:test:unit:browser && cd browser && electron-mocha --renderer --require testHelpers.js --recursive ../lib_test/browser/test", - "test:unit": "yarn run test:unit:browser && yarn run test:unit:main && yarn run test:unit:react", - "test:unit:main": "yarn run build:test:unit:main && cd main && electron-mocha --renderer --recursive ../lib_test/main/test", + "test:unit:browser": + "yarn run build:test:unit:browser && cd browser && electron-mocha --renderer --require testHelpers.js --recursive ../lib_test/browser/test", + "test:unit": + "yarn run test:unit:browser && yarn run test:unit:main && yarn run test:unit:react", + "test:unit:main": + "yarn run build:test:unit:main && cd main && electron-mocha --renderer --recursive ../lib_test/main/test", "upload:dist": "node build/script/UploadDistributionBuildsToAzure", "fix-lint": "run-p fix-lint:*", - "fix-lint:browser": "tslint --fix --project browser/tsconfig.json --exclude **/node_modules/**/* --config tslint.json && tslint --fix --project vim/core/oni-plugin-typescript/tsconfig.json --config tslint.json && tslint --fix --project extensions/oni-plugin-markdown-preview/tsconfig.json --config tslint.json", + "fix-lint:browser": + "tslint --fix --project browser/tsconfig.json --exclude **/node_modules/**/* --config tslint.json && tslint --fix --project vim/core/oni-plugin-typescript/tsconfig.json --config tslint.json && tslint --fix --project extensions/oni-plugin-markdown-preview/tsconfig.json --config tslint.json", "fix-lint:cli": "tslint --fix --project cli/tsconfig.json --config tslint.json", "fix-lint:main": "tslint --fix --project main/tsconfig.json --config tslint.json", "fix-lint:test": "tslint --fix --project test/tsconfig.json --config tslint.json", "lint": "yarn run lint:browser && yarn run lint:main && yarn run lint:test", - "lint:browser": "tslint --project browser/tsconfig.json --config tslint.json && tslint --project vim/core/oni-plugin-typescript/tsconfig.json --config tslint.json && tslint --project extensions/oni-plugin-markdown-preview/tsconfig.json --config tslint.json", + "lint:browser": + "tslint --project browser/tsconfig.json --config tslint.json && tslint --project vim/core/oni-plugin-typescript/tsconfig.json --config tslint.json && tslint --project extensions/oni-plugin-markdown-preview/tsconfig.json --config tslint.json", "lint:cli": "tslint --project cli/tsconfig.json --config tslint.json", "lint:main": "tslint --project main/tsconfig.json --config tslint.json", - "lint:test": "tslint --project test/tsconfig.json --config tslint.json && tslint vim/core/oni-plugin-typescript/src/**/*.ts && tslint extensions/oni-plugin-markdown-preview/src/**/*.ts", + "lint:test": + "tslint --project test/tsconfig.json --config tslint.json && tslint vim/core/oni-plugin-typescript/src/**/*.ts && tslint extensions/oni-plugin-markdown-preview/src/**/*.ts", "pack": "cross-env ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=1 build --publish never", - "ccov:instrument": "nyc instrument --all true --sourceMap false lib_test/browser/src lib_test/browser/src_ccov", - "ccov:test:browser": "cross-env ONI_CCOV=1 electron-mocha --renderer --require browser/testHelpers.js -R browser/testCoverageReporter --recursive lib_test/browser/test", - "ccov:remap:browser:html": "cd lib_test/browser/src && remap-istanbul --input ../../../coverage/coverage-final.json --output html-report --type html", - "ccov:remap:browser:lcov": "cd lib_test/browser/src && remap-istanbul --input ../../../coverage/coverage-final.json --output lcov.info --type lcovonly", + "ccov:instrument": + "nyc instrument --all true --sourceMap false lib_test/browser/src lib_test/browser/src_ccov", + "ccov:test:browser": + "cross-env ONI_CCOV=1 electron-mocha --renderer --require browser/testHelpers.js -R browser/testCoverageReporter --recursive lib_test/browser/test", + "ccov:remap:browser:html": + "cd lib_test/browser/src && remap-istanbul --input ../../../coverage/coverage-final.json --output html-report --type html", + "ccov:remap:browser:lcov": + "cd lib_test/browser/src && remap-istanbul --input ../../../coverage/coverage-final.json --output lcov.info --type lcovonly", "ccov:clean": "rimraf coverage", "ccov:upload:jest": "cd ./coverage/jest && codecov", "ccov:upload": "codecov", "launch": "electron lib/main/src/main.js", - "start": "concurrently --kill-others \"yarn run start-hot\" \"yarn run watch:browser\" \"yarn run watch:plugins\"", - "start-hot": "cross-env ONI_WEBPACK_LOAD=1 NODE_ENV=development electron lib/main/src/main.js", + "start": + "concurrently --kill-others \"yarn run start-hot\" \"yarn run watch:browser\" \"yarn run watch:plugins\"", + "start-hot": + "cross-env ONI_WEBPACK_LOAD=1 NODE_ENV=development electron lib/main/src/main.js", "start-not-dev": "cross-env electron main.js", - "watch:browser": "webpack-dev-server --config browser/webpack.development.config.js --host localhost --port 8191", + "watch:browser": + "webpack-dev-server --config browser/webpack.development.config.js --host localhost --port 8191", "watch:plugins": "run-p --race watch:plugins:*", "watch:plugins:oni-plugin-typescript": "cd vim/core/oni-plugin-typescript && tsc --watch", - "watch:plugins:oni-plugin-markdown-preview": "cd extensions/oni-plugin-markdown-preview && tsc --watch", + "watch:plugins:oni-plugin-markdown-preview": + "cd extensions/oni-plugin-markdown-preview && tsc --watch", "watch:plugins:oni-plugin-git": "cd vim/core/oni-plugin-git && tsc --watch", "watch:plugins:oni-plugin-quickopen": "cd extensions/oni-plugin-quickopen && tsc --watch", + "watch:plugins:oni-plugin-csv-reader": "cd extensions/oni-plugin-csv-reader && tsc --watch", "install:plugins": "run-s install:plugins:*", - "install:plugins:oni-plugin-markdown-preview": "cd extensions/oni-plugin-markdown-preview && yarn install --prod", - "install:plugins:oni-plugin-prettier": "cd extensions/oni-plugin-prettier && yarn install --prod", + "install:plugins:oni-plugin-markdown-preview": + "cd extensions/oni-plugin-markdown-preview && yarn install --prod", + "install:plugins:oni-plugin-prettier": + "cd extensions/oni-plugin-prettier && yarn install --prod", + "install:plugins:oni-plugin-csv-reader": + "cd extensions/oni-plugin-csv-reader && yarn install --prod", "install:plugins:oni-plugin-git": "cd vim/core/oni-plugin-git && yarn install --prod", "postinstall": "yarn run install:plugins && electron-rebuild && opencollective postinstall", - "profile:webpack": "webpack --config browser/webpack.production.config.js --profile --json > stats.json && webpack-bundle-analyzer browser/stats.json" + "profile:webpack": + "webpack --config browser/webpack.production.config.js --profile --json > stats.json && webpack-bundle-analyzer browser/stats.json" }, "repository": { "type": "git",