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

fix: fix mock files and release settings #576

Merged
merged 4 commits into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 19 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Run Tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
- run: yarn
- run: yarn test --detectOpenHandles --forceExit
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@
<img src="./build/icons/128x128.png" align="right"/>

## Usage

You can download the latest version on [releases](https://github.com/cerebroapp/cerebro/releases) page.

After installation use default shortcut `ctrl+space` to show an app window. You can customize this shortcut clicking on icon in menu bar → preferences.

![Cerebro](https://cloud.githubusercontent.com/assets/594298/20180624/858a483a-a75b-11e6-94a1-ef1edc4d95c3.gif)

## Plugins

### Core plugins

* Search in the web with google suggestions;
* Search & launch application, i.e. `spotify`;
* Navigate in file system with file previews (i.e. `~/Dropbox/passport.pdf`);
* Calculator;
* Smart converter. `15$`, `150 рублей в евро`, `100 eur in gbp`;

### Install and manage custom plugins

Use built-in `plugins` command to search and manage custom plugins.

Discover plugins and more at [Cerebro's Awesome List](https://github.com/lubien/awesome-cerebro).
Expand All @@ -34,48 +38,52 @@ Install the plugin

```bash
npm install --save name-of-plugin
```
```

### Create plugin

Check out [plugins documentation](./docs/plugins.md).

### Install

First, clone the repo via git:

```bash
$ git clone https://github.com/cerebroapp/cerebro.git cerebro
git clone https://github.com/cerebroapp/cerebro.git cerebro
```

Open the project

```bash
$ cd cerebro
cd cerebro
```

And then install dependencies:


```bash
yarn
```

### Run in development mode

```bash
$ yarn run dev
yarn run dev
```

> Note: requires a node version >=16.x

### Build executable from source

If you would like to install one version but the package is not published you can use this command to build executable file from source:

```bash
$ yarn package
yarn package
```

> Note: in CI we use `yarn build` as there is an action to package and publish the executables

### Resolve common issues

1. `AssertionError: Current node version is not supported for development` on npm postinstall.
After `yarn` postinstall script checks node version. If you see this error you have to check node and npm version in `package.json` `devEngines` section and install proper ones.

Expand All @@ -90,7 +98,6 @@ Use shortcut `ctrl+space` to open app window and type `Cerebro Settings`. There

#### Config file path


*Windows*: `%APPDATA%/Cerebro/config.json`

*Linux*: `$XDG_CONFIG_HOME/Cerebro/config.json` or `~/.config/Cerebro/config.json`
Expand All @@ -104,15 +111,14 @@ Use shortcut `ctrl+space` to open app window and type `Cerebro Settings`. There
CerebroApp is using GH actions to build the app and publish it to a release. To publish a new release follow the steps below:

1. Update the version on both `package.json` and `app/package.json` files.
2. Create a release with from GH and publish it. 🚧 The release **tag** SHOULD NOT contain the `v` prefix (❌ `v0.1.2` → ✅`0.1.2`).
2. Create a release with from GH and publish it. 🚧 The release **tag** MUST contain the `v` prefix (❌ `0.1.2` → ✅`v0.1.2`).
3. Complete the name with a name and a description of the release.
4. The GH action is triggered and the release is updated when executables are built.

### Add dependencies

CerebroApp was created from an [old version of electron-react-boilerplate](https://github.com/cerebroapp/cerebro/commit/57b6e28c0f64beae8948cf17f099fa5d6236ae3c) and uses a two package.json file structure. If you are interested in developing a new feature, you should read about this structure in the [electron-react-boilerplate documentation](https://www.electron.build/tutorials/two-package-structure.html).


# Support

### Backers
Expand Down Expand Up @@ -151,6 +157,7 @@ Support us with a monthly donation and help us continue our activities. [[Become
<a href="https://opencollective.com/cerebro/backer/29/website" target="_blank"><img src="https://opencollective.com/cerebro/backer/29/avatar.svg"></a>

### Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/cerebro#sponsor)]

<a href="https://opencollective.com/cerebro/sponsor/0/website" target="_blank"><img src="https://opencollective.com/cerebro/sponsor/0/avatar.svg"></a>
Expand Down
4 changes: 2 additions & 2 deletions __mocks__/@electron/remote.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
app: {
getPath: jest.fn(),
}
getPath: () => '',
},
}
5 changes: 5 additions & 0 deletions __mocks__/plugins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
'test-plugin': {
fn: () => {}
}
}
3 changes: 0 additions & 3 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"Gustavo Pereira",
"David Jiménez"
],
"scripts": {
"rebuild": "npm rebuild --runtime=electron --target=1.6.11 --disturl=https://atom.io/download/electron --abi=53"
},
"dependencies": {
"move-file": "2.1.0",
"chokidar": "3.5.3",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
},
"publish": {
"provider": "github",
"vPrefixedTagName": false,
"vPrefixedTagName": true,
"releaseType": "release"
}
},
Expand Down