create-react-native-library
Advanced tools
Comparing version 0.19.0 to 0.20.0
@@ -6,2 +6,23 @@ # Change Log | ||
# [0.20.0](https://github.com/callstack/react-native-builder-bob/compare/create-react-native-library@0.19.0...create-react-native-library@0.20.0) (2021-09-28) | ||
### Bug Fixes | ||
* **android:** prefer downloading dependencies from Maven Central ([#198](https://github.com/callstack/react-native-builder-bob/issues/198)) ([ecea932](https://github.com/callstack/react-native-builder-bob/commit/ecea932b52011378db35a223023097fa11ed651e)) | ||
* can't run yarn command under Windows ([8bac4d4](https://github.com/callstack/react-native-builder-bob/commit/8bac4d4690a0ba2576e9b83b00be92061ba796e3)) | ||
* fix generating cpp project on iOS ([75a4a3c](https://github.com/callstack/react-native-builder-bob/commit/75a4a3cf1b7d5f3c2b14f2f3a20c0be72250a119)) | ||
* wrong package name of ReactNativeFlipper ([#161](https://github.com/callstack/react-native-builder-bob/issues/161)) ([981448d](https://github.com/callstack/react-native-builder-bob/commit/981448db9970e42521661a5b6e54fd71fe3390ef)) | ||
### Features | ||
* print an error when library is not linked ([#202](https://github.com/callstack/react-native-builder-bob/issues/202)) ([956ffd6](https://github.com/callstack/react-native-builder-bob/commit/956ffd60a6b4132a81494e1599b52e5aee232111)) | ||
* update expo sdk version to 42 ([#192](https://github.com/callstack/react-native-builder-bob/issues/192)) ([6276f59](https://github.com/callstack/react-native-builder-bob/commit/6276f59001cb92840a421de6bd01b41697ef1222)) | ||
* upgrade husky to v6 ([a78b9d1](https://github.com/callstack/react-native-builder-bob/commit/a78b9d147a2a2d1c42f050c60f808855bb97bc24)) | ||
# [0.19.0](https://github.com/callstack/react-native-builder-bob/compare/create-react-native-library@0.18.1...create-react-native-library@0.19.0) (2021-04-06) | ||
@@ -8,0 +29,0 @@ |
@@ -25,2 +25,3 @@ "use strict"; | ||
const FALLBACK_BOB_VERSION = '0.18.0'; | ||
const BINARIES = /(gradlew|\.(jar|keystore|png|jpg|gif))$/; | ||
@@ -40,47 +41,22 @@ | ||
const FALLBACK_BOB_VERSION = '0.18.0'; // Java | ||
const JAVA_FILES = moduleType => { | ||
switch (moduleType) { | ||
case 'module': | ||
return _path.default.resolve(__dirname, '../templates/java-library'); | ||
case 'view': | ||
return _path.default.resolve(__dirname, '../templates/java-view-library'); | ||
} | ||
}; // Objc | ||
const OBJC_FILES = moduleType => { | ||
switch (moduleType) { | ||
case 'module': | ||
return _path.default.resolve(__dirname, '../templates/objc-library'); | ||
case 'view': | ||
return _path.default.resolve(__dirname, '../templates/objc-view-library'); | ||
} | ||
}; // Kotlin | ||
const KOTLIN_FILES = moduleType => { | ||
switch (moduleType) { | ||
case 'module': | ||
return _path.default.resolve(__dirname, '../templates/kotlin-library'); | ||
case 'view': | ||
return _path.default.resolve(__dirname, '../templates/kotlin-view-library'); | ||
} | ||
}; // Swift | ||
const SWIFT_FILES = moduleType => { | ||
switch (moduleType) { | ||
case 'module': | ||
return _path.default.resolve(__dirname, '../templates/swift-library'); | ||
case 'view': | ||
return _path.default.resolve(__dirname, '../templates/swift-view-library'); | ||
} | ||
const NATIVE_FILES = { | ||
module: _path.default.resolve(__dirname, '../templates/native-library'), | ||
view: _path.default.resolve(__dirname, '../templates/native-view-library') | ||
}; | ||
const JAVA_FILES = { | ||
module: _path.default.resolve(__dirname, '../templates/java-library'), | ||
view: _path.default.resolve(__dirname, '../templates/java-view-library') | ||
}; | ||
const OBJC_FILES = { | ||
module: _path.default.resolve(__dirname, '../templates/objc-library'), | ||
view: _path.default.resolve(__dirname, '../templates/objc-view-library') | ||
}; | ||
const KOTLIN_FILES = { | ||
module: _path.default.resolve(__dirname, '../templates/kotlin-library'), | ||
view: _path.default.resolve(__dirname, '../templates/kotlin-view-library') | ||
}; | ||
const SWIFT_FILES = { | ||
module: _path.default.resolve(__dirname, '../templates/swift-library'), | ||
view: _path.default.resolve(__dirname, '../templates/swift-view-library') | ||
}; | ||
const args = { | ||
@@ -290,3 +266,3 @@ 'slug': { | ||
package: slug.replace(/[^a-z0-9]/g, '').toLowerCase(), | ||
podspec: slug.replace(/[^a-z0-9]+/g, '-').replace(/^-/, ''), | ||
identifier: slug.replace(/[^a-z0-9]+/g, '-').replace(/^-/, ''), | ||
native: languages !== 'js', | ||
@@ -345,18 +321,20 @@ cpp: languages === 'cpp', | ||
await copyDir(NATIVE_COMMON_FILES, folder); | ||
await copyDir(NATIVE_FILES[type], folder); | ||
if (options.project.cpp) { | ||
await copyDir(CPP_FILES, folder); | ||
} | ||
if (options.project.swift) { | ||
await copyDir(SWIFT_FILES(type), folder); | ||
await copyDir(SWIFT_FILES[type], folder); | ||
} else { | ||
await copyDir(OBJC_FILES(type), folder); | ||
await copyDir(OBJC_FILES[type], folder); | ||
} | ||
if (options.project.kotlin) { | ||
await copyDir(KOTLIN_FILES(type), folder); | ||
await copyDir(KOTLIN_FILES[type], folder); | ||
} else { | ||
await copyDir(JAVA_FILES(type), folder); | ||
await copyDir(JAVA_FILES[type], folder); | ||
} | ||
if (options.project.cpp) { | ||
await copyDir(CPP_FILES, folder); | ||
await _fsExtra.default.remove(_path.default.join(folder, 'ios', `${options.project.name}.m`)); | ||
} | ||
} | ||
@@ -363,0 +341,0 @@ |
{ | ||
"name": "create-react-native-library", | ||
"version": "0.19.0", | ||
"version": "0.20.0", | ||
"description": "CLI to scaffold React Native libraries", | ||
@@ -72,3 +72,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "bbe6b1cee27e8d9df88dbc5523a13523789ed40e" | ||
"gitHead": "7409f5ec57a50ff3c1e45db72e7c0c6c8407c203" | ||
} |
@@ -16,3 +16,3 @@ { | ||
"cpp", | ||
"<%- project.podspec %>.podspec", | ||
"<%- project.identifier %>.podspec", | ||
"!lib/typescript/example", | ||
@@ -61,3 +61,3 @@ "!android/build", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"husky": "^4.2.5", | ||
"husky": "^6.0.0", | ||
"jest": "^26.0.1", | ||
@@ -83,8 +83,2 @@ "pod-install": "^0.1.0", | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS", | ||
"pre-commit": "yarn lint && yarn typescript" | ||
} | ||
}, | ||
"commitlint": { | ||
@@ -91,0 +85,0 @@ "extends": [ |
@@ -109,3 +109,3 @@ # Contributing | ||
> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github). | ||
> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github). | ||
@@ -112,0 +112,0 @@ When you're sending a pull request: |
@@ -13,10 +13,20 @@ # <%- project.slug %> | ||
<% if (project.moduleType === "view") { -%> | ||
```js | ||
import <%- project.name %> from "<%- project.slug %>"; | ||
import { <%- project.name %>View } from "<%- project.slug %>"; | ||
// ... | ||
const result = await <%- project.name %>.multiply(3, 7); | ||
<<%- project.name %>View color="tomato" /> | ||
``` | ||
<% } else { -%> | ||
```js | ||
import { multiply } from "<%- project.slug %>"; | ||
// ... | ||
const result = await multiply(3, 7); | ||
``` | ||
<% } -%> | ||
## Contributing | ||
@@ -23,0 +33,0 @@ |
@@ -0,1 +1,2 @@ | ||
const os = require('os'); | ||
const path = require('path'); | ||
@@ -13,2 +14,6 @@ const child_process = require('child_process'); | ||
if (os.type() === 'Windows_NT') { | ||
options.shell = true | ||
} | ||
let result; | ||
@@ -15,0 +20,0 @@ |
@@ -15,12 +15,12 @@ { | ||
"dependencies": { | ||
"expo": "^40.0.0", | ||
"expo-splash-screen": "~0.8.1", | ||
"expo": "^42.0.0", | ||
"expo-splash-screen": "~0.11.2", | ||
"react": "16.13.1", | ||
"react-dom": "16.13.1", | ||
"react-native": "0.63.4", | ||
"react-native-unimodules": "~0.12.0", | ||
"react-native-web": "~0.14.9" | ||
"react-native-unimodules": "~0.14.5", | ||
"react-native-web": "~0.13.12" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "~7.12.10", | ||
"@babel/core": "~7.9.0", | ||
"@babel/runtime": "^7.9.6", | ||
@@ -27,0 +27,0 @@ "babel-plugin-module-resolver": "^4.0.0", |
@@ -6,3 +6,3 @@ { | ||
"name": "<%- project.slug %>-example", | ||
"slug": "<%- project.podspec %>-example", | ||
"slug": "<%- project.identifier %>-example", | ||
"description": "Example app for <%- project.slug %>", | ||
@@ -9,0 +9,0 @@ "privacy": "public", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
326847
115
920