rock 0.3.1 → 0.8.13
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/README.md +51 -196
- package/dist/src/bin.d.ts +2 -0
- package/dist/src/bin.d.ts.map +1 -0
- package/dist/src/bin.js +7 -0
- package/dist/src/bin.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib/adHocTemplates.d.ts +13 -0
- package/dist/src/lib/adHocTemplates.js +366 -0
- package/dist/src/lib/adHocTemplates.js.map +1 -0
- package/dist/src/lib/checkDeprecatedOptions.d.ts +1 -0
- package/dist/src/lib/checkDeprecatedOptions.d.ts.map +1 -0
- package/dist/src/lib/checkDeprecatedOptions.js +60 -0
- package/dist/src/lib/checkDeprecatedOptions.js.map +1 -0
- package/dist/src/lib/cli.d.ts +6 -0
- package/dist/src/lib/cli.d.ts.map +1 -0
- package/dist/src/lib/cli.js +101 -0
- package/dist/src/lib/cli.js.map +1 -0
- package/dist/src/lib/plugins/clean.d.ts +2 -0
- package/dist/src/lib/plugins/clean.d.ts.map +1 -0
- package/dist/src/lib/plugins/clean.js +317 -0
- package/dist/src/lib/plugins/clean.js.map +1 -0
- package/dist/src/lib/plugins/fingerprint.d.ts +12 -0
- package/dist/src/lib/plugins/fingerprint.d.ts.map +1 -0
- package/dist/src/lib/plugins/fingerprint.js +72 -0
- package/dist/src/lib/plugins/fingerprint.js.map +1 -0
- package/dist/src/lib/plugins/logConfig.d.ts +14 -0
- package/dist/src/lib/plugins/logConfig.d.ts.map +1 -0
- package/dist/src/lib/plugins/logConfig.js +54 -0
- package/dist/src/lib/plugins/logConfig.js.map +1 -0
- package/dist/src/lib/plugins/remoteCache.d.ts +2 -0
- package/dist/src/lib/plugins/remoteCache.d.ts.map +1 -0
- package/dist/src/lib/plugins/remoteCache.js +335 -0
- package/dist/src/lib/plugins/remoteCache.js.map +1 -0
- package/dist/src/lib/plugins/templateIndexHtml.d.ts +5 -0
- package/dist/src/lib/plugins/templateIndexHtml.js +189 -0
- package/dist/src/lib/plugins/templateIndexHtml.js.map +1 -0
- package/dist/src/lib/plugins/templateManifestPlist.d.ts +8 -0
- package/dist/src/lib/plugins/templateManifestPlist.js +36 -0
- package/dist/src/lib/plugins/templateManifestPlist.js.map +1 -0
- package/package.json +31 -44
- package/.npmignore +0 -1
- package/CHANGELOG.md +0 -61
- package/LICENSE +0 -15
- package/bin/rock +0 -51
- package/lib/rock.js +0 -191
- package/lib/tweezers.js +0 -43
- package/lib/util.js +0 -10
- package/test/mocha.opts +0 -3
- package/test/resources/expect/myapp/LICENSE +0 -15
- package/test/resources/expect/myapp/README.md +0 -18
- package/test/resources/expect/myapp/ignore_this/READTHIS.md +0 -1
- package/test/resources/expect/myapp/lib/cool_module.js +0 -4
- package/test/resources/expect/myapp/test/cool_module.test.js +0 -4
- package/test/resources/rock.conf.json +0 -3
- package/test/resources/rocks/node-lib/.rock/rock.json +0 -9
- package/test/resources/rocks/node-lib/.rock/scripts/bye.js +0 -1
- package/test/resources/rocks/node-lib/.rock/scripts/hi.sh +0 -3
- package/test/resources/rocks/node-lib/LICENSE +0 -15
- package/test/resources/rocks/node-lib/README.md +0 -18
- package/test/resources/rocks/node-lib/ignore_this/READTHIS.md +0 -1
- package/test/resources/rocks/node-lib/lib/{{project-name}}.js +0 -4
- package/test/resources/rocks/node-lib/test/{{project-name}}.test.js +0 -4
- package/test/resources/rocks/node-lib-tmpl/.rock/rock.json +0 -13
- package/test/resources/rocks/node-lib-tmpl/.rock/scripts/bye.js +0 -1
- package/test/resources/rocks/node-lib-tmpl/.rock/scripts/hi.sh +0 -3
- package/test/resources/rocks/node-lib-tmpl/LICENSE +0 -15
- package/test/resources/rocks/node-lib-tmpl/README.md +0 -18
- package/test/resources/rocks/node-lib-tmpl/ignore_this/READTHIS.md +0 -1
- package/test/resources/rocks/node-lib-tmpl/lib/@@project-name@@.js +0 -4
- package/test/resources/rocks/node-lib-tmpl/test/@@project-name@@.test.js +0 -4
- package/test/rock-bin.test.js +0 -81
- package/test/rock-dload-github.test.js +0 -54
- package/test/rock-file.test.js +0 -49
- package/test/rock.test.js +0 -90
package/README.md
CHANGED
|
@@ -1,229 +1,84 @@
|
|
|
1
|
+
<a href="https://www.callstack.com/open-source?utm_campaign=generic&utm_source=github&utm_medium=referral&utm_content=rock" align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<img alt="Rock" src="https://github.com/user-attachments/assets/417baa3c-ae36-447f-baf9-1e0f423c3433">
|
|
4
|
+
</picture>
|
|
5
|
+
</a>
|
|
6
|
+
<p align="center">
|
|
7
|
+
🪨 Rock is a cross-platform React Native app development and build toolchain built for modularity, build reuse, and incremental adoption. It integrates seamlessly with your existing infrastructure, giving you complete control without vendor lock-in.
|
|
8
|
+
</p>
|
|
1
9
|
|
|
10
|
+
---
|
|
2
11
|
|
|
3
|
-
|
|
4
|
-
=================
|
|
12
|
+
## React Native at scale is challenging
|
|
5
13
|
|
|
6
|
-
|
|
14
|
+
Enterprise apps aren't built overnight. As maintainers of the Community CLI and partners to enterprise teams, we've seen the real challenges: high build times, difficulty adopting new third-party cloud services, and high barriers to introducing React Native into existing iOS and Android apps.
|
|
7
15
|
|
|
16
|
+
Rock simplifies native build setup and reuse. In most React Native codebases, only about 10% of code changes affect the native iOS/Android files. Yet most teams rebuild their native apps constantly—on every commit, PR, or merge to main—when it's completely unnecessary.
|
|
8
17
|
|
|
9
|
-
|
|
10
|
-
----
|
|
18
|
+
Rock leverages this insight by providing intelligent caching in your cloud infrastructure, seamlessly integrated through its CLI. This allows you to skip up to 90% of unnecessary native builds.
|
|
11
19
|
|
|
12
|
-
|
|
20
|
+
## Features
|
|
13
21
|
|
|
14
|
-
|
|
22
|
+
**🖥️ Brand New CLI**
|
|
23
|
+
A familiar CLI experience with end-to-end development and build workflows. Migrate in just 10 minutes.
|
|
15
24
|
|
|
16
|
-
|
|
25
|
+
**☁️ Reusable Cloud Builds**
|
|
26
|
+
Reliable caching of native artifacts (APK, IPA) that you can store wherever you prefer, or use our out-of-the-box integrations with GitHub, S3, and R2.
|
|
17
27
|
|
|
28
|
+
**🔧 GitHub Actions**
|
|
29
|
+
Complete logic for downloading, uploading, and building native artifacts for iOS (APP, IPA) and Android (APK, AAB).
|
|
18
30
|
|
|
31
|
+
**🔗 Plug-and-Play Brownfield**
|
|
32
|
+
Package your React Native app as a framework and integrate it into your iOS and Android apps just like any other library.
|
|
19
33
|
|
|
20
|
-
|
|
21
|
-
|
|
34
|
+
**📦 Bundler Flexibility**
|
|
35
|
+
Rock supports both Metro and Re.Pack for JavaScript bundling. With Re.Pack, you can build Super Apps and Mobile Microfrontends.
|
|
22
36
|
|
|
23
|
-
|
|
37
|
+
**🔌 Extensible Plugin System**
|
|
38
|
+
Built with modularity in mind, Rock allows you to extend its capabilities through plugins that integrate with both the CLI and native templates.
|
|
24
39
|
|
|
25
|
-
|
|
40
|
+
## Installation
|
|
26
41
|
|
|
27
|
-
|
|
42
|
+
Rock is designed for incremental adoption. Whether you're just starting with React Native in your iOS or Android app, or want to migrate from the React Native Community CLI, you can do it step-by-step without having to figure everything out at once.
|
|
28
43
|
|
|
29
|
-
|
|
44
|
+
### Migrating an existing Community CLI project
|
|
30
45
|
|
|
31
|
-
|
|
32
|
-
At this time, `rock` requires `git` to be installed. This is because all the templates are hosted on Github. Since Github also provides tarballs and zipballs, this requirement will change soon.
|
|
46
|
+
To migrate an existing project, open a terminal in your project root and run:
|
|
33
47
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
After install, `rock` will create the file `rockconf.json` in your `~/.rock/` directory. You can modify this file to include additional repositories if you like.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
Usage
|
|
42
|
-
-----
|
|
43
|
-
|
|
44
|
-
rock [path] -r [rock]
|
|
45
|
-
|
|
46
|
-
example:
|
|
47
|
-
|
|
48
|
-
rock mylib -r node-lib
|
|
49
|
-
or
|
|
50
|
-
|
|
51
|
-
rock /tmp/mylib -r node-lib
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
### Options
|
|
55
|
-
|
|
56
|
-
Options:
|
|
57
|
-
--version Print version and exit.
|
|
58
|
-
-r ROCK, --rock ROCK The rock path or Github repo.
|
|
59
|
-
-c, --config The config file. Defaults to ~/.rock/rock.conf.json
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
want to create a project from a rock hosted somewhere else? No problem:
|
|
63
|
-
|
|
64
|
-
rock myapp -r git@github.com:johndoe/myrepo.git
|
|
65
|
-
|
|
66
|
-
or use Github shorthand a la [component](https://github.com/component/component)
|
|
67
|
-
|
|
68
|
-
rock myapp -r johndoe/myrepo
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
Make Your Own Rocks
|
|
72
|
-
-------------------
|
|
73
|
-
|
|
74
|
-
It's stupidly simple to make your own rocks. Create a Git repository on Github or an empty directory on your filesystem. Start making template files.
|
|
75
|
-
|
|
76
|
-
Example (myproject.js):
|
|
77
|
-
|
|
78
|
-
```javascript
|
|
79
|
-
/*
|
|
80
|
-
Author: {{author}} <{{email}}>
|
|
81
|
-
File: {{file}}
|
|
82
|
-
Created: {{date}}
|
|
83
|
-
*/
|
|
84
|
-
|
|
85
|
-
function main() {
|
|
86
|
-
|
|
87
|
-
}
|
|
48
|
+
```shell
|
|
49
|
+
npm create rock-app
|
|
88
50
|
```
|
|
89
51
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
rock myproj -r /path/to/my/rock/repo
|
|
93
|
-
|
|
94
|
-
Rock will prompt:
|
|
95
|
-
|
|
96
|
-
author: [YOU_TYPE_YOUR_NAME_HERE]
|
|
97
|
-
email: [YOU_TYPE_YOUR_EMAIL_HERE]
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
Rock, then will create the file structure of your new project with the values of your template tokens replaced with what you typed. Rock already understands `file`, `date`, and few others.
|
|
52
|
+
### Creating a new project
|
|
101
53
|
|
|
102
|
-
|
|
54
|
+
To create a fresh React Native app with Rock, open a terminal and run:
|
|
103
55
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
```json
|
|
107
|
-
{
|
|
108
|
-
"ignoreDirs": ["./dirToIgnore"]
|
|
109
|
-
}
|
|
56
|
+
```shell
|
|
57
|
+
npm create rock-app
|
|
110
58
|
```
|
|
111
59
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
### Open / Close Templates
|
|
60
|
+
### Adding to an existing native project
|
|
116
61
|
|
|
117
|
-
|
|
62
|
+
To add React Native to an existing iOS or Android app with Rock, use our Brownfield plugins:
|
|
118
63
|
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
64
|
+
```shell
|
|
65
|
+
npm create rock-app
|
|
66
|
+
# ...
|
|
67
|
+
◆ What plugins do you want to start with?
|
|
68
|
+
│ ◼ brownfield-ios
|
|
69
|
+
│ ◼ brownfield-android
|
|
126
70
|
```
|
|
127
71
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
Single File Rocks
|
|
133
|
-
-----------------
|
|
134
|
-
|
|
135
|
-
Rock doesn't need to be used with just whole repos. It can be used with individual files as well.
|
|
136
|
-
|
|
137
|
-
**Example:**
|
|
138
|
-
|
|
139
|
-
**http://localhost/data.txt**:
|
|
140
|
-
```
|
|
141
|
-
Hi, @@author@@ is going to build:
|
|
142
|
-
@@project-name@@.
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
command:
|
|
146
|
-
|
|
147
|
-
rock /tmp/outputfile.txt -f --topen '@@' --tclose '@@' -r http://localhost/data.txt
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
prompts:
|
|
151
|
-
|
|
152
|
-
```
|
|
153
|
-
author: JP
|
|
154
|
-
project-name: Rock
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
output:
|
|
158
|
-
|
|
159
|
-
**/tmp/outputfile.txt**:
|
|
160
|
-
```
|
|
161
|
-
Hi, JP is going to build:
|
|
162
|
-
Rock
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
rock.conf.json
|
|
168
|
-
--------------
|
|
169
|
-
|
|
170
|
-
This file defaults to `~/.rock/rock.conf.json`. You can set default values (prompt or skip).
|
|
171
|
-
|
|
172
|
-
```json
|
|
173
|
-
{
|
|
174
|
-
"templateValues": {
|
|
175
|
-
"author": "JP Richardson"
|
|
176
|
-
},
|
|
177
|
-
"defaultValues": {
|
|
178
|
-
"email": "jprichardson@gmail.com"
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
So, if you were to run:
|
|
184
|
-
|
|
185
|
-
rock myapp -r rocktemplates/node-bin
|
|
186
|
-
|
|
187
|
-
it would not prompt you for `author` and it would prompt you for `email` but with a default of `jprichardson@gmail.com`.
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
Rocks
|
|
192
|
-
------
|
|
193
|
-
|
|
194
|
-
See more rocks at: https://github.com/rocktemplates or browse 3rd party Rocks here: https://github.com/rocktemplates/rock/wiki/rocks
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
[1]: https://github.com/rocktemplates
|
|
198
|
-
[2]: http://nodejs.org/dist/latest/
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
Roadmap to v1.0.0
|
|
203
|
-
------------------
|
|
204
|
-
|
|
205
|
-
- Will probably change configuration from JSON to [TOML](https://github.com/mojombo/toml). TOML needs to
|
|
206
|
-
achieve stability first.
|
|
207
|
-
- Create/fork site similar to [component.io](http://component.io/)
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
Contributors
|
|
211
|
-
------------
|
|
212
|
-
|
|
213
|
-
- (*) [JP Richardson](http://github.com/jprichardson)
|
|
214
|
-
- (1) [Tayler Summers](https://github.com/taylers)
|
|
215
|
-
|
|
72
|
+
For detailed instructions, please follow our [Integrating with Native Apps](https://rockjs.dev/docs/brownfield/intro) documentation.
|
|
216
73
|
|
|
217
|
-
|
|
218
|
-
-------
|
|
74
|
+
## Documentation
|
|
219
75
|
|
|
220
|
-
(
|
|
76
|
+
Visit [rockjs.dev](https://rockjs.dev) to learn more about the framework, why we created it, how it can be useful to you, and how to use it in more advanced scenarios.
|
|
221
77
|
|
|
222
|
-
|
|
78
|
+
## Contributing
|
|
223
79
|
|
|
80
|
+
Read our [contributing guidelines](CONTRIBUTING.md) to learn how you can contribute with bug reports, documentation, and code.
|
|
224
81
|
|
|
225
|
-
|
|
226
|
-
[twitter]: http://twitter.com/jprichardson
|
|
227
|
-
[procbits]: http://procbits.com
|
|
228
|
-
[gitpilot]: http://gitpilot.com
|
|
82
|
+
## Made with ❤️ at Callstack
|
|
229
83
|
|
|
84
|
+
Rock is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Callstack](https://www.callstack.com/?utm_source=github.com&utm_medium=referral&utm_campaign=rock&utm_term=readme-with-love) is a group of React and React Native geeks. Contact us at [hello@callstack.com](mailto:hello@callstack.com) if you need any help with these technologies or just want to say hi!
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/bin.ts"],"names":[],"mappings":""}
|
package/dist/src/bin.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../src/bin.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,GAAG,CAAC;IACF,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;CACnB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function templateIndexHtml({ appName, version, bundleIdentifier, }: {
|
|
2
|
+
appName: string;
|
|
3
|
+
version: string;
|
|
4
|
+
bundleIdentifier: string;
|
|
5
|
+
}): string;
|
|
6
|
+
export declare function templateManifestPlist({ baseUrl, ipaName, bundleIdentifier, version, appName, platformIdentifier, }: {
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
ipaName: string;
|
|
9
|
+
bundleIdentifier: string;
|
|
10
|
+
version: string;
|
|
11
|
+
appName: string;
|
|
12
|
+
platformIdentifier: string;
|
|
13
|
+
}): string;
|