Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
refactor: rename app to renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Mar 26, 2019
1 parent fc4a0df commit 2f92308
Show file tree
Hide file tree
Showing 384 changed files with 39 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[
"module-resolver",
{
"root": ["./app"],
"root": ["./renderer"],
"alias": {
"^@zap/(.+)": "./\\1"
}
Expand Down
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
app/node_modules

# OSX
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ module.exports = {
'babel-module': {},
},
node: {
moduleDirectory: ['app', 'node_modules', 'app/node_modules'],
moduleDirectory: ['renderer', 'node_modules'],
},
webpack: {
config: path.resolve(__dirname, 'webpack', 'webpack.config.eslint.js'),
Expand Down
22 changes: 10 additions & 12 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[ignore]
<PROJECT_ROOT>/app/dist/.*
<PROJECT_ROOT>/resources/.*
<PROJECT_ROOT>/release/.*
<PROJECT_ROOT>/icons/.*
<PROJECT_ROOT>/dist/.*
<PROJECT_ROOT>/dll/.*
<PROJECT_ROOT>/release/.*
<PROJECT_ROOT>/icons/.*
<PROJECT_ROOT>/storybook-static/.*
<PROJECT_ROOT>/.git/.*
.*/node_modules/config-chain/test/broken.json
Expand All @@ -20,21 +19,20 @@ esproposal.class_instance_fields=enable
esproposal.export_star_as=enable

module.system.node.resolve_dirname=node_modules
module.system.node.resolve_dirname=app/node_modules

# Map images to WebpackAsset tyoe def
module.name_mapper.extension='png' -> '<PROJECT_ROOT>/flow/WebpackAsset.js.flow'
module.name_mapper.extension='jpg' -> '<PROJECT_ROOT>/flow/WebpackAsset.js.flow'
module.name_mapper.extension='svg' -> '<PROJECT_ROOT>/flow/WebpackAsset.js.flow'

# Map webpack resolved module imports to the app directory
# Example: components/Foo -> `<project_root>/app/components/Foo`
module.name_mapper='^components/\(.*\)$' -> '<PROJECT_ROOT>/app/components/\1'
module.name_mapper='^containers/\(.*\)$' -> '<PROJECT_ROOT>/app/containers/\1'
module.name_mapper='^reducers/\(.*\)$' -> '<PROJECT_ROOT>/app/reducers/\1'
module.name_mapper='^store/\(.*\)$' -> '<PROJECT_ROOT>/app/store/\1'
module.name_mapper='^themes/\(.*\)$' -> '<PROJECT_ROOT>/app/themes/\1'
module.name_mapper='^hocs/\(.*\)$' -> '<PROJECT_ROOT>/app/hocs/\1'
module.name_mapper='^hooks/\(.*\)$' -> '<PROJECT_ROOT>/app/hooks/\1'
# Example: components/Foo -> `<project_root>/src/components/Foo`
module.name_mapper='^components/\(.*\)$' -> '<PROJECT_ROOT>/renderer/components/\1'
module.name_mapper='^containers/\(.*\)$' -> '<PROJECT_ROOT>/renderer/containers/\1'
module.name_mapper='^reducers/\(.*\)$' -> '<PROJECT_ROOT>/renderer/reducers/\1'
module.name_mapper='^store/\(.*\)$' -> '<PROJECT_ROOT>/renderer/store/\1'
module.name_mapper='^themes/\(.*\)$' -> '<PROJECT_ROOT>/renderer/themes/\1'
module.name_mapper='^hocs/\(.*\)$' -> '<PROJECT_ROOT>/renderer/hocs/\1'
module.name_mapper='^hooks/\(.*\)$' -> '<PROJECT_ROOT>/renderer/hooks/\1'

module.name_mapper='^@zap/\(.*\)$' -> '<PROJECT_ROOT>/\1'
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
app/node_modules

# OSX
.DS_Store
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ cache:
directories:
- node_modules
- flow-typed
- app/node_modules

addons:
apt:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"search.exclude": {
".git": true,
".eslintcache": true,
"app/dist": true,
"bower_components": true,
"dist": true,
"dll": true,
"flow-typed": true,
"release": true,
Expand Down
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ environment:

cache:
- node_modules -> package.json
- app/node_modules -> app/package.json
- flow-typed

matrix:
Expand Down
6 changes: 3 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module.exports = {
// Keep the root as a root
'.',

// Also consider app as "root" and load it's .babelrc files.
'./app/*',
// Also consider renderer as "root" and load it's .babelrc files.
'./renderer/*',
],
presets: [
[
Expand All @@ -24,7 +24,7 @@ module.exports = {
[
'react-intl-auto',
{
removePrefix: 'app/',
removePrefix: 'renderer/',
filebase: false,
},
],
Expand Down
1 change: 0 additions & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ Tests should try to be written for every feature/fix and pass `npm run test` bef
Before making a new release, the version number should be incremented in the following files:

- `package.json`: The main repo package file.
- `app/package.json`: The electron app package file.

If the release is a major or minor number increment (eg, `0.3.x` -> `0.4.x`), you should also update `STABLE_VERSION` in the main app config file to reference the correct new stable version (this is used to determine the app's database namespace):

Expand Down
4 changes: 2 additions & 2 deletions electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* through IPC.
*
* When running `npm run build` or `npm run build-main`, this file is compiled to
* `./app/dist/main.prod.js` using webpack. This gives us some performance wins.
* `/dist/main.prod.js` using webpack. This gives us some performance wins.
*/
import { app, BrowserWindow, session } from 'electron'
import installExtension, {
Expand All @@ -17,7 +17,7 @@ import os from 'os'
import fs from 'fs'
import bip21 from 'bip21'
import { mainLog } from '@zap/utils/log'
import themes from '@zap/app/themes'
import themes from '@zap/renderer/themes'
import { getDbName } from '@zap/utils/db'
import ZapMenuBuilder from './menuBuilder'
import ZapController from './controller'
Expand Down
4 changes: 2 additions & 2 deletions electron/preload.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* When running `npm run build` or `npm run build-preload`, this file is compiled to
* `./app/dist/preload.prod.js` using webpack.
* `/dist/preload.prod.js` using webpack.
*/
import { ipcRenderer, remote, shell } from 'electron'
import fs from 'fs'
Expand All @@ -10,7 +10,7 @@ import assert from 'assert'
import url from 'url'
import untildify from 'untildify'
import rimraf from 'rimraf'
import { getDb } from '@zap/app/store/db'
import { getDb } from '@zap/renderer/store/db'
import isSubDir from '@zap/utils/isSubDir'
import { getAllLocalWallets } from '@zap/utils/localWallets'
import { validateHost } from '@zap/utils/validateHost'
Expand Down
2 changes: 1 addition & 1 deletion lnd/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const stat = promisify(fs.stat)
*
* windows from source: "C:\myapp\node_modules\electron\dist\resources\default_app.asar"
* mac from source: "/Users/me/dev/myapp/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar"
* mac from a package: <appRootPathsomewhere>"/my.app/Contents/Resources/app.asar"
* mac from a package: <appRootPathsomewhere>"/myapp/Contents/Resources/app.asar"
*
* If we are run from outside of a packaged app, our working directory is the right place to be.
* And no, we can't just set our working directory to somewhere inside the asar. The OS can't handle that.
Expand Down
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
"build-preload-dev": "webpack -r @babel/register --config webpack/webpack.config.preload.dev.js",
"build-renderer": "webpack -r @babel/register --config webpack/webpack.config.renderer.prod.js",
"build-renderer-e2e": "webpack -r @babel/register --config webpack/webpack.config.renderer.e2e.js",
"clean": "rimraf node_modules app/node_modules dll app/dist coverage .eslintcache",
"clean": "rimraf node_modules dll dist coverage .eslintcache",
"coverage": "open coverage/index.html",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"predev": "npm run build-preload-dev",
"dev": "cross-env HOT=1 npm run start-renderer-dev",
"extract-messages": "extract-messages -l=af-ZA,ca-ES,de-DE,es-ES,ga-IE,hr-HR,ja-JP,no-NO,pt-PT,sr-SP,uk-UA,zh-TW,ar-SA,cs-CZ,el-GR,fi-FI,he-IL,hu-HU,ko-KR,pl-PL,ro-RO,sv-SE,vi-VN,bg-BG,da-DK,en,fr-FR,hi-IN,it-IT,nl-NL,pt-BR,ru-RU,tr-TR,zh-CN -o translations -d en --flat true app/**/messages.js",
"extract-messages": "extract-messages -l=af-ZA,ca-ES,de-DE,es-ES,ga-IE,hr-HR,ja-JP,no-NO,pt-PT,sr-SP,uk-UA,zh-TW,ar-SA,cs-CZ,el-GR,fi-FI,he-IL,hu-HU,ko-KR,pl-PL,ro-RO,sv-SE,vi-VN,bg-BG,da-DK,en,fr-FR,hi-IN,it-IT,nl-NL,pt-BR,ru-RU,tr-TR,zh-CN -o translations -d en --flat true renderer/**/messages.js",
"fetch-lnd": "node ./scripts/fetch-lnd-for-packaging.js",
"flow": "flow",
"flow-typed": "rimraf flow-typed/npm && flow-typed install --overwrite || true",
"generate-icons": "npx @svgr/cli --icon -d app/components/Icon icons && npm run lint-fix -- app/components/Icon",
"generate-icons": "npx @svgr/cli --icon -d renderer/components/Icon icons && npm run lint-fix -- renderer/components/Icon",
"lint-base": "eslint --cache --format=node_modules/eslint-formatter-pretty",
"lint": "npm run lint-base -- .",
"lint-fix-base": "npm run lint-base -- --fix",
Expand Down Expand Up @@ -52,7 +52,7 @@
"test-e2e-live": "cross-env ELECTRON_USER_DIR_TEMP=1 testcafe-live electron:./ ./test/e2e"
},
"config": {
"style_paths": "app/components/**/*.js",
"style_paths": "renderer/components/**/*.js",
"lnd-binary": {
"binaryVersion": "0.5.1-beta-982-gf9ba6759",
"binarySite": "https://github.com/LN-Zap/lnd/releases/download"
Expand Down Expand Up @@ -186,10 +186,10 @@
"homepage": "https://github.com/LN-Zap/zap-desktop#readme",
"jest": {
"collectCoverageFrom": [
"app/**/*.js",
"!app/dist/**",
"!app/dll/**",
"!app/coverage/**",
"renderer/**/*.js",
"!dist/**",
"!dll/**",
"!coverage/**",
"!**/node_modules/**"
],
"coverageReporters": [
Expand All @@ -205,8 +205,7 @@
"json"
],
"moduleDirectories": [
"app",
"app/node_modules",
"renderer",
"node_modules"
],
"setupFilesAfterEnv": [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 2f92308

Please sign in to comment.