Skip to content

Commit

Permalink
refactor: move things from internals dir to root dir
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Mar 22, 2019
1 parent f096b01 commit c163a61
Show file tree
Hide file tree
Showing 19 changed files with 26 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ module.exports = {
moduleDirectory: ['app', 'node_modules', 'app/node_modules'],
},
webpack: {
config: path.resolve(__dirname, 'internals', 'webpack', 'webpack.config.eslint.js'),
config: path.resolve(__dirname, 'webpack', 'webpack.config.eslint.js'),
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ 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>/internals/flow/WebpackAsset.js.flow'
module.name_mapper.extension='jpg' -> '<PROJECT_ROOT>/internals/flow/WebpackAsset.js.flow'
module.name_mapper.extension='svg' -> '<PROJECT_ROOT>/internals/flow/WebpackAsset.js.flow'
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`
Expand Down
14 changes: 7 additions & 7 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require('@babel/register')

const baseConfig = require('../internals/webpack/webpack.config.base')
const baseConfig = require('../webpack/webpack.config.base')
const merge = require('webpack-merge')

const config = merge.smart(baseConfig, {
Expand All @@ -10,18 +10,18 @@ const config = merge.smart(baseConfig, {
{
test: /\.stories\.jsx?$/,
loaders: [require.resolve('@storybook/addon-storysource/loader')],
enforce: 'pre'
}
]
enforce: 'pre',
},
],
},

node: {
__dirname: false,
__filename: false,
fs: 'empty',
module: 'empty'
}
}
module: 'empty',
},
},
})

module.exports = config
File renamed without changes.
3 changes: 0 additions & 3 deletions internals/flow/CSSModule.js.flow

This file was deleted.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
"scripts": {
"build": "cross-env NODE_CONFIG_ENV=production concurrently --raw \"npm:build-main\" \"npm:build-preload\" \"npm:build-renderer\"",
"build-e2e": "concurrently \"npm run build-main\" \"npm:build-preload\" \"npm run build-renderer-e2e\"",
"build-dll": "webpack -r @babel/register --config internals/webpack/webpack.config.renderer.dev.dll.js",
"build-main": "webpack -r @babel/register --config internals/webpack/webpack.config.main.prod.js",
"build-preload": "webpack -r @babel/register --config internals/webpack/webpack.config.preload.prod.js",
"build-renderer": "webpack -r @babel/register --config internals/webpack/webpack.config.renderer.prod.js",
"build-renderer-e2e": "webpack -r @babel/register --config internals/webpack/webpack.config.renderer.e2e.js",
"build-dll": "webpack -r @babel/register --config webpack/webpack.config.renderer.dev.dll.js",
"build-main": "webpack -r @babel/register --config webpack/webpack.config.main.prod.js",
"build-preload": "webpack -r @babel/register --config webpack/webpack.config.preload.prod.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",
"coverage": "open coverage/index.html",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"predev": "npm run build-preload",
"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 app/translations -d en --flat true app/**/messages.js",
"fetch-lnd": "node ./internals/scripts/fetch-lnd-for-packaging.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 app/icons && npm run lint-fix -- app/components/Icon",
Expand All @@ -37,7 +37,7 @@
"prestart": "cross-env NODE_CONFIG_ENV=production npm run build",
"start": "cross-env NODE_ENV=production electron ./app",
"start-main-dev": "electron -r @babel/register ./app/main.js",
"start-renderer-dev": "webpack-dev-server -r @babel/register --config internals/webpack/webpack.config.renderer.dev.js --progress",
"start-renderer-dev": "webpack-dev-server -r @babel/register --config webpack/webpack.config.renderer.dev.js --progress",
"storybook": "cross-env NODE_ENV=storybook start-storybook -p 6006",
"storybook:build": "cross-env NODE_ENV=storybook build-storybook",
"storybook:deploy": "npm run storybook:build && gh-pages -t -d storybook-static -o origin -b gh-pages",
Expand Down Expand Up @@ -197,7 +197,7 @@
"html"
],
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/internals/mocks/fileMock.js"
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/test/unit/__mocks__/fileMock.js"
},
"moduleFileExtensions": [
"js",
Expand Down Expand Up @@ -380,7 +380,7 @@
"window-or-global": "1.0.1",
"yup": "0.26.10"
},
"main": "internals/webpack/webpack.config.base.js",
"main": "webpack/webpack.config.base.js",
"directories": {
"test": "test"
}
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ go get -d github.com/lightningnetwork/lnd

### 3. Copy release scripts

Copy the scripts provided in `internals/scripts/lnd-release` over to the lnd working dir.
Copy the scripts provided in `scripts/lnd-release` over to the lnd working dir.

```
cp .goreleaser.yml $GOPATH/src/github.com/lightningnetwork/lnd/
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import path from 'path'
import { DefinePlugin, IgnorePlugin } from 'webpack'
import config from 'config'

export const rootDir = path.join(__dirname, '..', '..')
export const rootDir = path.join(__dirname, '..')

export default {
context: rootDir,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import webpack from 'webpack'
import path from 'path'
import merge from 'webpack-merge'
import baseConfig, { rootDir } from './webpack.config.base'
import { dependencies } from '../../package.json'
import { dependencies } from '../package.json'

export default merge.smart(baseConfig, {
context: process.cwd(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import HtmlWebpackPlugin from 'html-webpack-plugin'
import AddAssetHtmlPlugin from 'add-asset-html-webpack-plugin'
import CspHtmlWebpackPlugin from 'csp-html-webpack-plugin'
import baseConfig, { rootDir } from './webpack.config.base'
import { mainLog } from '../../app/lib/utils/log'
import { mainLog } from '../app/lib/utils/log'

const port = process.env.PORT || 1212
const publicPath = `http://localhost:${port}/dist`
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import CleanWebpackPlugin from 'clean-webpack-plugin'
import CopyWebpackPlugin from 'copy-webpack-plugin'
import merge from 'webpack-merge'
import baseConfig, { rootDir } from './webpack.config.base'
import { dependencies as externals } from '../../app/package.json'
import { dependencies as externals } from '../app/package.json'

export default merge.smart(baseConfig, {
devtool: 'source-map',
Expand Down Expand Up @@ -47,7 +47,7 @@ export default merge.smart(baseConfig, {

plugins: [
new CleanWebpackPlugin([path.resolve('app', 'dist')], {
root: path.resolve('..', '..'),
root: path.resolve(rootDir),
}),

new EnvironmentPlugin({
Expand Down

0 comments on commit c163a61

Please sign in to comment.