nappup 1.1.0 → 1.2.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 +9 -10
- package/bin/nappup/helpers.js +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,8 +26,9 @@ nappup [directory] [options]
|
|
|
26
26
|
|
|
27
27
|
| Flag | Description |
|
|
28
28
|
|------|-------------|
|
|
29
|
-
| `-s <secret_key>` | Your Nostr secret key (hex format) used to sign the application event. See [Authentication](#authentication) for alternatives. |
|
|
29
|
+
| `-s <secret_key>` | Your Nostr secret key (hex or nsec format) used to sign the application event. See [Authentication](#authentication) for alternatives. |
|
|
30
30
|
| `-d <d_tag>` | The unique identifier (`d` tag) for your application. If omitted, defaults to the directory name. Avoid generic names like `dist` or `build` - use something unique among your other apps like `mycoolapp`. |
|
|
31
|
+
| `-y` | Skip confirmation prompt. Useful for CI/CD pipelines or automated scripts. |
|
|
31
32
|
| `-r` | Force re-upload. By default, Napp Up! might skip files that haven't changed. Use this flag to ensure everything is pushed fresh. |
|
|
32
33
|
| `--main` | Publish to the **main** release channel. This is the default behavior. |
|
|
33
34
|
| `--next` | Publish to the **next** release channel. Ideal for beta testing or staging builds. |
|
|
@@ -37,36 +38,34 @@ nappup [directory] [options]
|
|
|
37
38
|
|
|
38
39
|
Napp Up! supports multiple ways to provide your Nostr secret key:
|
|
39
40
|
|
|
40
|
-
1. **CLI flag**: Pass your
|
|
41
|
+
1. **CLI flag**: Pass your secret key (hex or nsec) directly via `-s`:
|
|
41
42
|
```bash
|
|
42
|
-
nappup -s
|
|
43
|
+
nappup -s nsec1...
|
|
43
44
|
```
|
|
44
45
|
|
|
45
46
|
2. **Environment variable**: Set `NOSTR_SECRET_KEY` in your environment or a `.env` file:
|
|
46
47
|
```bash
|
|
47
|
-
export NOSTR_SECRET_KEY=
|
|
48
|
+
export NOSTR_SECRET_KEY=nsec1...
|
|
48
49
|
nappup ./dist
|
|
49
50
|
```
|
|
50
51
|
|
|
51
|
-
3. **Auto-generated key**: If no key is provided, Napp Up! will generate a new keypair automatically and store it in your project's `.env` file for future use.
|
|
52
|
-
|
|
53
|
-
> **Note**: The secret key must be in **hex format**. If you have an `nsec`, convert it to hex first.
|
|
52
|
+
3. **Auto-generated key**: If no key is provided, Napp Up! will generate a new keypair automatically and store it (as nsec) in your project's `.env` file for future use.
|
|
54
53
|
|
|
55
54
|
### Examples
|
|
56
55
|
|
|
57
56
|
Upload the current directory to the main channel:
|
|
58
57
|
```bash
|
|
59
|
-
nappup -s
|
|
58
|
+
nappup -s nsec1...
|
|
60
59
|
```
|
|
61
60
|
|
|
62
61
|
Or using an environment variable:
|
|
63
62
|
```bash
|
|
64
|
-
NOSTR_SECRET_KEY=
|
|
63
|
+
NOSTR_SECRET_KEY=nsec1... nappup
|
|
65
64
|
```
|
|
66
65
|
|
|
67
66
|
Upload a specific `dist` folder with a custom identifier to the `next` channel:
|
|
68
67
|
```bash
|
|
69
|
-
nappup ./dist -s
|
|
68
|
+
nappup ./dist -s nsec1... -d myapp --next
|
|
70
69
|
```
|
|
71
70
|
|
|
72
71
|
Force re-upload a draft:
|
package/bin/nappup/helpers.js
CHANGED
|
@@ -11,6 +11,7 @@ export function parseArgs (args) {
|
|
|
11
11
|
let dTag = null
|
|
12
12
|
let channel = null
|
|
13
13
|
let shouldReupload = false
|
|
14
|
+
let yes = false
|
|
14
15
|
|
|
15
16
|
for (let i = 0; i < args.length; i++) {
|
|
16
17
|
if (args[i] === '-s' && args[i + 1]) {
|
|
@@ -27,6 +28,8 @@ export function parseArgs (args) {
|
|
|
27
28
|
channel = 'draft'
|
|
28
29
|
} else if (args[i] === '-r') {
|
|
29
30
|
shouldReupload = true
|
|
31
|
+
} else if (args[i] === '-y') {
|
|
32
|
+
yes = true
|
|
30
33
|
} else if (!args[i].startsWith('-') && dir === null) {
|
|
31
34
|
dir = args[i]
|
|
32
35
|
}
|
|
@@ -37,11 +40,13 @@ export function parseArgs (args) {
|
|
|
37
40
|
sk,
|
|
38
41
|
dTag,
|
|
39
42
|
channel: channel || 'main',
|
|
40
|
-
shouldReupload
|
|
43
|
+
shouldReupload,
|
|
44
|
+
yes
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
export async function confirmArgs (args) {
|
|
49
|
+
if (args.yes) return
|
|
45
50
|
const rl = readline.createInterface({
|
|
46
51
|
input: process.stdin,
|
|
47
52
|
output: process.stdout
|