diff --git a/.babelrc b/.babelrc deleted file mode 100755 index 9f18121..0000000 --- a/.babelrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "plugins": [ - "transform-object-rest-spread", - "transform-react-jsx", - "syntax-jsx", - "transform-es2015-classes" - ], - "env": { - "test": { - "plugins": [ - "transform-es2015-modules-commonjs" - ] - } - } -} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100755 index c1b59ec..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -sudo: required -dist: trusty - -language: node_js - -matrix: - include: - - os: linux - node_js: 6 - env: CC=clang CXX=clang++ npm_config_clang=1 - compiler: clang - -branches: - only: - - master - -before_install: - - npm install -g npm@3.10.8 - -cache: yarn - -install: -- npm install - -script: -- npm run test \ No newline at end of file diff --git a/package.json b/package.json index 8924898..f7184c9 100755 --- a/package.json +++ b/package.json @@ -1,9 +1,13 @@ { "name": "cerebro-mac-apps", - "version": "1.0.2", + "version": "1.0.3", "description": "Plugin for searching and launching applications on MacOS", "license": "MIT", - "repository": "KELiON/cerebro-mac-apps", + "homepage": "https://github.com/cerebroapp/cerebro-mac-apps#readme", + "bugs": { + "url": "https://github.com/cerebroapp/cerebro-mac-apps/issues" + }, + "repository": "github:cerebroapp/cerebro-mac-apps", "author": { "name": "Alexandr Subbotin", "email": "kelionweb@gmail.com", @@ -13,11 +17,9 @@ "node": ">=4" }, "scripts": { - "build": "webpack && babili dist -d dist --compact --no-comments", - "debug": "./scripts/debug", - "debug:windows": "scripts\\debug.bat", - "test": "NODE_ENV=test mocha --compilers js:babel-core/register --require ./test/setup.js", - "prepublish": "rimraf ./dist && npm run build" + "start": "cerebro-scripts start", + "build": "cerebro-scripts build", + "test": "cerebro-scripts test" }, "main": "dist/index.js", "keywords": [ @@ -27,27 +29,12 @@ "applications" ], "devDependencies": { - "babel-cli": "^6.18.0", - "babel-loader": "^6.2.8", - "babel-node-modules": "0.0.1", - "babel-plugin-syntax-jsx": "^6.18.0", - "babel-plugin-transform-es2015-classes": "^6.24.1", - "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", - "babel-plugin-transform-object-rest-spread": "^6.23.0", - "babel-plugin-transform-react-jsx": "^6.8.0", - "babili": "0.1.2", - "chai": "^3.5.0", - "css-loader": "^0.26.0", - "mocha": "^3.3.0", - "rimraf": "^2.6.1", - "style-loader": "^0.13.1", - "url-loader": "^0.5.7", - "webpack": "2.5.1" + "@cerebroapp/cerebro-scripts": "^1.0.0-alpha.6" }, "dependencies": { - "cerebro-ui": "^0.0.14", - "cerebro-tools": "^0.1.0", - "du": "^0.1.0", + "@cerebroapp/cerebro-ui": "^2.0.0-alpha.3", + "cerebro-tools": "^0.1.8", + "du": "^1.0.0", "event-stream": "3.3.4" } } diff --git a/scripts/debug b/scripts/debug deleted file mode 100755 index fc9d4fe..0000000 --- a/scripts/debug +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -if [[ $1 == "dev" ]]; then - appname="Electron" -else - appname="Cerebro" -fi - -case "$(uname -s)" in - - Darwin) - symlink="${HOME}/Library/Application Support/${appname}/plugins/node_modules/${PWD##*/}" - trap "echo 'Deleting symlink' && rm -rf \"$symlink\"" SIGHUP SIGINT SIGTERM - ;; - - Linux) - symlink="${HOME}/.config/${appname}/plugins/node_modules/${PWD##*/}" - trap "echo 'Deleting symlink' && rm -rf \"$symlink\"" HUP INT TERM - ;; - - CYGWIN*|MINGW32*|MINGW64*|MSYS*) - symlink="${APPDATA}\\${appname}\plugins\node_modules\\${PWD##*/}" - trap "echo 'Deleting symlink' && rm -rf \"$symlink\"" SIGHUP SIGINT SIGTERM - ;; - - *) - echo "Unknown system. Please, open an issue in https://github.com/KELiON/cerebro-plugin/issues" - exit - ;; -esac - -echo "Creating symlink: $symlink -> ${PWD}" -ln -s "${PWD}" "$symlink" -./node_modules/.bin/webpack --watch diff --git a/scripts/debug.bat b/scripts/debug.bat deleted file mode 100755 index e8438af..0000000 --- a/scripts/debug.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off -IF "%1%"==""dev"" ( - set appname=Electron -) ELSE ( - set appname=Cerebro -) - -for %%* in (.) do set dirname=%%~nx* -SET symlink="%APPDATA%\%appname%\plugins\node_modules\%dirname%" - -echo "Creating symlink: %symlink% -> %cd%" - -mklink /d "%symlink%" "%cd%" -start "" /wait node_modules\.bin\webpack --watch diff --git a/src/Preview/FileDetails/index.js b/src/Preview/FileDetails/index.js index ce07f73..441db44 100644 --- a/src/Preview/FileDetails/index.js +++ b/src/Preview/FileDetails/index.js @@ -1,4 +1,4 @@ -import React, { PropTypes, Component } from 'react' +import React, { Component } from 'react' import bytesToSize from './bytesToSize' import getFileSize from './getFileSize' @@ -24,6 +24,7 @@ class FileDetails extends Component { const { details, size } = this.state const { ctime, mtime, atime } = details const name = nodePath.basename(path) + return (
{!skipName &&

{name}

} @@ -42,10 +43,4 @@ class FileDetails extends Component { } } -FileDetails.propTypes = { - path: PropTypes.string.isRequired, - skipName: PropTypes.bool, - skipSize: PropTypes.bool, -} - export default FileDetails diff --git a/src/Preview/index.js b/src/Preview/index.js index e88d9bb..98f266f 100644 --- a/src/Preview/index.js +++ b/src/Preview/index.js @@ -1,5 +1,4 @@ -import React, { PropTypes } from 'react' -import { FileIcon } from 'cerebro-ui' +import { FileIcon } from '@cerebroapp/cerebro-ui' import FileDetails from './FileDetails' import styles from './styles.css' @@ -13,9 +12,4 @@ const Preview = ({ path, name }) => (
) -Preview.propTypes = { - path: PropTypes.string, - name: PropTypes.string, -} - export default Preview diff --git a/src/index.js b/src/index.js index c6950b5..999c6dc 100644 --- a/src/index.js +++ b/src/index.js @@ -44,7 +44,7 @@ const toString = (app) => ( `${app.name} ${app.filename.replace(/\.app$/, '')} ${getAbbr(app.name)}` ) -export const fn = ({ term, actions, display }) => { +const plugin = ({ term, actions, display }) => { cachedAppsList().then(items => { const result = orderBy( search(items, term, toString), @@ -77,7 +77,7 @@ export const fn = ({ term, actions, display }) => { }) } -export const initialize = () => { +const initialize = () => { // Cache apps cache and force cache reloading in background const recache = () => { cachedAppsList.clear() @@ -92,3 +92,8 @@ export const initialize = () => { fs.watch(dir, WATCH_OPTIONS, recache) }) } + +export default { + initialize, + fn: plugin +} diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100755 index 0e602e4..0000000 --- a/webpack.config.js +++ /dev/null @@ -1,52 +0,0 @@ -const webpack = require('webpack'); -const path = require('path'); - -module.exports = { - entry: { - index: './src/index' - }, - output: { - path: path.join(__dirname, './dist'), - libraryTarget: 'commonjs2', - filename: 'index.js' - }, - resolve: { - extensions: ['.js'], - modules: [ - path.resolve('./src'), - path.resolve('./node_modules'), - ] - }, - target: 'electron-renderer', - externals: { - 'nodobjc': 'nodobjc', - 'react': 'global React', - 'react-dom': 'global ReactDOM', - }, - module: { - rules: [{ - test: /\.jsx?$/, - use: { - loader: 'babel-loader' - }, - exclude: (modulePath) => ( - modulePath.match(/node_modules/) && !modulePath.match(/node_modules\/cerebro-/) - ) - }, { - test: /\.css$/, - use: [{ - loader: 'style-loader' - }, { - loader: 'css-loader', - query: { - modules: true - } - }] - }, { - test: /\.png$/, - use: { - loader: 'url-loader' - } - }] - } -};