@ahmedsamirelsaka/react-native-local-release 2.0.0-rc.1
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/CHANGELOG.md +33 -0
- package/CREDENTIALS.md +79 -0
- package/LICENSE +21 -0
- package/README.md +112 -0
- package/SECURITY.md +44 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +326 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +27 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +229 -0
- package/dist/config.js.map +1 -0
- package/dist/credentials.d.ts +27 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +317 -0
- package/dist/credentials.js.map +1 -0
- package/dist/detect.d.ts +7 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/detect.js +326 -0
- package/dist/detect.js.map +1 -0
- package/dist/fs.d.ts +15 -0
- package/dist/fs.d.ts.map +1 -0
- package/dist/fs.js +79 -0
- package/dist/fs.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/install.d.ts +5 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +338 -0
- package/dist/install.js.map +1 -0
- package/dist/logging.d.ts +15 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/logging.js +84 -0
- package/dist/logging.js.map +1 -0
- package/dist/patch.d.ts +39 -0
- package/dist/patch.d.ts.map +1 -0
- package/dist/patch.js +352 -0
- package/dist/patch.js.map +1 -0
- package/dist/paths.d.ts +14 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +65 -0
- package/dist/paths.js.map +1 -0
- package/dist/process.d.ts +26 -0
- package/dist/process.d.ts.map +1 -0
- package/dist/process.js +43 -0
- package/dist/process.js.map +1 -0
- package/dist/prompt.d.ts +9 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +70 -0
- package/dist/prompt.js.map +1 -0
- package/dist/types.d.ts +153 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/docs/ARCHITECTURE.md +25 -0
- package/docs/MIGRATION.md +28 -0
- package/docs/PUBLISHING.md +128 -0
- package/docs/SUPPORT.md +17 -0
- package/install.mjs +6 -0
- package/package.json +73 -0
- package/schema/release.config.schema.json +209 -0
- package/template/android/keystore.properties.example +7 -0
- package/template/android/proguard-rules.rn-local-release.pro +28 -0
- package/template/docs/LOCAL_RELEASE.md +85 -0
- package/template/fastlane/.env.example +20 -0
- package/template/fastlane/Appfile +10 -0
- package/template/fastlane/Fastfile +203 -0
- package/template/fastlane/lib/rn_local_release.rb +700 -0
- package/template/ios/exportOptions.plist +18 -0
- package/template/scripts/print-android-signing-fingerprints.sh +62 -0
- package/template/secrets/.gitignore +3 -0
- package/template/secrets/README.md +12 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 2.0.0-rc.1
|
|
4
|
+
|
|
5
|
+
Security-first rewrite for bare React Native apps (release candidate).
|
|
6
|
+
|
|
7
|
+
### Breaking
|
|
8
|
+
- CLI rewritten in TypeScript (`rn-local-release <command>`). Publish target is npmjs with provenance.
|
|
9
|
+
- `release.config.json` schema version 2 (credentials/logging/archives/platform DSL fields).
|
|
10
|
+
- Install no longer forces `reactNativeArchitectures` or `android.enableR8.fullMode`.
|
|
11
|
+
- Verify/build commands are argv-allowlisted (no shell metacharacters).
|
|
12
|
+
- Production promote requires `RN_LOCAL_RELEASE_YES=1` (or CI).
|
|
13
|
+
- Default credential provider on macOS is Keychain + vault (not plaintext `.env` passwords).
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- Commands: `install`, `configure`, `doctor`, `verify`, `build`, `upload`, `beta`, `promote`, `migrate`, `uninstall`, `audit`.
|
|
17
|
+
- Transactional install with `.rn-local-release/manifest.json` and safe uninstall.
|
|
18
|
+
- Groovy **and** Kotlin DSL Android adapters.
|
|
19
|
+
- Platform-specific release manifests + resumable upload journal.
|
|
20
|
+
- Crash/issue logs under `logs/` (redacted).
|
|
21
|
+
- Optional `versions/` archive of uploaded IPA/AAB (asked during install).
|
|
22
|
+
- Hidden password prompts, `0600`/`0700` secret files, credential audit.
|
|
23
|
+
- CI: SHA-pinned actions, npm provenance publish workflow, Dependabot.
|
|
24
|
+
|
|
25
|
+
### Migration
|
|
26
|
+
1. Install `2.0.0-rc.1` from npm (`npm tag next` once published).
|
|
27
|
+
2. Run `rn-local-release migrate --project .` (or reinstall; existing config is merged).
|
|
28
|
+
3. Prefer Keychain credentials: `rn-local-release configure --project .`
|
|
29
|
+
4. Confirm `.gitignore` includes `logs/`, `versions/`, and the marked credential block.
|
|
30
|
+
|
|
31
|
+
## 1.1.x
|
|
32
|
+
|
|
33
|
+
Initial interactive Fastlane toolkit published to GitHub Packages.
|
package/CREDENTIALS.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Credentials guide (v2)
|
|
2
|
+
|
|
3
|
+
This toolkit stores **references** in the repo and keeps secret material out of Git.
|
|
4
|
+
|
|
5
|
+
## Providers
|
|
6
|
+
|
|
7
|
+
### 1. Keychain + vault (default on macOS)
|
|
8
|
+
|
|
9
|
+
- Scalar secrets (ASC key id, issuer id, keystore passwords) → macOS Keychain service `rn-local-release:<project-folder>`
|
|
10
|
+
- File material (`.p8`, Play JSON) → `~/.rn-local-release/vault/<project>/` with directory mode `0700` and files `0600`
|
|
11
|
+
- `fastlane/.env` contains **non-secret path references** only (no passwords)
|
|
12
|
+
|
|
13
|
+
### 2. File fallback (explicit)
|
|
14
|
+
|
|
15
|
+
Use when Keychain is unavailable (Linux/Windows) or you opt in during configure.
|
|
16
|
+
|
|
17
|
+
Writes (all `0600`, directories `0700`):
|
|
18
|
+
|
|
19
|
+
- `fastlane/.env`
|
|
20
|
+
- `android/keystore.properties`
|
|
21
|
+
- `secrets/AuthKey_*.p8`
|
|
22
|
+
- `secrets/play-store-service-account.json`
|
|
23
|
+
|
|
24
|
+
These paths are gitignored by the installer marker block. The CLI refuses to write if Git already tracks them.
|
|
25
|
+
|
|
26
|
+
## Least privilege
|
|
27
|
+
|
|
28
|
+
### Apple App Store Connect API
|
|
29
|
+
|
|
30
|
+
Prefer an **App Manager** or custom role limited to the single app — not Account Holder / Admin — with keys scoped to that app.
|
|
31
|
+
|
|
32
|
+
### Google Play
|
|
33
|
+
|
|
34
|
+
Use a dedicated service account with **Release Manager** (or narrower) on one app. Do not reuse organization-wide Owner keys.
|
|
35
|
+
|
|
36
|
+
### Android upload keystore
|
|
37
|
+
|
|
38
|
+
Keep one upload keystore per app. Store the file outside VCS. Rotate only with Google Play App Signing support.
|
|
39
|
+
|
|
40
|
+
## Interactive setup
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
rn-local-release configure --project .
|
|
44
|
+
# or during install (default prompt)
|
|
45
|
+
rn-local-release install --project .
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Passwords are hidden (no echo). Values are never printed back.
|
|
49
|
+
|
|
50
|
+
## Audit
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
rn-local-release audit --project .
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Checks whether credential paths are tracked/ignored.
|
|
57
|
+
|
|
58
|
+
## Rotation / revocation
|
|
59
|
+
|
|
60
|
+
1. Rotate ASC API key in App Store Connect; delete old Keychain entries / vault files.
|
|
61
|
+
2. Rotate Play service-account key in Google Cloud; replace vault/file copy.
|
|
62
|
+
3. Change keystore passwords only if your org policy requires it; update Keychain or `keystore.properties`.
|
|
63
|
+
4. Run `rn-local-release uninstall --project . --purge-credentials --yes` only when intentionally wiping local secrets.
|
|
64
|
+
|
|
65
|
+
## Leak response
|
|
66
|
+
|
|
67
|
+
1. Revoke the exposed key immediately (ASC / Google Cloud / keystore).
|
|
68
|
+
2. Rotate related passwords.
|
|
69
|
+
3. Search git history for the secret; if found, treat the repository as compromised for that credential.
|
|
70
|
+
4. Open a private security advisory if the leak originated from this toolkit.
|
|
71
|
+
|
|
72
|
+
## Permissions checklist
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
chmod 700 secrets ~/.rn-local-release/vault
|
|
76
|
+
chmod 600 fastlane/.env android/keystore.properties secrets/* ~/.rn-local-release/vault/**/*
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Never commit `credentials.txt`, `.p8`, Play JSON, or keystores.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ahmed Samir Elsaka
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# react-native-local-release
|
|
2
|
+
|
|
3
|
+
Security-first local Fastlane release toolkit for **bare** React Native apps (iOS + Android).
|
|
4
|
+
|
|
5
|
+
Package: `@ahmedsamirelsaka/react-native-local-release`
|
|
6
|
+
Version: **2.0.0-rc.1** (GitHub Release ready; npm `next` tag after you add `NPM_TOKEN` — see [docs/PUBLISHING.md](./docs/PUBLISHING.md))
|
|
7
|
+
|
|
8
|
+
## Supported
|
|
9
|
+
|
|
10
|
+
| Area | Support |
|
|
11
|
+
|------|---------|
|
|
12
|
+
| Bare React Native | Yes |
|
|
13
|
+
| Android Groovy DSL | Yes |
|
|
14
|
+
| Android Kotlin DSL (`.kts`) | Yes |
|
|
15
|
+
| npm / Yarn / pnpm | Yes |
|
|
16
|
+
| Common monorepo layouts | Detected; install into the app package root |
|
|
17
|
+
| macOS (iOS + Android) | Yes |
|
|
18
|
+
| Linux/Windows (Android-focused) | Android lanes; iOS requires macOS |
|
|
19
|
+
| Expo managed / EAS | **Not supported** — stop and use Expo tooling |
|
|
20
|
+
|
|
21
|
+
## Quick start (npm)
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# From your React Native app root
|
|
25
|
+
npx @ahmedsamirelsaka/react-native-local-release@2.0.0-rc.1 install --project .
|
|
26
|
+
|
|
27
|
+
# Prefer an exact version in package.json so daily commands do not float:
|
|
28
|
+
# "devDependencies": { "@ahmedsamirelsaka/react-native-local-release": "2.0.0-rc.1" }
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Useful flags:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
--dry-run
|
|
35
|
+
--non-interactive --skip-credentials
|
|
36
|
+
--team-id ABCD123456
|
|
37
|
+
--fixed-ios-build 1
|
|
38
|
+
--store-uploaded-versions # keep IPA/AAB copies under versions/
|
|
39
|
+
--no-store-uploaded-versions
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
During install you will be asked (interactive mode):
|
|
43
|
+
|
|
44
|
+
1. Whether to configure Apple / Play / keystore credentials now
|
|
45
|
+
2. Whether to archive each uploaded build under `versions/`
|
|
46
|
+
|
|
47
|
+
## Commands
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
rn-local-release install --project .
|
|
51
|
+
rn-local-release configure --project . # credentials
|
|
52
|
+
rn-local-release doctor --project .
|
|
53
|
+
rn-local-release audit --project . # credential tracking / ignore checks
|
|
54
|
+
rn-local-release migrate --project .
|
|
55
|
+
rn-local-release uninstall --project . [--purge-credentials] [--yes]
|
|
56
|
+
rn-local-release verify|build|upload|beta|promote --project .
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
After install, app scripts (examples):
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
yarn release:doctor
|
|
63
|
+
yarn release:credentials
|
|
64
|
+
yarn release:compile # typecheck + IPA + AAB, no bump, no upload
|
|
65
|
+
yarn release:upload # upload previous compile (no bump)
|
|
66
|
+
yarn release:beta # bump + compile + upload
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Production promote requires an explicit confirmation env:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
RN_LOCAL_RELEASE_YES=1 yarn release:ios:promote version:1.2.3 build:1
|
|
73
|
+
RN_LOCAL_RELEASE_YES=1 yarn release:android:promote version_code:42
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Security defaults
|
|
77
|
+
|
|
78
|
+
- macOS: **Keychain** for passwords + per-user vault for `.p8` / Play JSON (`~/.rn-local-release/vault`, `0700`/`0600`)
|
|
79
|
+
- Passwords are **never echoed**; secrets are never written to manifests, crash logs, or docs
|
|
80
|
+
- Verify/build commands are **argv-allowlisted** (no `;`, `|`, `$()`, etc.)
|
|
81
|
+
- Install is transactional with rollback; uninstall restores/removes only unchanged managed files
|
|
82
|
+
- Crashes and Fastlane failures write redacted files under `logs/`
|
|
83
|
+
- Optional `versions/` archive of uploaded artifacts (gitignored)
|
|
84
|
+
|
|
85
|
+
See [CREDENTIALS.md](./CREDENTIALS.md) and [SECURITY.md](./SECURITY.md).
|
|
86
|
+
|
|
87
|
+
## Config
|
|
88
|
+
|
|
89
|
+
`fastlane/release.config.json` (schema v2) controls platforms, version sources, gates, credential provider, logging, and archives. Reinstall **merges** detected defaults under your existing config unless you pass `--force` carefully.
|
|
90
|
+
|
|
91
|
+
## Uninstall
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
rn-local-release uninstall --project . --yes
|
|
95
|
+
# Also wipe Keychain/vault material:
|
|
96
|
+
rn-local-release uninstall --project . --yes --purge-credentials
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Limitations
|
|
100
|
+
|
|
101
|
+
- Does not support Expo-managed workflows
|
|
102
|
+
- Does not invent signing identities — you must already have Apple/Google release credentials
|
|
103
|
+
- Does not replace App Store Connect / Play Console review policies
|
|
104
|
+
- Ruby/Fastlane must be installable on the machine (`bundle install`)
|
|
105
|
+
|
|
106
|
+
## Migration from 1.x
|
|
107
|
+
|
|
108
|
+
See [CHANGELOG.md](./CHANGELOG.md). Run `rn-local-release migrate --project .` then `configure`.
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
MIT
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported versions
|
|
4
|
+
|
|
5
|
+
| Version | Supported |
|
|
6
|
+
|---------|-----------|
|
|
7
|
+
| 2.x | Yes |
|
|
8
|
+
| 1.x | Security fixes only until 2026-12-31 |
|
|
9
|
+
|
|
10
|
+
## Reporting a vulnerability
|
|
11
|
+
|
|
12
|
+
Please open a private GitHub Security Advisory on this repository, or email the maintainer via the contact listed on the GitHub profile.
|
|
13
|
+
|
|
14
|
+
Do **not** open a public issue for credential leaks, RCE, or path-traversal reports.
|
|
15
|
+
|
|
16
|
+
Include:
|
|
17
|
+
- Affected version / commit
|
|
18
|
+
- Reproduction steps (without real secrets)
|
|
19
|
+
- Impact assessment
|
|
20
|
+
|
|
21
|
+
We aim to acknowledge reports within 7 days.
|
|
22
|
+
|
|
23
|
+
## Threat model (summary)
|
|
24
|
+
|
|
25
|
+
This toolkit runs on a developer machine and writes Fastlane/Gradle/Xcode release config into an app repository.
|
|
26
|
+
|
|
27
|
+
Trusted:
|
|
28
|
+
- The local developer
|
|
29
|
+
- The target app repository they choose with `--project`
|
|
30
|
+
|
|
31
|
+
Untrusted:
|
|
32
|
+
- Values inside `release.config.json` command fields (must be allowlisted argv)
|
|
33
|
+
- Paths supplied for credentials and version files (must stay within project root or an explicit external vault)
|
|
34
|
+
- Network responses from Apple / Google APIs
|
|
35
|
+
|
|
36
|
+
Secrets must never appear in:
|
|
37
|
+
- git history
|
|
38
|
+
- install manifests
|
|
39
|
+
- crash logs
|
|
40
|
+
- generated docs
|
|
41
|
+
- process argv
|
|
42
|
+
- CI artifacts
|
|
43
|
+
|
|
44
|
+
Default credential storage on macOS is Keychain + per-user vault (`~/.rn-local-release/vault`) with `0700` / `0600` permissions. Plaintext project files are an explicit fallback.
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { createRequire } from 'node:module';
|
|
5
|
+
import { runInstall, runUninstall } from './install.js';
|
|
6
|
+
import { setupCredentialsInteractively, defaultCredentialProvider } from './credentials.js';
|
|
7
|
+
import { createReadline } from './prompt.js';
|
|
8
|
+
import { writeCrashLog } from './logging.js';
|
|
9
|
+
import { loadReleaseConfig, validateReleaseConfig, validateProjectPaths } from './config.js';
|
|
10
|
+
import { detectProject } from './detect.js';
|
|
11
|
+
import { exists } from './fs.js';
|
|
12
|
+
import { materializeKeychainPasswords } from './credentials.js';
|
|
13
|
+
import { runArgv } from './process.js';
|
|
14
|
+
const require = createRequire(import.meta.url);
|
|
15
|
+
const pkg = require('../package.json');
|
|
16
|
+
function printHelp() {
|
|
17
|
+
console.log(`
|
|
18
|
+
${pkg.name} v${pkg.version}
|
|
19
|
+
|
|
20
|
+
Usage:
|
|
21
|
+
rn-local-release <command> [options]
|
|
22
|
+
rn-local-release --project <path> # v1 alias for install
|
|
23
|
+
|
|
24
|
+
Commands:
|
|
25
|
+
install Install/update the local release toolkit
|
|
26
|
+
configure Interactive credential setup
|
|
27
|
+
doctor Detect project health and print summary
|
|
28
|
+
verify Run configured verify commands via Fastlane
|
|
29
|
+
migrate Migrate release.config.json to schema v2
|
|
30
|
+
uninstall Remove managed files (safe restore)
|
|
31
|
+
credentials Alias for configure
|
|
32
|
+
audit Audit credential file permissions / tracking
|
|
33
|
+
help Show this help
|
|
34
|
+
|
|
35
|
+
Options:
|
|
36
|
+
--project <path> Target React Native app root (default: .)
|
|
37
|
+
--dry-run Plan only; write nothing
|
|
38
|
+
--force Overwrite protected managed files
|
|
39
|
+
--yes Confirm destructive actions
|
|
40
|
+
--non-interactive Never prompt
|
|
41
|
+
--setup-credentials Force credential prompts during install
|
|
42
|
+
--skip-credentials Skip credential prompts during install
|
|
43
|
+
--credentials-only Only run credential setup
|
|
44
|
+
--purge-credentials With uninstall, also wipe Keychain/vault
|
|
45
|
+
--team-id <id>
|
|
46
|
+
--package-name <id>
|
|
47
|
+
--bundle-identifier <id>
|
|
48
|
+
--display-name <name>
|
|
49
|
+
--ios-workspace <path>
|
|
50
|
+
--ios-scheme <name>
|
|
51
|
+
--fixed-ios-build <n>
|
|
52
|
+
--store-uploaded-versions Enable versions/ archive
|
|
53
|
+
--no-store-uploaded-versions
|
|
54
|
+
--version
|
|
55
|
+
--help
|
|
56
|
+
`);
|
|
57
|
+
}
|
|
58
|
+
function requireFlagValue(argv, index, flag) {
|
|
59
|
+
const value = argv[index + 1];
|
|
60
|
+
if (!value || value.startsWith('--')) {
|
|
61
|
+
throw new Error(`Missing value for ${flag}`);
|
|
62
|
+
}
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
function parseArgs(argv) {
|
|
66
|
+
const options = {
|
|
67
|
+
command: 'install',
|
|
68
|
+
project: '.',
|
|
69
|
+
dryRun: false,
|
|
70
|
+
nonInteractive: false,
|
|
71
|
+
force: false,
|
|
72
|
+
yes: false,
|
|
73
|
+
setupCredentials: null,
|
|
74
|
+
credentialsOnly: false,
|
|
75
|
+
purgeCredentials: false,
|
|
76
|
+
storeUploadedVersions: null,
|
|
77
|
+
help: false,
|
|
78
|
+
version: false,
|
|
79
|
+
};
|
|
80
|
+
let i = 0;
|
|
81
|
+
// v1 alias: `rn-local-release --project .` means install
|
|
82
|
+
if (argv[0] && !argv[0].startsWith('-')) {
|
|
83
|
+
options.command = argv[0];
|
|
84
|
+
i = 1;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
options.command = 'install';
|
|
88
|
+
}
|
|
89
|
+
for (; i < argv.length; i += 1) {
|
|
90
|
+
const arg = argv[i];
|
|
91
|
+
switch (arg) {
|
|
92
|
+
case '--project':
|
|
93
|
+
options.project = requireFlagValue(argv, i, arg);
|
|
94
|
+
i += 1;
|
|
95
|
+
break;
|
|
96
|
+
case '--dry-run':
|
|
97
|
+
options.dryRun = true;
|
|
98
|
+
break;
|
|
99
|
+
case '--force':
|
|
100
|
+
options.force = true;
|
|
101
|
+
break;
|
|
102
|
+
case '--yes':
|
|
103
|
+
options.yes = true;
|
|
104
|
+
break;
|
|
105
|
+
case '--non-interactive':
|
|
106
|
+
options.nonInteractive = true;
|
|
107
|
+
break;
|
|
108
|
+
case '--setup-credentials':
|
|
109
|
+
options.setupCredentials = true;
|
|
110
|
+
break;
|
|
111
|
+
case '--skip-credentials':
|
|
112
|
+
options.setupCredentials = false;
|
|
113
|
+
break;
|
|
114
|
+
case '--credentials-only':
|
|
115
|
+
options.credentialsOnly = true;
|
|
116
|
+
options.command = 'configure';
|
|
117
|
+
break;
|
|
118
|
+
case '--purge-credentials':
|
|
119
|
+
options.purgeCredentials = true;
|
|
120
|
+
break;
|
|
121
|
+
case '--team-id':
|
|
122
|
+
options.teamId = requireFlagValue(argv, i, arg);
|
|
123
|
+
i += 1;
|
|
124
|
+
break;
|
|
125
|
+
case '--package-name':
|
|
126
|
+
options.packageName = requireFlagValue(argv, i, arg);
|
|
127
|
+
i += 1;
|
|
128
|
+
break;
|
|
129
|
+
case '--bundle-identifier':
|
|
130
|
+
options.bundleIdentifier = requireFlagValue(argv, i, arg);
|
|
131
|
+
i += 1;
|
|
132
|
+
break;
|
|
133
|
+
case '--display-name':
|
|
134
|
+
options.displayName = requireFlagValue(argv, i, arg);
|
|
135
|
+
i += 1;
|
|
136
|
+
break;
|
|
137
|
+
case '--ios-workspace':
|
|
138
|
+
options.iosWorkspace = requireFlagValue(argv, i, arg);
|
|
139
|
+
i += 1;
|
|
140
|
+
break;
|
|
141
|
+
case '--ios-scheme':
|
|
142
|
+
options.iosScheme = requireFlagValue(argv, i, arg);
|
|
143
|
+
i += 1;
|
|
144
|
+
break;
|
|
145
|
+
case '--fixed-ios-build':
|
|
146
|
+
options.fixedIosBuild = requireFlagValue(argv, i, arg);
|
|
147
|
+
i += 1;
|
|
148
|
+
break;
|
|
149
|
+
case '--store-uploaded-versions':
|
|
150
|
+
options.storeUploadedVersions = true;
|
|
151
|
+
break;
|
|
152
|
+
case '--no-store-uploaded-versions':
|
|
153
|
+
options.storeUploadedVersions = false;
|
|
154
|
+
break;
|
|
155
|
+
case '--help':
|
|
156
|
+
case '-h':
|
|
157
|
+
options.help = true;
|
|
158
|
+
break;
|
|
159
|
+
case '--version':
|
|
160
|
+
case '-V':
|
|
161
|
+
options.version = true;
|
|
162
|
+
break;
|
|
163
|
+
default:
|
|
164
|
+
throw new Error(`Unknown argument: ${arg}`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return options;
|
|
168
|
+
}
|
|
169
|
+
async function runDoctor(project) {
|
|
170
|
+
const root = path.resolve(project);
|
|
171
|
+
const detection = detectProject(root);
|
|
172
|
+
console.log('Doctor');
|
|
173
|
+
console.log('------');
|
|
174
|
+
console.log(`Root: ${root}`);
|
|
175
|
+
console.log(`Package manager: ${detection.packageManager}`);
|
|
176
|
+
console.log(`Android: ${detection.android.supported ? detection.android.dsl : detection.android.reason}`);
|
|
177
|
+
console.log(`iOS: ${detection.ios.supported ? `${detection.ios.scheme} / ${detection.ios.teamId}` : detection.ios.reason}`);
|
|
178
|
+
if (exists(path.join(root, 'fastlane', 'release.config.json'))) {
|
|
179
|
+
const { config } = loadReleaseConfig(root);
|
|
180
|
+
const errors = validateReleaseConfig(config);
|
|
181
|
+
const missing = validateProjectPaths(root, config);
|
|
182
|
+
console.log(`Config schema: ${errors.length ? 'INVALID' : 'ok'} (v${config.schemaVersion})`);
|
|
183
|
+
if (errors.length)
|
|
184
|
+
for (const e of errors)
|
|
185
|
+
console.log(` - ${e}`);
|
|
186
|
+
if (missing.length) {
|
|
187
|
+
console.log('Missing paths:');
|
|
188
|
+
for (const m of missing)
|
|
189
|
+
console.log(` - ${m}`);
|
|
190
|
+
}
|
|
191
|
+
console.log(`Credentials provider: ${config.credentials.provider}`);
|
|
192
|
+
console.log(`Logs: ${config.logging.enabled ? config.logging.directory : 'disabled'}`);
|
|
193
|
+
console.log(`Versions archive: ${config.archives.storeUploadedVersions ? config.archives.directory : 'disabled'}`);
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
console.log('No fastlane/release.config.json yet — run install.');
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
async function runAudit(project) {
|
|
200
|
+
const root = path.resolve(project);
|
|
201
|
+
const candidates = [
|
|
202
|
+
'fastlane/.env',
|
|
203
|
+
'android/keystore.properties',
|
|
204
|
+
'secrets/.gitignore',
|
|
205
|
+
'secrets/README.md',
|
|
206
|
+
];
|
|
207
|
+
// Also audit concrete secret files when present
|
|
208
|
+
const secretsDir = path.join(root, 'secrets');
|
|
209
|
+
if (exists(secretsDir)) {
|
|
210
|
+
for (const name of fs.readdirSync(secretsDir)) {
|
|
211
|
+
if (name === '.gitignore' || name === 'README.md')
|
|
212
|
+
continue;
|
|
213
|
+
if (name.endsWith('.bak'))
|
|
214
|
+
continue;
|
|
215
|
+
candidates.push(`secrets/${name}`);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
console.log('Credential audit');
|
|
219
|
+
let failures = 0;
|
|
220
|
+
for (const rel of candidates) {
|
|
221
|
+
const absolute = path.join(root, rel);
|
|
222
|
+
if (!exists(absolute)) {
|
|
223
|
+
console.log(` missing: ${rel}`);
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
const tracked = runArgv('git', ['ls-files', '--error-unmatch', rel], { cwd: root });
|
|
227
|
+
const ignored = runArgv('git', ['check-ignore', '-q', rel], { cwd: root });
|
|
228
|
+
const isTracked = tracked.status === 0;
|
|
229
|
+
// README/.gitignore under secrets may be intentionally tracked
|
|
230
|
+
const allowTracked = rel === 'secrets/.gitignore' || rel === 'secrets/README.md';
|
|
231
|
+
const isIgnored = ignored.status === 0;
|
|
232
|
+
if (!allowTracked && (isTracked || !isIgnored))
|
|
233
|
+
failures += 1;
|
|
234
|
+
console.log(` ${rel}: tracked=${isTracked} ignored=${isIgnored}${!allowTracked && (isTracked || !isIgnored) ? ' ⚠' : ''}`);
|
|
235
|
+
}
|
|
236
|
+
if (failures > 0) {
|
|
237
|
+
throw new Error(`Credential audit failed for ${failures} path(s). Update .gitignore or untrack secrets.`);
|
|
238
|
+
}
|
|
239
|
+
console.log('Audit passed.');
|
|
240
|
+
}
|
|
241
|
+
async function main() {
|
|
242
|
+
const options = parseArgs(process.argv.slice(2));
|
|
243
|
+
if (options.help || options.command === 'help') {
|
|
244
|
+
printHelp();
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
if (options.version) {
|
|
248
|
+
console.log(pkg.version);
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
const projectRoot = path.resolve(options.project);
|
|
252
|
+
try {
|
|
253
|
+
switch (options.command) {
|
|
254
|
+
case 'install':
|
|
255
|
+
await runInstall(options);
|
|
256
|
+
break;
|
|
257
|
+
case 'configure':
|
|
258
|
+
case 'credentials': {
|
|
259
|
+
const rl = createReadline();
|
|
260
|
+
try {
|
|
261
|
+
await setupCredentialsInteractively(rl, projectRoot, {
|
|
262
|
+
dryRun: options.dryRun,
|
|
263
|
+
provider: defaultCredentialProvider(),
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
finally {
|
|
267
|
+
rl.close();
|
|
268
|
+
}
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
case 'doctor':
|
|
272
|
+
await runDoctor(options.project);
|
|
273
|
+
break;
|
|
274
|
+
case 'audit':
|
|
275
|
+
await runAudit(options.project);
|
|
276
|
+
break;
|
|
277
|
+
case 'migrate': {
|
|
278
|
+
const { config, configPath } = loadReleaseConfig(projectRoot);
|
|
279
|
+
const { writeText } = await import('./fs.js');
|
|
280
|
+
const { jsonPretty } = await import('./config.js');
|
|
281
|
+
writeText(configPath, jsonPretty(config));
|
|
282
|
+
console.log(`Migrated ${configPath} to schemaVersion ${config.schemaVersion}`);
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
case 'uninstall':
|
|
286
|
+
await runUninstall(options);
|
|
287
|
+
break;
|
|
288
|
+
case 'verify':
|
|
289
|
+
case 'build':
|
|
290
|
+
case 'upload':
|
|
291
|
+
case 'beta':
|
|
292
|
+
case 'promote': {
|
|
293
|
+
materializeKeychainPasswords(projectRoot);
|
|
294
|
+
const lane = options.command === 'verify'
|
|
295
|
+
? 'verify'
|
|
296
|
+
: options.command === 'build'
|
|
297
|
+
? 'build_all'
|
|
298
|
+
: options.command === 'upload'
|
|
299
|
+
? 'upload_all'
|
|
300
|
+
: options.command === 'beta'
|
|
301
|
+
? 'beta_all'
|
|
302
|
+
: 'promote';
|
|
303
|
+
const result = runArgv('bundle', ['exec', 'fastlane', lane], { cwd: projectRoot });
|
|
304
|
+
process.stdout.write(result.stdout);
|
|
305
|
+
process.stderr.write(result.stderr);
|
|
306
|
+
if (result.status !== 0)
|
|
307
|
+
process.exit(result.status || 1);
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
310
|
+
default:
|
|
311
|
+
// v1 alias: bare flags mean install
|
|
312
|
+
if (options.command.startsWith('--')) {
|
|
313
|
+
throw new Error(`Unknown command: ${options.command}`);
|
|
314
|
+
}
|
|
315
|
+
throw new Error(`Unknown command: ${options.command}`);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
catch (error) {
|
|
319
|
+
const logFile = writeCrashLog(projectRoot, error);
|
|
320
|
+
console.error(error.message || error);
|
|
321
|
+
console.error(`Log: ${logFile}`);
|
|
322
|
+
process.exitCode = 1;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
main();
|
|
326
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,6BAA6B,EAAE,yBAAyB,EAAoB,MAAM,kBAAkB,CAAC;AAC9G,OAAO,EAAE,cAAc,EAAY,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC7F,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,OAAO,EAAE,CAAC,CAAC;QACjC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReleaseConfig } from './types.js';
|
|
2
|
+
import { assertSemver } from './paths.js';
|
|
3
|
+
export declare const SCHEMA_VERSION = 2;
|
|
4
|
+
type JsonSchema = {
|
|
5
|
+
type?: string | string[];
|
|
6
|
+
enum?: unknown[];
|
|
7
|
+
minLength?: number;
|
|
8
|
+
minimum?: number;
|
|
9
|
+
minItems?: number;
|
|
10
|
+
required?: string[];
|
|
11
|
+
additionalProperties?: boolean;
|
|
12
|
+
properties?: Record<string, JsonSchema>;
|
|
13
|
+
items?: JsonSchema;
|
|
14
|
+
};
|
|
15
|
+
export declare function loadSchema(): JsonSchema;
|
|
16
|
+
export declare function validateReleaseConfig(config: unknown): string[];
|
|
17
|
+
export declare function assertValidReleaseConfig(config: unknown): asserts config is ReleaseConfig;
|
|
18
|
+
export declare function loadReleaseConfig(root: string): {
|
|
19
|
+
config: ReleaseConfig;
|
|
20
|
+
configPath: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function migrateConfig(raw: unknown): ReleaseConfig;
|
|
23
|
+
export declare function deepMergeConfig(detected: ReleaseConfig, existing: ReleaseConfig): ReleaseConfig;
|
|
24
|
+
export declare function validateProjectPaths(root: string, config: ReleaseConfig): string[];
|
|
25
|
+
export declare function jsonPretty(value: unknown): string;
|
|
26
|
+
export { assertSemver };
|
|
27
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAA0B,YAAY,EAAgC,MAAM,YAAY,CAAC;AAGhG,eAAO,MAAM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