nappup 1.1.0 → 1.2.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/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 hex-encoded secret key directly via `-s`:
41
+ 1. **CLI flag**: Pass your secret key (hex or nsec) directly via `-s`:
41
42
  ```bash
42
- nappup -s 0123456789abcdef...
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=0123456789abcdef...
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 0123456789abcdef...
58
+ nappup -s nsec1...
60
59
  ```
61
60
 
62
61
  Or using an environment variable:
63
62
  ```bash
64
- NOSTR_SECRET_KEY=0123456789abcdef... nappup
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 0123456789abcdef... -d myapp --next
68
+ nappup ./dist -s nsec1... -d myapp --next
70
69
  ```
71
70
 
72
71
  Force re-upload a draft:
@@ -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
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "git+https://github.com/44billion/nappup.git"
7
7
  },
8
8
  "license": "GPL-3.0-or-later",
9
- "version": "1.1.0",
9
+ "version": "1.2.1",
10
10
  "description": "Nostr App Uploader",
11
11
  "type": "module",
12
12
  "scripts": {
@@ -7,13 +7,14 @@ for (let z = 0; z < ALPHABET.length; z++) {
7
7
  }
8
8
 
9
9
  function polymod (values) {
10
+ const GEN = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3]
10
11
  let chk = 1
11
12
  for (let p = 0; p < values.length; ++p) {
12
13
  const top = chk >> 25
13
14
  chk = (chk & 0x1ffffff) << 5 ^ values[p]
14
15
  for (let i = 0; i < 5; ++i) {
15
16
  if ((top >> i) & 1) {
16
- chk ^= 0x3b6a57b2 >> i
17
+ chk ^= GEN[i]
17
18
  }
18
19
  }
19
20
  }