Skip to content

Commit

Permalink
Merge pull request #1863 from Automattic/release/1.14
Browse files Browse the repository at this point in the history
Merge release 1.14 into master
  • Loading branch information
dmsnell authored Jan 27, 2020
2 parents 2236889 + 1c27ef3 commit 65561d6
Show file tree
Hide file tree
Showing 233 changed files with 5,674 additions and 2,000 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
- run: patch -p1 < ./resources/macos/macPackager-patch.diff
- run: patch -p1 < ./resources/macos/scheme-patch.diff
- run: make build
- run: make lint
- run: make test
- persist_to_workspace:
root: ~/simplenote
Expand Down
23 changes: 19 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"parser": "babel-eslint",
"parser": "@typescript-eslint/parser",
"env": {
"browser": true,
"es6": true,
Expand All @@ -16,12 +16,19 @@
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:jest/recommended",
"plugin:react/recommended",
"prettier",
"prettier/react"
],
"plugins": ["eslint-plugin-react", "jest", "prettier"],
"plugins": [
"@typescript-eslint",
"eslint-plugin-react",
"jest",
"prettier",
"react-hooks"
],
"rules": {
"eqeqeq": ["error", "always"],
"no-console": "warn",
Expand All @@ -39,12 +46,20 @@
"react/display-name": "warn",
"react/no-deprecated": "warn",
"react/no-string-refs": "warn",
"react/prop-types": "warn",
"react/prop-types": "off",
"vars-on-top": "error"
},
"settings": {
"react": {
"version": "detect"
}
}
},
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"rules": {
"no-unused-vars": "off"
}
}
]
}
26 changes: 14 additions & 12 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"version": "0.2.0",
"configurations": [{
"name": "Debug Main Process",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
},
"args": ["."]
}]
}
"configurations": [
{
"name": "Debug Main Process",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
},
"args": ["."]
}
]
}
36 changes: 18 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RED=`tput setaf 1`
RESET=`tput sgr0`

SIMPLENOTE_JS := $(THIS_DIR)/dist/app.js
SIMPLENOTE_CHANGES_STD := `find "$(THIS_DIR)" -newer "$(SIMPLENOTE_JS)" \( -name "*.js" -o -name "*.jsx" -o -name "*.json" -o -name "*.scss" \) -type f -print -quit | grep -v .min. | wc -l`
SIMPLENOTE_CHANGES_STD := `find "$(THIS_DIR)" -newer "$(SIMPLENOTE_JS)" \( -name "*.js" -o -name "*.jsx" -o -name "*.json" -o -name "*.scss" -o -name "*.ts" -o -name "*.tsx" \) -type f -print -quit | grep -v .min. | wc -l`
SIMPLENOTE_BRANCH = $(shell git --git-dir .git branch | sed -n -e 's/^\* \(.*\)/\1/p')


Expand Down Expand Up @@ -53,7 +53,7 @@ start: rebuild-deps
@NODE_ENV=$(NODE_ENV) DEV_SERVER=$(DEV_SERVER) npx electron .

.PHONY: dev
dev:
dev:
@npx misty

.PHONY: dev-server
Expand All @@ -63,8 +63,8 @@ dev-server:
@NODE_ENV=$(NODE_ENV) npx webpack-dev-server --config ./webpack.config.js --content-base dist --host $(HOST) --port $(PORT) --hot

.PHONY: test
test:
@npx jest
test:
@npx jest --config=./jest.config.js


# Build web app
Expand All @@ -84,37 +84,37 @@ endif

# Build utils
.PHONY: build-app
build-app:
build-app:
@NODE_ENV=$(NODE_ENV) npx webpack $(if $(IS_PRODUCTION),-p) --config ./webpack.config.js

.PHONY: build-if-not-exists
.PHONY: build-if-not-exists
build-if-not-exists: config.json
@if [ -f $(SIMPLENOTE_JS) ]; then true; else make build; fi

.PHONY: build-if-changed
.PHONY: build-if-changed
build-if-changed: build-if-not-exists
@if [ $(SIMPLENOTE_CHANGES_STD) -eq 0 ]; then true; else make build; fi;


# Build binaries only
.PHONY: osx
.PHONY: osx
osx: config-release build-if-changed
@npx electron-builder -m --dir

.PHONY: linux
.PHONY: linux
linux: config-release build-if-changed
@npx electron-builder -l --dir

.PHONY: win32
.PHONY: win32
win32: config-release build-if-changed
@npx electron-builder -w --dir


# Build installers
.PHONY: package
# Build installers
.PHONY: package
package: build-if-changed

.PHONY: package-win32
.PHONY: package-win32
package-win32:
ifeq ($(IS_WINDOWS),true)
@echo Building .appx as well
Expand All @@ -124,7 +124,7 @@ else
@npx electron-builder --win -p $(PUBLISH)
endif

.PHONY: package-osx
.PHONY: package-osx
package-osx: build-if-changed
@npx electron-builder --mac "dmg" -p $(PUBLISH)

Expand All @@ -134,7 +134,7 @@ package-linux: build-if-changed


# NPM
.PHONY:
.PHONY:
install: node_modules

node_modules/%:
Expand All @@ -153,7 +153,7 @@ ifeq (,$(wildcard $(THIS_DIR)$/config.json))
endif


# Utils
# Utils
.PHONY: config-release
config-release: config.json install

Expand All @@ -163,8 +163,8 @@ rebuild-deps:

.PHONY: format
format:
@npx prettier --write {desktop,lib,sass}/{**/,*}.{js,json,jsx,sass}
@npx prettier --ignore-path .gitignore --write "**/*.{js,jsx,json,sass,ts,tsx}"

.PHONY: lint
lint:
@npx eslint --ext .js --ext .jsx lib
@npx eslint --ignore-path .gitignore "**/*.{js,jsx,ts,tsx}"
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ _Note: Simplenote API features such as sharing and publishing will not work with
- **`make package-win32`**
- **`make package-linux`**

## Testing

Unit tests are run with `npm test`.

End-to-end tests are run with `npm run test-e2e`.
Note that the `Spectron` version corresponds with the version of `Electron` we are using and so at the time of writing this is pinned at version 6.
Use the corresponding API docs for `webdriver-io` which correspond to the `Specron` version.
At the time of writing you will want to refer to the [webdriver-io v4.13 API docs](http://v4.webdriver.io/v4.13/api.html).

## Coding Guidelines

Please adhere to the same guidelines as found in [wp-calypso](https://github.com/Automattic/wp-calypso/blob/master/docs/coding-guidelines.md).
Expand All @@ -32,6 +41,7 @@ Please adhere to the same guidelines as found in [wp-calypso](https://github.com
- [Electron](https://electronjs.org/) for wrapping the JavaScript application.

## Simplenote for Other Platforms

[simplenote-electron](https://github.com/Automattic/simplenote-electron) is the official Simplenote desktop app for Windows and Linux.

For other platforms, see:
Expand Down
53 changes: 53 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,58 @@
# Changelog

## [v1.14.0]

### Enhancements
- Keep note open when transitioning to small screen in focus mode [#1763](https://github.com/Automattic/simplenote-electron/pull/1763)
- Added GenericName (description) field for app on Linux [#1761](https://github.com/Automattic/simplenote-electron/pull/1761)
- Allow width attribute on img tags [#1833](https://github.com/Automattic/simplenote-electron/pull/1833)

### Fixes
- Makes settings scrollable on shorter smaller view ports [#1767](https://github.com/Automattic/simplenote-electron/pull/1767)
- After selecting a revision to restore ensure that choice is sync'd [#1774](https://github.com/Automattic/simplenote-electron/pull/1774)
- Added indication that publish url has been copied [#1743](https://github.com/Automattic/simplenote-electron/pull/1743)
- Disallow partial emails and user's own email from being adding to collaborators email field [#1735](https://github.com/Automattic/simplenote-electron/pull/1735)
- Fixed keyboard shortcut to toggle markdown preview [#1788](https://github.com/Automattic/simplenote-electron/pull/1788)
- Fixed an issue where typing a comma in the tag input would insert an empty tag [#1798](https://github.com/Automattic/simplenote-electron/pull/1798)
- When system theme is selected in Settings, changing the system theme is now immediately reflected in the app [#1801](https://github.com/Automattic/simplenote-electron/pull/1801)
- Show all checkboxes and search results in note list [#1814](https://github.com/Automattic/simplenote-electron/pull/1814)
- Fix ol numbering in markdown preview [#1823](https://github.com/Automattic/simplenote-electron/pull/1823)
- Prevents weird effects in live previews due to incomplete input [#1822](https://github.com/Automattic/simplenote-electron/pull/1822)
- Fixed a bug where searching for a tag containing non-alphanumeric characters erroneously returned no notes [#1828](https://github.com/Automattic/simplenote-electron/pull/1828)
- Properly close revision/history view when clicking outside of slider [#1837](https://github.com/Automattic/simplenote-electron/pull/1837)

### Other Changes

- Updated dependencies [#1759](https://github.com/Automattic/simplenote-electron/pull/1759)
- Applied prettier formatting to all files [#1780](https://github.com/Automattic/simplenote-electron/pull/1780)
- Delete unused tab restriction util [#1783](https://github.com/Automattic/simplenote-electron/pull/1783)
- Migrate TransitionDelayEnter to React hooks [#1784](https://github.com/Automattic/simplenote-electron/pull/1784)
- Added git hooks to run format, lints, and tests [#1790](https://github.com/Automattic/simplenote-electron/pull/1790)
- Added React Hooks ESLint Plugin [#1789](https://github.com/Automattic/simplenote-electron/pull/1789)
- Added end-to-end testing with Spectron [#1773](https://github.com/Automattic/simplenote-electron/pull/1773)
- Removed a workaround for indexing note pinned status [#1795](https://github.com/Automattic/simplenote-electron/pull/1795)
- Maintenance cleanups [#1796](https://github.com/Automattic/simplenote-electron/pull/1796), [#1797](https://github.com/Automattic/simplenote-electron/pull/1797), [#1808](https://github.com/Automattic/simplenote-electron/pull/1808), [#1809](https://github.com/Automattic/simplenote-electron/pull/1809), [#1810](https://github.com/Automattic/simplenote-electron/pull/1810), [#1811](https://github.com/Automattic/simplenote-electron/pull/1811)
- Updated dependencies [#1802](https://github.com/Automattic/simplenote-electron/pull/1802)
- Updated dependencies [#1821](https://github.com/Automattic/simplenote-electron/pull/1821)
- Fixed build warning [#1806](https://github.com/Automattic/simplenote-electron/pull/1806)
- Refactor how notes are filtered for better performance and maintainability [#1812](https://github.com/Automattic/simplenote-electron/pull/1812)

## [v1.13.0]

### Enhancements

- Added matching tags to the notes list on search [#1648](https://github.com/Automattic/simplenote-electron/pull/1648)

### Fixes

- Revision selector is now usable without dragging the entire window [#1741](https://github.com/Automattic/simplenote-electron/pull/1741)
- Only display view settings when coming from the old web app [#1736](https://github.com/Automattic/simplenote-electron/pull/1736)
- Fixed a bug where initial "s" was getting removed from note titles in preview [#1748](https://github.com/Automattic/simplenote-electron/pull/1748)

### Other Changes

- Updated dependencies [#1738](https://github.com/Automattic/simplenote-electron/pull/1738)

## [v1.12.0]

### Enhancements
Expand Down
8 changes: 4 additions & 4 deletions after_sign_hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = async function(params) {
}

if (!process.env.CIRCLE_TAG || process.env.CIRCLE_TAG.length === 0) {
console.log('Not on a tag. Skipping notarization');
console.log('Not on a tag. Skipping notarization'); // eslint-disable-line no-console
return;
}

Expand All @@ -27,7 +27,7 @@ module.exports = async function(params) {
throw new Error(`Cannot find application at: ${appPath}`);
}

console.log(`Notarizing ${appId} found at ${appPath}`);
console.log(`Notarizing ${appId} found at ${appPath}`); // eslint-disable-line no-console

try {
await electron_notarize.notarize({
Expand All @@ -38,8 +38,8 @@ module.exports = async function(params) {
ascProvider: 'AutomatticInc',
});
} catch (error) {
console.error(error);
console.error(error); // eslint-disable-line no-console
}

console.log(`Done notarizing ${appId}`);
console.log(`Done notarizing ${appId}`); // eslint-disable-line no-console
};
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ environment:
CSC_KEY_PASSWORD:
secure: Sz53shy7P4kPzBKa9shHTw==
GH_TOKEN:
secure: rgCznyrNnbERL0+MFoT/48TazSzqodduLapcquSs2D3hidBCwjbaOUkE9wXIi3WG
secure: YT95oZAVxC7cDNT/XzUpN8fDwfysXTKETux44ta/sfm7gAo/Wghm1ZWCElNqvAKx
APPVEYOR_RDP_PASSWORD:
secure: G+yYok+QzBzcrkdhtx+UC4vjyU0kSlWRQ+l+iooLV7o=
CSC_LINK: .\resources\certificates\win.p12
Expand All @@ -17,7 +17,7 @@ configuration:
- AppX-Testing

install:
- ps: Install-Product node 10
- ps: Install-Product node 11.15.0
- cinst make
- npm ci
- patch -p1 < ./resources/macos/macPackager-patch.diff
Expand Down Expand Up @@ -75,4 +75,4 @@ cache:

# RDP Debug mode
# on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
4 changes: 4 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ module.exports = function(api) {
},
],
'@babel/preset-react',
'@babel/typescript',
];
const plugins = [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-syntax-dynamic-import',
];
const env = {
development: {
compact: false,
},
test: {
plugins: ['dynamic-import-node'],
},
Expand Down
5 changes: 4 additions & 1 deletion desktop/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ module.exports = function main() {
mainWindow.loadUrl(url);
}

if (isDev || process.argv.includes('--devtools')) {
if (
'test' !== process.env.NODE_ENV &&
(isDev || process.argv.includes('--devtools'))
) {
mainWindow.openDevTools({ mode: 'detach' });
}

Expand Down
2 changes: 1 addition & 1 deletion desktop/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
var app = require('./app')();
require('./app')();
Loading

0 comments on commit 65561d6

Please sign in to comment.