Skip to content

Commit

Permalink
webpack updates, docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pavjacko committed May 23, 2019
1 parent ad6a8ae commit 93d7b7b
Show file tree
Hide file tree
Showing 16 changed files with 290 additions and 416 deletions.
327 changes: 158 additions & 169 deletions README.md

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions docs/changelog/0.21.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 0.21.6

### Optional Platforms Support

```bash
rnv app create
```

### support for plugin cocoapods github commit

```json
"ios-photo-editor": {
"no-npm": true,
"ios": { "podName": "iOSPhotoEditor", "git": "https://github.com/prscX/photo-editor", "commit": "fa8894c992dedb431d696eb43ac4cc4ba847b4b8" }
},
```

### Inject activity method via plugin configuration

```json
"android": {
"package": "org.wonday.orientation.OrientationPackage",
"activityImports": [
"android.content.res.Configuration"
],
"activityMethods": [
"override fun onConfigurationChanged(newConfig:Configuration) {",
" super.onConfigurationChanged(newConfig)",
" val intent = Intent(\"onConfigurationChanged\")",
" intent.putExtra(\"newConfig\", newConfig)",
" this.sendBroadcast(intent)",
"}"
]
},
```

### Create Android Emulator on Demand

```bash
rnv run -p android
```

## Bug Fixes

- Android TV theme error
- Added eslint detox
- improved webpack config
Binary file added docs/cli_app_create1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "renative",
"title": "ReNative",
"version": "0.21.6-alpha.1",
"version": "0.21.6",
"codename": "Drunk Thanos",
"keywords": [
"react",
Expand Down
16 changes: 8 additions & 8 deletions rnv-cli/platformTemplates/_shared/configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');

function generateConfig(appDir, config) {
const projectDir = path.resolve(appDir, '../../');
const platformBuildsDir = path.resolve(appDir, '../');
function generateConfig(config) {
const projectDir = path.resolve(config.currentDir, '../../');
const platformBuildsDir = path.resolve(config.currentDir, '../');
const platformBuildsSharedDir = path.join(platformBuildsDir, '_shared');
const appBuildDir = path.resolve(appDir);
const appBuildPublicDir = path.resolve(appDir, 'public');
const appBuildDir = path.resolve(config.currentDir);
const appBuildPublicDir = path.resolve(config.currentDir, 'public');

const baseUrl = '';
const devServerHost='0.0.0.0'
const baseUrl = config.baseUrl || '';
const devServerHost = config.devServerHost || '0.0.0.0'

const rules = {};
rules.babel = {
Expand Down Expand Up @@ -63,7 +63,7 @@ function generateConfig(appDir, config) {
},
};

rules.ttf = {
rules.fonts = {
test: /\.(ttf|otf)(\?[\s\S]+)?$/,
use: 'file-loader',
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
const Configs = require('../_shared/configs.js');

const config = {
currentDir: __dirname,
metaTags: { viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no' },
environment: 'development',
extensions: ['firefoxos', 'firefox', 'web'],
};

const C = Configs.generateConfig(__dirname, config);
const C = Configs.generateConfig(config);

module.exports = {
entry: C.entry,
devServer: C.devServer,
output: C.output,
module: {
rules: [C.Rules.babel, C.Rules.css, C.Rules.image, C.Rules.ttf, C.Rules.sourcemap],
rules: [C.Rules.babel, C.Rules.css, C.Rules.image, C.Rules.fonts, C.Rules.sourcemap],
},
plugins: [C.Plugins.webpack, C.Plugins.html, C.Plugins.harddisk],
resolve: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
const Configs = require('../_shared/configs.js');

const config = {
currentDir: __dirname,
metaTags: { viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no' },
environment: 'production',
extensions: ['firefoxos', 'firefox', 'web'],
};

const C = Configs.generateConfig(__dirname, config);
const C = Configs.generateConfig(config);

module.exports = {
entry: C.entry,
devServer: C.devServer,
output: C.output,
module: {
rules: [C.Rules.babel, C.Rules.css, C.Rules.image, C.Rules.ttf, C.Rules.sourcemap],
rules: [C.Rules.babel, C.Rules.css, C.Rules.image, C.Rules.fonts, C.Rules.sourcemap],
},
plugins: [C.Plugins.webpack, C.Plugins.html, C.Plugins.harddisk],
resolve: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
const Configs = require('../_shared/configs.js');

const config = {
currentDir: __dirname,
metaTags: { viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no' },
environment: 'development',
extensions: ['firefoxtv', 'smarttv', 'firefox', 'web'],
};

const C = Configs.generateConfig(__dirname, config);
const C = Configs.generateConfig(config);

module.exports = {
entry: C.entry,
devServer: C.devServer,
output: C.output,
module: {
rules: [C.Rules.babel, C.Rules.css, C.Rules.image, C.Rules.ttf, C.Rules.sourcemap],
rules: [C.Rules.babel, C.Rules.css, C.Rules.image, C.Rules.fonts, C.Rules.sourcemap],
},
plugins: [C.Plugins.webpack, C.Plugins.html, C.Plugins.harddisk],
resolve: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
const Configs = require('../_shared/configs.js');

const config = {
currentDir: __dirname,
metaTags: { viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no' },
environment: 'production',
extensions: ['firefoxtv', 'smarttv', 'firefox', 'web'],
};

const C = Configs.generateConfig(__dirname, config);
const C = Configs.generateConfig(config);

module.exports = {
entry: C.entry,
devServer: C.devServer,
output: C.output,
module: {
rules: [C.Rules.babel, C.Rules.css, C.Rules.image, C.Rules.ttf, C.Rules.sourcemap],
rules: [C.Rules.babel, C.Rules.css, C.Rules.image, C.Rules.fonts, C.Rules.sourcemap],
},
plugins: [C.Plugins.webpack, C.Plugins.html, C.Plugins.harddisk],
resolve: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
const Configs = require('../_shared/configs.js');

const config = {
currentDir: __dirname,
metaTags: { viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no' },
environment: 'development',
extensions: ['kaios', 'firefox', 'web'],
};

const C = Configs.generateConfig(__dirname, config);
const C = Configs.generateConfig(config);

module.exports = {
entry: C.entry,
devServer: C.devServer,
output: C.output,
module: {
rules: [C.Rules.babel, C.Rules.css, C.Rules.image, C.Rules.ttf, C.Rules.sourcemap],
rules: [C.Rules.babel, C.Rules.css, C.Rules.image, C.Rules.fonts, C.Rules.sourcemap],
},
plugins: [C.Plugins.webpack, C.Plugins.html, C.Plugins.harddisk],
resolve: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
const Configs = require('../_shared/configs.js');

const config = {
currentDir: __dirname,
metaTags: { viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no' },
environment: 'production',
extensions: ['kaios', 'firefox', 'web'],
};

const C = Configs.generateConfig(__dirname, config);
const C = Configs.generateConfig(config);

module.exports = {
entry: C.entry,
devServer: C.devServer,
output: C.output,
module: {
rules: [C.Rules.babel, C.Rules.css, C.Rules.image, C.Rules.ttf, C.Rules.sourcemap],
rules: [C.Rules.babel, C.Rules.css, C.Rules.image, C.Rules.fonts, C.Rules.sourcemap],
},
plugins: [C.Plugins.webpack, C.Plugins.html, C.Plugins.harddisk],
resolve: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
const Configs = require('../_shared/configs.js');

const config = {
currentDir: __dirname,
metaTags: { viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no' },
environment: 'development',
extensions: ['macos', 'desktop', 'web'],
};

const C = Configs.generateConfig(__dirname, config);
const C = Configs.generateConfig(config);

module.exports = {
entry: C.entry,
devServer: C.devServer,
output: C.output,
module: {
rules: [C.Rules.babel, C.Rules.css, C.Rules.image, C.Rules.ttf, C.Rules.sourcemap],
rules: [C.Rules.babel, C.Rules.css, C.Rules.image, C.Rules.fonts, C.Rules.sourcemap],
},
plugins: [C.Plugins.webpack, C.Plugins.html, C.Plugins.harddisk],
resolve: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
const Configs = require('../_shared/configs.js');

const config = {
currentDir: __dirname,
metaTags: { viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no' },
environment: 'production',
extensions: ['macos', 'desktop', 'web'],
};

const C = Configs.generateConfig(__dirname, config);
const C = Configs.generateConfig(config);

module.exports = {
entry: C.entry,
output: C.output,
module: {
rules: [C.Rules.babel, C.Rules.css, C.Rules.image, C.Rules.ttf, C.Rules.sourcemap],
rules: [C.Rules.babel, C.Rules.css, C.Rules.image, C.Rules.fonts, C.Rules.sourcemap],
},
plugins: [C.Plugins.webpack, C.Plugins.html, C.Plugins.harddisk],
resolve: {
Expand Down
Loading

0 comments on commit 93d7b7b

Please sign in to comment.