create-react-native-library 0.52.1 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/constants.js +3 -3
- package/lib/constants.js.map +1 -1
- package/lib/utils/initialCommit.js +9 -4
- package/lib/utils/initialCommit.js.map +1 -1
- package/package.json +2 -2
- package/templates/common/$.github/workflows/ci.yml +18 -0
- package/templates/common/CONTRIBUTING.md +1 -1
- package/templates/common/tsconfig.json +1 -0
- package/templates/native-common-example/turbo.json +1 -1
- package/templates/native-library-new/src/Native{%- project.name %}.ts +1 -2
- package/templates/native-view-new/src/{%- project.name %}ViewNativeComponent.ts +1 -2
package/lib/constants.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SUPPORTED_REACT_NATIVE_VERSION = exports.FALLBACK_NITRO_MODULES_VERSION = exports.FALLBACK_BOB_VERSION = void 0;
|
|
7
|
-
const FALLBACK_BOB_VERSION = exports.FALLBACK_BOB_VERSION = '0.40.
|
|
8
|
-
const FALLBACK_NITRO_MODULES_VERSION = exports.FALLBACK_NITRO_MODULES_VERSION = '0.
|
|
9
|
-
const SUPPORTED_REACT_NATIVE_VERSION = exports.SUPPORTED_REACT_NATIVE_VERSION = '0.
|
|
7
|
+
const FALLBACK_BOB_VERSION = exports.FALLBACK_BOB_VERSION = '0.40.13';
|
|
8
|
+
const FALLBACK_NITRO_MODULES_VERSION = exports.FALLBACK_NITRO_MODULES_VERSION = '0.28.1';
|
|
9
|
+
const SUPPORTED_REACT_NATIVE_VERSION = exports.SUPPORTED_REACT_NATIVE_VERSION = '0.81.0';
|
|
10
10
|
//# sourceMappingURL=constants.js.map
|
package/lib/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["FALLBACK_BOB_VERSION","exports","FALLBACK_NITRO_MODULES_VERSION","SUPPORTED_REACT_NATIVE_VERSION"],"sources":["../src/constants.ts"],"sourcesContent":["export const FALLBACK_BOB_VERSION = '0.40.
|
|
1
|
+
{"version":3,"file":"constants.js","names":["FALLBACK_BOB_VERSION","exports","FALLBACK_NITRO_MODULES_VERSION","SUPPORTED_REACT_NATIVE_VERSION"],"sources":["../src/constants.ts"],"sourcesContent":["export const FALLBACK_BOB_VERSION = '0.40.13';\nexport const FALLBACK_NITRO_MODULES_VERSION = '0.28.1';\nexport const SUPPORTED_REACT_NATIVE_VERSION = '0.81.0';\n"],"mappings":";;;;;;AAAO,MAAMA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,SAAS;AACtC,MAAME,8BAA8B,GAAAD,OAAA,CAAAC,8BAAA,GAAG,QAAQ;AAC/C,MAAMC,8BAA8B,GAAAF,OAAA,CAAAE,8BAAA,GAAG,QAAQ","ignoreList":[]}
|
|
@@ -6,10 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createInitialGitCommit = createInitialGitCommit;
|
|
7
7
|
var _spawn = require("./spawn");
|
|
8
8
|
async function createInitialGitCommit(folder, signal) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
let isInGitRepo = false;
|
|
10
|
+
try {
|
|
11
|
+
isInGitRepo = (await (0, _spawn.spawn)('git', ['rev-parse', '--is-inside-work-tree'], {
|
|
12
|
+
cwd: folder,
|
|
13
|
+
signal
|
|
14
|
+
})) === 'true';
|
|
15
|
+
} catch (error) {
|
|
16
|
+
// Ignore errors
|
|
17
|
+
}
|
|
13
18
|
if (!isInGitRepo) {
|
|
14
19
|
await (0, _spawn.spawn)('git', ['init'], {
|
|
15
20
|
cwd: folder,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialCommit.js","names":["_spawn","require","createInitialGitCommit","folder","signal","isInGitRepo","spawn","cwd"],"sources":["../../src/utils/initialCommit.ts"],"sourcesContent":["import { spawn } from './spawn';\n\nexport async function createInitialGitCommit(\n folder: string,\n signal?: AbortSignal\n) {\n
|
|
1
|
+
{"version":3,"file":"initialCommit.js","names":["_spawn","require","createInitialGitCommit","folder","signal","isInGitRepo","spawn","cwd","error"],"sources":["../../src/utils/initialCommit.ts"],"sourcesContent":["import { spawn } from './spawn';\n\nexport async function createInitialGitCommit(\n folder: string,\n signal?: AbortSignal\n) {\n let isInGitRepo = false;\n\n try {\n isInGitRepo =\n (await spawn('git', ['rev-parse', '--is-inside-work-tree'], {\n cwd: folder,\n signal,\n })) === 'true';\n } catch (error) {\n // Ignore errors\n }\n\n if (!isInGitRepo) {\n await spawn('git', ['init'], { cwd: folder, signal });\n await spawn('git', ['branch', '-M', 'main'], { cwd: folder, signal });\n await spawn('git', ['add', '.'], { cwd: folder, signal });\n await spawn('git', ['commit', '-m', 'chore: initial commit'], {\n cwd: folder,\n signal,\n });\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,eAAeC,sBAAsBA,CAC1CC,MAAc,EACdC,MAAoB,EACpB;EACA,IAAIC,WAAW,GAAG,KAAK;EAEvB,IAAI;IACFA,WAAW,GACT,CAAC,MAAM,IAAAC,YAAK,EAAC,KAAK,EAAE,CAAC,WAAW,EAAE,uBAAuB,CAAC,EAAE;MAC1DC,GAAG,EAAEJ,MAAM;MACXC;IACF,CAAC,CAAC,MAAM,MAAM;EAClB,CAAC,CAAC,OAAOI,KAAK,EAAE;IACd;EAAA;EAGF,IAAI,CAACH,WAAW,EAAE;IAChB,MAAM,IAAAC,YAAK,EAAC,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE;MAAEC,GAAG,EAAEJ,MAAM;MAAEC;IAAO,CAAC,CAAC;IACrD,MAAM,IAAAE,YAAK,EAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE;MAAEC,GAAG,EAAEJ,MAAM;MAAEC;IAAO,CAAC,CAAC;IACrE,MAAM,IAAAE,YAAK,EAAC,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE;MAAEC,GAAG,EAAEJ,MAAM;MAAEC;IAAO,CAAC,CAAC;IACzD,MAAM,IAAAE,YAAK,EAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,uBAAuB,CAAC,EAAE;MAC5DC,GAAG,EAAEJ,MAAM;MACXC;IACF,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-react-native-library",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "CLI to scaffold React Native libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"@types/validate-npm-package-name": "^3.0.3",
|
|
67
67
|
"@types/yargs": "^17.0.10"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "5b8e97253b9626f01b4ec19ef39d0d1c210e798d"
|
|
70
70
|
}
|
|
@@ -13,6 +13,7 @@ on:
|
|
|
13
13
|
jobs:
|
|
14
14
|
lint:
|
|
15
15
|
runs-on: ubuntu-latest
|
|
16
|
+
|
|
16
17
|
steps:
|
|
17
18
|
- name: Checkout
|
|
18
19
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
@@ -28,6 +29,7 @@ jobs:
|
|
|
28
29
|
|
|
29
30
|
test:
|
|
30
31
|
runs-on: ubuntu-latest
|
|
32
|
+
|
|
31
33
|
steps:
|
|
32
34
|
- name: Checkout
|
|
33
35
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
@@ -40,6 +42,7 @@ jobs:
|
|
|
40
42
|
|
|
41
43
|
build-library:
|
|
42
44
|
runs-on: ubuntu-latest
|
|
45
|
+
|
|
43
46
|
steps:
|
|
44
47
|
- name: Checkout
|
|
45
48
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
@@ -52,9 +55,15 @@ jobs:
|
|
|
52
55
|
|
|
53
56
|
<% if (project.native) { -%>
|
|
54
57
|
build-android:
|
|
58
|
+
concurrency:
|
|
59
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
60
|
+
cancel-in-progress: true
|
|
61
|
+
|
|
55
62
|
runs-on: ubuntu-latest
|
|
63
|
+
|
|
56
64
|
env:
|
|
57
65
|
TURBO_CACHE_DIR: .turbo/android
|
|
66
|
+
|
|
58
67
|
steps:
|
|
59
68
|
- name: Checkout
|
|
60
69
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
@@ -113,10 +122,18 @@ jobs:
|
|
|
113
122
|
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
|
|
114
123
|
|
|
115
124
|
build-ios:
|
|
125
|
+
concurrency:
|
|
126
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
127
|
+
cancel-in-progress: true
|
|
128
|
+
|
|
116
129
|
runs-on: macos-latest
|
|
130
|
+
|
|
117
131
|
env:
|
|
118
132
|
XCODE_VERSION: 16.2
|
|
119
133
|
TURBO_CACHE_DIR: .turbo/ios
|
|
134
|
+
RCT_USE_RN_DEP: 1
|
|
135
|
+
RCT_USE_PREBUILT_RNCORE: 1
|
|
136
|
+
|
|
120
137
|
steps:
|
|
121
138
|
- name: Checkout
|
|
122
139
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
@@ -165,6 +182,7 @@ jobs:
|
|
|
165
182
|
<% } else { -%>
|
|
166
183
|
build-web:
|
|
167
184
|
runs-on: ubuntu-latest
|
|
185
|
+
|
|
168
186
|
steps:
|
|
169
187
|
- name: Checkout
|
|
170
188
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
@@ -110,7 +110,7 @@ We follow the [conventional commits specification](https://www.conventionalcommi
|
|
|
110
110
|
- `fix`: bug fixes, e.g. fix crash due to deprecated method.
|
|
111
111
|
- `feat`: new features, e.g. add new method to the module.
|
|
112
112
|
- `refactor`: code refactor, e.g. migrate from class components to hooks.
|
|
113
|
-
- `docs`: changes into documentation, e.g. add usage example for the module
|
|
113
|
+
- `docs`: changes into documentation, e.g. add usage example for the module.
|
|
114
114
|
- `test`: adding or updating tests, e.g. add integration tests using detox.
|
|
115
115
|
- `chore`: tooling changes, e.g. change CI config.
|
|
116
116
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import codegenNativeComponent from 'react-native
|
|
2
|
-
import type { ViewProps } from 'react-native';
|
|
1
|
+
import { codegenNativeComponent, type ViewProps } from 'react-native';
|
|
3
2
|
|
|
4
3
|
interface NativeProps extends ViewProps {
|
|
5
4
|
color?: string;
|