rock 0.4.0 → 0.9.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/README.md +51 -182
- 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 -50
- package/.npmignore +0 -1
- package/.travis.yml +0 -4
- package/CHANGELOG.md +0 -61
- package/LICENSE +0 -15
- package/bin/rock +0 -43
- package/docs/predefined-tokens.md +0 -31
- package/lib/rock.js +0 -213
- package/lib/tweezers.js +0 -37
- package/lib/util.js +0 -9
- package/test/mocha.opts +0 -3
- package/test/resources/expect/myapp/LICENSE +0 -15
- package/test/resources/expect/myapp/README.md +0 -17
- 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/date.txt +0 -1
- package/test/resources/rocks/literal-alt.txt +0 -1
- package/test/resources/rocks/literal.txt +0 -1
- 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 -17
- 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 -17
- 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 -73
- package/test/rock-dload-github.test.js +0 -41
- package/test/rock-file.test.js +0 -47
- package/test/rock.predefined-locals.js +0 -52
- package/test/rock.test.js +0 -78
package/README.md
CHANGED
|
@@ -1,215 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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>
|
|
3
9
|
|
|
4
|
-
|
|
10
|
+
---
|
|
5
11
|
|
|
12
|
+
## React Native at scale is challenging
|
|
6
13
|
|
|
7
|
-
|
|
8
|
-
----
|
|
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.
|
|
9
15
|
|
|
10
|
-
|
|
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.
|
|
11
17
|
|
|
12
|
-
|
|
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.
|
|
13
19
|
|
|
14
|
-
|
|
20
|
+
## Features
|
|
15
21
|
|
|
22
|
+
**🖥️ Brand New CLI**
|
|
23
|
+
A familiar CLI experience with end-to-end development and build workflows. Migrate in just 10 minutes.
|
|
16
24
|
|
|
17
|
-
|
|
18
|
-
|
|
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.
|
|
19
27
|
|
|
20
|
-
|
|
28
|
+
**🔧 GitHub Actions**
|
|
29
|
+
Complete logic for downloading, uploading, and building native artifacts for iOS (APP, IPA) and Android (APK, AAB).
|
|
21
30
|
|
|
22
|
-
|
|
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.
|
|
23
33
|
|
|
24
|
-
|
|
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.
|
|
25
36
|
|
|
26
|
-
|
|
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.
|
|
27
39
|
|
|
40
|
+
## Installation
|
|
28
41
|
|
|
29
|
-
|
|
30
|
-
-----
|
|
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.
|
|
31
43
|
|
|
32
|
-
|
|
44
|
+
### Migrating an existing Community CLI project
|
|
33
45
|
|
|
34
|
-
|
|
46
|
+
To migrate an existing project, open a terminal in your project root and run:
|
|
35
47
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
or
|
|
39
|
-
|
|
40
|
-
rock /tmp/mylib -r node-lib
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
### Options
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
--version Print version and exit.
|
|
47
|
-
-r ROCK, --rock ROCK The rock path or Github repo.
|
|
48
|
-
-c, --config The config file. Defaults to ~/.rock/rock.conf.json
|
|
49
|
-
-f, --file If the rock is a single file. Supports http as well. [false]
|
|
50
|
-
--topen Opening template value. Defaults to {{ [{{]
|
|
51
|
-
--tclose Closing template value. Defaults to }} [}}]
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
Want to create a project from a rock hosted somewhere else? No problem:
|
|
56
|
-
|
|
57
|
-
rock myapp -r git@github.com:johndoe/myrepo.git
|
|
58
|
-
|
|
59
|
-
or use Github shorthand:
|
|
60
|
-
|
|
61
|
-
rock myapp -r johndoe/myrepo
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
Make Your Own Rocks
|
|
65
|
-
-------------------
|
|
66
|
-
|
|
67
|
-
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.
|
|
68
|
-
|
|
69
|
-
Example (myproject.js):
|
|
70
|
-
|
|
71
|
-
```javascript
|
|
72
|
-
/*
|
|
73
|
-
Author: {{author}} <{{email}}>
|
|
74
|
-
File: {{-file}}
|
|
75
|
-
Created: {{-date}}
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
function main() {
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Now, when you run:
|
|
84
|
-
|
|
85
|
-
rock myproj -r /path/to/my/rock/repo
|
|
86
|
-
|
|
87
|
-
Rock will prompt:
|
|
88
|
-
|
|
89
|
-
author: [YOU_TYPE_YOUR_NAME_HERE]
|
|
90
|
-
email: [YOU_TYPE_YOUR_EMAIL_HERE]
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
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 a few others.
|
|
94
|
-
|
|
95
|
-
### Ignore Directories
|
|
96
|
-
|
|
97
|
-
In your rock repo, add a file `.rock/rock.json`. Add the following:
|
|
98
|
-
|
|
99
|
-
```json
|
|
100
|
-
{
|
|
101
|
-
"ignoreDirs": ["./dirToIgnore"]
|
|
102
|
-
}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Why would you do this? Let's say that you're calling rock programmatically and you don't want rock to prompt you for any tokens because you are going to use Mustache/Hogan/Handlebars in your own code.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
### Open / Close Templates
|
|
109
|
-
|
|
110
|
-
If you don't want to use the default `{{` and `}}` and want to use something else, you can configure this behavior for your Rock in `.rock/rock.json`:
|
|
111
|
-
|
|
112
|
-
```json
|
|
113
|
-
{
|
|
114
|
-
"tokens": {
|
|
115
|
-
"open": "#{",
|
|
116
|
-
"close": "}"
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
You may want to do this if you generate files that actually use Mustache templates.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
Single File Rocks
|
|
125
|
-
-----------------
|
|
126
|
-
|
|
127
|
-
Rock doesn't need to be used with just whole repos. It can be used with individual files as well.
|
|
128
|
-
|
|
129
|
-
**Example:**
|
|
130
|
-
|
|
131
|
-
**http://localhost/data.txt**:
|
|
48
|
+
```shell
|
|
49
|
+
npm create rock-app
|
|
132
50
|
```
|
|
133
|
-
Hi, @@author@@ is going to build:
|
|
134
|
-
@@project-name@@.
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
command:
|
|
138
51
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
prompts:
|
|
143
|
-
|
|
144
|
-
```
|
|
145
|
-
author: JP
|
|
146
|
-
project-name: Rock
|
|
147
|
-
```
|
|
52
|
+
### Creating a new project
|
|
148
53
|
|
|
149
|
-
|
|
54
|
+
To create a fresh React Native app with Rock, open a terminal and run:
|
|
150
55
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
Hi, JP is going to build:
|
|
154
|
-
Rock
|
|
56
|
+
```shell
|
|
57
|
+
npm create rock-app
|
|
155
58
|
```
|
|
156
59
|
|
|
60
|
+
### Adding to an existing native project
|
|
157
61
|
|
|
62
|
+
To add React Native to an existing iOS or Android app with Rock, use our Brownfield plugins:
|
|
158
63
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
{
|
|
166
|
-
"templateValues": {
|
|
167
|
-
"author": "JP Richardson"
|
|
168
|
-
},
|
|
169
|
-
"defaultValues": {
|
|
170
|
-
"email": "jprichardson@gmail.com"
|
|
171
|
-
}
|
|
172
|
-
}
|
|
64
|
+
```shell
|
|
65
|
+
npm create rock-app
|
|
66
|
+
# ...
|
|
67
|
+
◆ What plugins do you want to start with?
|
|
68
|
+
│ ◼ brownfield-ios
|
|
69
|
+
│ ◼ brownfield-android
|
|
173
70
|
```
|
|
174
71
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
rock myapp -r rocktemplates/node-bin
|
|
178
|
-
|
|
179
|
-
it would not prompt you for `author` and it would prompt you for `email` but with a default of `jprichardson@gmail.com`.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
Rocks
|
|
184
|
-
------
|
|
185
|
-
|
|
186
|
-
See more rocks at: https://github.com/rocktemplates or browse 3rd party Rocks here: https://github.com/rocktemplates/rock/wiki/rocks
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
Roadmap to v1.0.0
|
|
190
|
-
------------------
|
|
191
|
-
|
|
192
|
-
- Will probably change configuration from JSON to [TOML](https://github.com/mojombo/toml). TOML needs to
|
|
193
|
-
achieve stability first.
|
|
194
|
-
- Create/fork site similar to [component.io](http://component.io/)
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
Contributors
|
|
198
|
-
------------
|
|
199
|
-
|
|
200
|
-
- (*) [JP Richardson](http://github.com/jprichardson)
|
|
201
|
-
- (1) [Tayler Summers](https://github.com/taylers)
|
|
72
|
+
For detailed instructions, please follow our [Integrating with Native Apps](https://rockjs.dev/docs/brownfield/intro) documentation.
|
|
202
73
|
|
|
74
|
+
## Documentation
|
|
203
75
|
|
|
204
|
-
|
|
205
|
-
-------
|
|
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.
|
|
206
77
|
|
|
207
|
-
|
|
78
|
+
## Contributing
|
|
208
79
|
|
|
209
|
-
|
|
80
|
+
Read our [contributing guidelines](CONTRIBUTING.md) to learn how you can contribute with bug reports, documentation, and code.
|
|
210
81
|
|
|
82
|
+
## Made with ❤️ at Callstack
|
|
211
83
|
|
|
212
|
-
[
|
|
213
|
-
[twitter]: http://twitter.com/jprichardson
|
|
214
|
-
[procbits]: http://procbits.com
|
|
215
|
-
[gitpilot]: http://gitpilot.com
|
|
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;
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
// Template functions for ad-hoc iOS distribution
|
|
2
|
+
export function templateIndexHtml({ appName, version, bundleIdentifier, }) {
|
|
3
|
+
return `<!DOCTYPE html>
|
|
4
|
+
<html lang="en">
|
|
5
|
+
<head>
|
|
6
|
+
<meta charset="UTF-8" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
+
<title>Download ${appName} for iOS</title>
|
|
9
|
+
<style>
|
|
10
|
+
:root {
|
|
11
|
+
/* Light mode variables */
|
|
12
|
+
--bg-primary: #ffffff;
|
|
13
|
+
--bg-secondary: #f5f5f7;
|
|
14
|
+
--text-primary: #1d1d1f;
|
|
15
|
+
--text-secondary: #86868b;
|
|
16
|
+
--accent-primary: #8232ff;
|
|
17
|
+
--accent-hover: rgba(130, 50, 255, 0.3);
|
|
18
|
+
--border-color: #e5e5e7;
|
|
19
|
+
--shadow-color: rgba(0, 0, 0, 0.1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@media (prefers-color-scheme: dark) {
|
|
23
|
+
:root {
|
|
24
|
+
/* Dark mode variables */
|
|
25
|
+
--bg-primary: #1c1c1e;
|
|
26
|
+
--bg-secondary: #2c2c2e;
|
|
27
|
+
--text-primary: #ffffff;
|
|
28
|
+
--text-secondary: #8e8e93;
|
|
29
|
+
--accent-primary: #8232ff;
|
|
30
|
+
--accent-hover: rgba(130, 50, 255, 0.4);
|
|
31
|
+
--border-color: #38383a;
|
|
32
|
+
--shadow-color: rgba(0, 0, 0, 0.3);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
* {
|
|
37
|
+
margin: 0;
|
|
38
|
+
padding: 0;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
body {
|
|
43
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
44
|
+
Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
45
|
+
min-height: 100vh;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
padding: 20px;
|
|
50
|
+
font-size: 16px;
|
|
51
|
+
background-color: var(--bg-primary);
|
|
52
|
+
color: var(--text-primary);
|
|
53
|
+
transition: background-color 0.3s ease, color 0.3s ease;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.container {
|
|
57
|
+
text-align: center;
|
|
58
|
+
max-width: 500px;
|
|
59
|
+
width: 100%;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.app-icon {
|
|
63
|
+
width: 100px;
|
|
64
|
+
height: 100px;
|
|
65
|
+
margin: 0 auto 15px;
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
font-size: 48px;
|
|
70
|
+
color: var(--text-primary);
|
|
71
|
+
background: var(--bg-secondary);
|
|
72
|
+
border-radius: 25px;
|
|
73
|
+
transition: background-color 0.3s ease;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
h1 {
|
|
77
|
+
color: var(--text-primary);
|
|
78
|
+
font-size: 28px;
|
|
79
|
+
font-weight: 600;
|
|
80
|
+
margin-bottom: 15px;
|
|
81
|
+
overflow-wrap: break-word;
|
|
82
|
+
transition: color 0.3s ease;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.subtitle {
|
|
86
|
+
color: var(--text-secondary);
|
|
87
|
+
font-size: 16px;
|
|
88
|
+
line-height: 1.5;
|
|
89
|
+
margin-bottom: 30px;
|
|
90
|
+
transition: color 0.3s ease;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.version {
|
|
94
|
+
color: var(--text-primary);
|
|
95
|
+
font-size: 16px;
|
|
96
|
+
line-height: 1.5;
|
|
97
|
+
margin-bottom: 10px;
|
|
98
|
+
transition: color 0.3s ease;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.download-button {
|
|
102
|
+
background: var(--accent-primary);
|
|
103
|
+
color: white;
|
|
104
|
+
border: none;
|
|
105
|
+
padding: 16px 32px;
|
|
106
|
+
border-radius: 4px;
|
|
107
|
+
font-size: 14px;
|
|
108
|
+
font-weight: 600;
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
transition: all 0.3s ease;
|
|
111
|
+
text-decoration: none;
|
|
112
|
+
display: inline-block;
|
|
113
|
+
margin-bottom: 20px;
|
|
114
|
+
box-shadow: 0 4px 12px var(--shadow-color);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.download-button:hover {
|
|
118
|
+
transform: translateY(-2px);
|
|
119
|
+
box-shadow: 0 8px 24px var(--accent-hover);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.download-button:active {
|
|
123
|
+
transform: translateY(0);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.instructions {
|
|
127
|
+
background: var(--bg-secondary);
|
|
128
|
+
border-radius: 4px;
|
|
129
|
+
padding: 20px;
|
|
130
|
+
margin-top: 20px;
|
|
131
|
+
text-align: left;
|
|
132
|
+
border: 1px solid var(--border-color);
|
|
133
|
+
transition: background-color 0.3s ease, border-color 0.3s ease;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.instructions h3 {
|
|
137
|
+
color: var(--text-primary);
|
|
138
|
+
font-size: 16px;
|
|
139
|
+
margin-bottom: 10px;
|
|
140
|
+
transition: color 0.3s ease;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.instructions ol {
|
|
144
|
+
color: var(--text-secondary);
|
|
145
|
+
font-size: 14px;
|
|
146
|
+
line-height: 1.6;
|
|
147
|
+
padding-left: 20px;
|
|
148
|
+
transition: color 0.3s ease;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.instructions li {
|
|
152
|
+
margin-bottom: 8px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.adhoc-info {
|
|
156
|
+
text-align: left;
|
|
157
|
+
margin-top: 20px;
|
|
158
|
+
padding: 1em 2em;
|
|
159
|
+
border-left: 3px solid var(--accent-primary);
|
|
160
|
+
background: var(--bg-primary);
|
|
161
|
+
border-radius: 4px;
|
|
162
|
+
transition: background-color 0.3s ease;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.adhoc-info-title {
|
|
166
|
+
font-weight: 600;
|
|
167
|
+
margin-bottom: 10px;
|
|
168
|
+
color: var(--text-primary);
|
|
169
|
+
transition: color 0.3s ease;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.adhoc-info-text {
|
|
173
|
+
color: var(--text-primary);
|
|
174
|
+
margin: 0;
|
|
175
|
+
transition: color 0.3s ease;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.footer {
|
|
179
|
+
text-align: center;
|
|
180
|
+
margin-top: 40px;
|
|
181
|
+
font-size: 12px;
|
|
182
|
+
color: var(--text-secondary);
|
|
183
|
+
transition: color 0.3s ease;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.link {
|
|
187
|
+
color: var(--accent-primary);
|
|
188
|
+
text-decoration: none;
|
|
189
|
+
transition: color 0.3s ease;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.link:hover {
|
|
193
|
+
text-decoration: underline;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.toast {
|
|
197
|
+
padding: 1em 3em;
|
|
198
|
+
font-size: 14px;
|
|
199
|
+
border: 1px solid var(--accent-primary);
|
|
200
|
+
color: var(--text-primary);
|
|
201
|
+
position: fixed;
|
|
202
|
+
bottom: 1em;
|
|
203
|
+
left: 50%;
|
|
204
|
+
transform: translateX(-50%);
|
|
205
|
+
max-width: 500px;
|
|
206
|
+
width: calc(100% - 2em);
|
|
207
|
+
text-align: left;
|
|
208
|
+
border-radius: 4px;
|
|
209
|
+
background-color: var(--bg-primary);
|
|
210
|
+
display: none;
|
|
211
|
+
box-shadow: 0 8px 24px var(--shadow-color);
|
|
212
|
+
transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.toast-visible {
|
|
216
|
+
display: block;
|
|
217
|
+
animation: slideUp 0.3s ease;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@keyframes slideUp {
|
|
221
|
+
from {
|
|
222
|
+
opacity: 0;
|
|
223
|
+
transform: translateX(-50%) translateY(20px);
|
|
224
|
+
}
|
|
225
|
+
to {
|
|
226
|
+
opacity: 1;
|
|
227
|
+
transform: translateX(-50%) translateY(0);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.toast-icon {
|
|
232
|
+
font-size: 1em;
|
|
233
|
+
position: absolute;
|
|
234
|
+
left: 1em;
|
|
235
|
+
top: 50%;
|
|
236
|
+
transform: translateY(-50%);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.toast-close {
|
|
240
|
+
font-size: 1em;
|
|
241
|
+
padding: 0.5em;
|
|
242
|
+
cursor: pointer;
|
|
243
|
+
position: absolute;
|
|
244
|
+
right: 1em;
|
|
245
|
+
top: 50%;
|
|
246
|
+
transform: translateY(-50%);
|
|
247
|
+
color: var(--text-secondary);
|
|
248
|
+
transition: color 0.3s ease;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.toast-close:hover {
|
|
252
|
+
color: var(--text-primary);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* Smooth transitions for all elements */
|
|
256
|
+
* {
|
|
257
|
+
transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
|
|
258
|
+
}
|
|
259
|
+
</style>
|
|
260
|
+
</head>
|
|
261
|
+
<body>
|
|
262
|
+
<div class="container">
|
|
263
|
+
<div class="app-icon">📱</div>
|
|
264
|
+
|
|
265
|
+
<div id="home-screen-toast" class="toast">
|
|
266
|
+
<span class="toast-icon">💡</span>
|
|
267
|
+
<p>Check Home Screen to see installation progress</p>
|
|
268
|
+
<span class="toast-close" onclick="hideToast()">✕</span>
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
<h1>${appName}</h1>
|
|
272
|
+
<p class="version">${bundleIdentifier} (${version})</p>
|
|
273
|
+
<p class="subtitle">
|
|
274
|
+
Download and install the latest version of our iOS app directly to your
|
|
275
|
+
device.
|
|
276
|
+
</p>
|
|
277
|
+
|
|
278
|
+
<a href="#" id="install-link" class="download-button" onclick="showToast()">
|
|
279
|
+
Install App
|
|
280
|
+
</a>
|
|
281
|
+
|
|
282
|
+
<script>
|
|
283
|
+
// Update the link dynamically to point to the manifest.plist
|
|
284
|
+
const link = document.getElementById('install-link');
|
|
285
|
+
const currentUrl = window.location.href;
|
|
286
|
+
const manifestUrl = currentUrl.replace('index.html', 'manifest.plist');
|
|
287
|
+
link.href = \`itms-services://?action=download-manifest&url=\${encodeURIComponent(manifestUrl)}\`;
|
|
288
|
+
|
|
289
|
+
function showToast() {
|
|
290
|
+
setTimeout(() => {
|
|
291
|
+
const toast = document.getElementById('home-screen-toast');
|
|
292
|
+
toast.classList.add('toast-visible');
|
|
293
|
+
}, 2000);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function hideToast() {
|
|
297
|
+
const toast = document.getElementById('home-screen-toast');
|
|
298
|
+
toast.classList.remove('toast-visible');
|
|
299
|
+
}
|
|
300
|
+
</script>
|
|
301
|
+
|
|
302
|
+
<div class="instructions">
|
|
303
|
+
<h3>Installation Instructions:</h3>
|
|
304
|
+
<ol>
|
|
305
|
+
<li>Tap the "Install App" button above</li>
|
|
306
|
+
<li>When prompted, tap "Install" in the popup dialog</li>
|
|
307
|
+
<li>The app will now start installing and will be available on your home screen</li>
|
|
308
|
+
</ol>
|
|
309
|
+
</div>
|
|
310
|
+
|
|
311
|
+
<div class="adhoc-info">
|
|
312
|
+
<p class="adhoc-info-title">Ad-hoc Distribution</p>
|
|
313
|
+
<p class="adhoc-info-text">
|
|
314
|
+
This app is distributed via ad-hoc distribution for testing purposes.
|
|
315
|
+
Your device must either be enrolled in enterprise distribution or have its UDID added to the app's provisioning profile.
|
|
316
|
+
<br><br>
|
|
317
|
+
Learn more at <a class="link" href="https://rockjs.dev/docs/cli#ad-hoc-distribution">Rock Ad-hoc documentation</a>.
|
|
318
|
+
</p>
|
|
319
|
+
</div>
|
|
320
|
+
<div class="footer">
|
|
321
|
+
<p>
|
|
322
|
+
Generated with <a class="link" href="https://rockjs.dev">Rock</a> by
|
|
323
|
+
<a class="link" href="https://callstack.com">Callstack</a>
|
|
324
|
+
</p>
|
|
325
|
+
</div>
|
|
326
|
+
</div>
|
|
327
|
+
</body>
|
|
328
|
+
</html>
|
|
329
|
+
`;
|
|
330
|
+
}
|
|
331
|
+
export function templateManifestPlist({ baseUrl, ipaName, bundleIdentifier, version, appName, platformIdentifier, }) {
|
|
332
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
333
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
334
|
+
<plist version="1.0">
|
|
335
|
+
<dict>
|
|
336
|
+
<key>items</key>
|
|
337
|
+
<array>
|
|
338
|
+
<dict>
|
|
339
|
+
<key>assets</key>
|
|
340
|
+
<array>
|
|
341
|
+
<dict>
|
|
342
|
+
<key>kind</key>
|
|
343
|
+
<string>software-package</string>
|
|
344
|
+
<key>url</key>
|
|
345
|
+
<string>${baseUrl}/${ipaName}</string>
|
|
346
|
+
</dict>
|
|
347
|
+
</array>
|
|
348
|
+
<key>metadata</key>
|
|
349
|
+
<dict>
|
|
350
|
+
<key>bundle-identifier</key>
|
|
351
|
+
<string>${bundleIdentifier}</string>
|
|
352
|
+
<key>bundle-version</key>
|
|
353
|
+
<string>${version}</string>
|
|
354
|
+
<key>kind</key>
|
|
355
|
+
<string>software</string>
|
|
356
|
+
<key>platform-identifier</key>
|
|
357
|
+
<string>${platformIdentifier ?? 'com.apple.platform.iphoneos'}</string>
|
|
358
|
+
<key>title</key>
|
|
359
|
+
<string>${appName}</string>
|
|
360
|
+
</dict>
|
|
361
|
+
</dict>
|
|
362
|
+
</array>
|
|
363
|
+
</dict>
|
|
364
|
+
</plist>`;
|
|
365
|
+
}
|
|
366
|
+
//# sourceMappingURL=adHocTemplates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adHocTemplates.js","sourceRoot":"","sources":["../../../src/lib/adHocTemplates.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,UAAU,iBAAiB,CAAC,EAChC,OAAO,EACP,OAAO,EACP,gBAAgB,GAKjB;IACC,OAAO;;;;;wBAKe,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuQjB,OAAO;6BACQ,gBAAgB,KAAK,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDtD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,EACpC,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,kBAAkB,GAQnB;IACC,OAAO;;;;;;;;;;;;;gCAauB,OAAO,IAAI,OAAO;;;;;;4BAMtB,gBAAgB;;4BAEhB,OAAO;;;;4BAKf,kBAAkB,IAAI,6BACxB;;4BAEU,OAAO;;;;;aAKtB,CAAC;AACd,CAAC"}
|