@senad-d/micme 0.1.0 → 0.1.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 CHANGED
@@ -4,8 +4,9 @@ All notable changes to Micme will be documented in this file.
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ - Document the scoped npm package name, `@senad-d/micme`, in install, diagnostics, update, and uninstall commands.
8
+ - Add an interactive npm publishing script that prompts for a version, validates the package, creates the release commit/tag, and publishes with public scoped-package access.
7
9
  - Keep publication on hold until package name, metadata, security review, validation, and smoke tests are complete.
8
- - Use the `docs/PUBLISHING.md` checklist for the first npm release.
9
10
 
10
11
  ## 0.1.0 - 2026-06-18
11
12
 
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  <p align="center">
2
- <img alt="Micme logo" src="img/micme_logo.png" width="128">
2
+ <img alt="Micme logo" src="img/micme_logo.svg" width="128">
3
3
  </p>
4
4
 
5
5
  <p align="center">
6
6
  <a href="https://pi.dev"><img alt="pi package" src="https://img.shields.io/badge/pi-package-6f42c1?style=flat-square" /></a>
7
- <a href="https://www.npmjs.com/package/micme"><img alt="npm" src="https://img.shields.io/npm/v/micme?style=flat-square" /></a>
7
+ <a href="https://www.npmjs.com/package/@senad-d/micme"><img alt="npm" src="https://img.shields.io/npm/v/%40senad-d%2Fmicme?style=flat-square" /></a>
8
8
  <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" /></a>
9
9
  </p>
10
10
 
@@ -35,13 +35,16 @@ Micme is a pi extension for short coding prompts. It records your microphone wit
35
35
  - [Troubleshooting](#troubleshooting)
36
36
  - [Diagnostics](#diagnostics)
37
37
  - [Update and Uninstall](#update-and-uninstall)
38
+ - [Development](#development)
39
+ - [Publishing](#publishing)
40
+ - [License](#license)
38
41
 
39
42
  ---
40
43
 
41
44
  ## Quick Start
42
45
 
43
46
  ```bash
44
- pi install npm:micme
47
+ pi install npm:@senad-d/micme
45
48
  ```
46
49
 
47
50
  Install a local backend. On macOS:
@@ -76,9 +79,9 @@ Micme is toggle-based. Press-and-hold recording is not used because terminal key
76
79
 
77
80
  | Scope | Command | Notes |
78
81
  | --- | --- | --- |
79
- | Global | `pi install npm:micme` | Loads in every trusted pi project. |
80
- | Project-local | `pi install npm:micme -l` | Writes to `.pi/settings.json` in the current project. |
81
- | One run | `pi -e npm:micme` | Try without changing settings. |
82
+ | Global | `pi install npm:@senad-d/micme` | Loads in every trusted pi project. |
83
+ | Project-local | `pi install npm:@senad-d/micme -l` | Writes to `.pi/settings.json` in the current project. |
84
+ | One run | `pi -e npm:@senad-d/micme` | Try without changing settings. |
82
85
  | Git | `pi install git:github.com/senad-d/micme@<tag>` | Pin a tag or commit. |
83
86
  | Local checkout | `pi -e .` | Develop or test this repository. |
84
87
 
@@ -222,7 +225,7 @@ MICME_TRANSCRIBE_COMMAND=whisper-cli -m /path/to/model.bin -f {audio} -otxt -of
222
225
  ## Diagnostics
223
226
 
224
227
  ```bash
225
- npx -p micme micme-doctor
228
+ npx -p @senad-d/micme micme-doctor
226
229
  ```
227
230
 
228
231
  From a source checkout:
@@ -238,10 +241,10 @@ The doctor checks Node, pi, `ffmpeg`, whisper.cpp, optional `whisper-stream`, mo
238
241
  ## Update and Uninstall
239
242
 
240
243
  ```bash
241
- pi update --extensions # update installed pi packages
242
- pi update npm:micme # update Micme only
243
- pi remove npm:micme # remove global install
244
- pi remove npm:micme -l # remove project-local install
244
+ pi update --extensions # update installed pi packages
245
+ pi update npm:@senad-d/micme # update Micme only
246
+ pi remove npm:@senad-d/micme # remove global install
247
+ pi remove npm:@senad-d/micme -l # remove project-local install
245
248
  ```
246
249
 
247
250
  ---
@@ -254,6 +257,20 @@ npm run validate
254
257
  pi -e . --list-models micme-load-test
255
258
  ```
256
259
 
260
+ ## Publishing
261
+
262
+ Micme publishes to npm as `@senad-d/micme`. You need an npm account with publish access to the `@senad-d` scope.
263
+
264
+ ```bash
265
+ npm login
266
+ npm whoami
267
+ npm run publish:npm
268
+ ```
269
+
270
+ The publish script asks for the version number, validates the package, runs `npm version <version>` to update `package.json` and `package-lock.json`, creates the `v<version>` git tag, publishes with `npm publish --access public`, and then offers to push the release commit and tag.
271
+
272
+ Run it only from a clean working tree after updating `CHANGELOG.md`.
273
+
257
274
  ## License
258
275
 
259
276
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@senad-d/micme",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "Local voice-to-text for pi, optimized for fast Whisper-style backends.",
6
6
  "license": "MIT",
@@ -43,11 +43,12 @@
43
43
  ],
44
44
  "scripts": {
45
45
  "doctor": "node scripts/doctor.mjs",
46
- "check": "node --check scripts/doctor.mjs && node --check scripts/check-package-contents.mjs",
46
+ "check": "node --check scripts/doctor.mjs && node --check scripts/check-package-contents.mjs && node --check scripts/publish-npm.mjs",
47
47
  "typecheck": "tsc --noEmit",
48
48
  "pack:dry-run": "npm pack --dry-run --json",
49
49
  "check:pack": "node scripts/check-package-contents.mjs",
50
50
  "validate": "npm run typecheck && npm run check && npm run check:pack",
51
+ "publish:npm": "node scripts/publish-npm.mjs",
51
52
  "prepublishOnly": "npm run validate"
52
53
  },
53
54
  "pi": {
@@ -0,0 +1,148 @@
1
+ #!/usr/bin/env node
2
+ import { readFileSync } from "node:fs";
3
+ import { execFileSync, spawnSync } from "node:child_process";
4
+ import { createInterface } from "node:readline/promises";
5
+ import { stdin as input, stdout as output } from "node:process";
6
+ import { fileURLToPath } from "node:url";
7
+
8
+ const rootUrl = new URL("../", import.meta.url);
9
+ const root = fileURLToPath(rootUrl);
10
+ const packageJsonUrl = new URL("package.json", rootUrl);
11
+ const pkg = JSON.parse(readFileSync(packageJsonUrl, "utf8"));
12
+ const semverPattern = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
13
+
14
+ function capture(command, args, options = {}) {
15
+ return execFileSync(command, args, {
16
+ cwd: root,
17
+ encoding: "utf8",
18
+ stdio: ["ignore", "pipe", "pipe"],
19
+ ...options,
20
+ }).trim();
21
+ }
22
+
23
+ function run(command, args) {
24
+ console.log(`\n$ ${command} ${args.join(" ")}`);
25
+ const result = spawnSync(command, args, {
26
+ cwd: root,
27
+ stdio: "inherit",
28
+ });
29
+
30
+ if (result.status !== 0) {
31
+ process.exit(result.status ?? 1);
32
+ }
33
+ }
34
+
35
+ function fail(message) {
36
+ console.error(`\n${message}`);
37
+ process.exit(1);
38
+ }
39
+
40
+ function commandSucceeds(command, args) {
41
+ const result = spawnSync(command, args, {
42
+ cwd: root,
43
+ stdio: "ignore",
44
+ });
45
+ return result.status === 0;
46
+ }
47
+
48
+ function ensureCleanGitTree() {
49
+ const status = capture("git", ["status", "--porcelain"]);
50
+ if (status) {
51
+ fail("Working tree is not clean. Commit or stash changes before publishing.");
52
+ }
53
+ }
54
+
55
+ function ensureNpmLogin() {
56
+ const result = spawnSync("npm", ["whoami"], {
57
+ cwd: root,
58
+ encoding: "utf8",
59
+ stdio: ["ignore", "pipe", "pipe"],
60
+ });
61
+
62
+ if (result.status !== 0) {
63
+ fail("npm login is required before publishing. Run `npm login`, then retry.");
64
+ }
65
+
66
+ console.log(`npm user: ${result.stdout.trim()}`);
67
+ }
68
+
69
+ async function main() {
70
+ console.log(`Publishing ${pkg.name}`);
71
+ console.log(`Current version: ${pkg.version}`);
72
+
73
+ ensureCleanGitTree();
74
+ ensureNpmLogin();
75
+
76
+ const rl = createInterface({ input, output });
77
+ const version = (await rl.question("Version to publish (for example 0.1.1): ")).trim();
78
+
79
+ if (!semverPattern.test(version)) {
80
+ rl.close();
81
+ fail("Enter a valid semver version, for example 0.1.1 or 1.0.0-beta.1.");
82
+ }
83
+
84
+ if (version === pkg.version) {
85
+ rl.close();
86
+ fail(`package.json is already at version ${version}. Choose a new version.`);
87
+ }
88
+
89
+ const gitTag = `v${version}`;
90
+ if (commandSucceeds("git", ["rev-parse", "--verify", `refs/tags/${gitTag}`])) {
91
+ rl.close();
92
+ fail(`Git tag ${gitTag} already exists.`);
93
+ }
94
+
95
+ const publishedVersion = spawnSync("npm", ["view", `${pkg.name}@${version}`, "version"], {
96
+ cwd: root,
97
+ encoding: "utf8",
98
+ stdio: ["ignore", "pipe", "ignore"],
99
+ });
100
+
101
+ if (publishedVersion.status === 0 && publishedVersion.stdout.trim()) {
102
+ rl.close();
103
+ fail(`${pkg.name}@${version} already exists on npm.`);
104
+ }
105
+
106
+ const publishArgs = ["publish"];
107
+ if (pkg.name.startsWith("@")) {
108
+ publishArgs.push("--access", "public");
109
+ }
110
+
111
+ console.log("\nThis will:");
112
+ console.log(`- run npm validation`);
113
+ console.log(`- run npm version ${version} to update package.json/package-lock.json`);
114
+ console.log(`- create a release commit and git tag ${gitTag}`);
115
+ console.log(`- run npm ${publishArgs.join(" ")}`);
116
+
117
+ const confirm = (await rl.question("Continue? [y/N] ")).trim().toLowerCase();
118
+ if (confirm !== "y" && confirm !== "yes") {
119
+ rl.close();
120
+ fail("Publish cancelled.");
121
+ }
122
+
123
+ rl.close();
124
+
125
+ run("npm", ["run", "validate"]);
126
+ run("npm", ["version", version, "-m", "chore(release): v%s"]);
127
+ run("npm", publishArgs);
128
+
129
+ const pushRl = createInterface({ input, output });
130
+ const push = (await pushRl.question(`Push current branch and ${gitTag} to origin? [y/N] `)).trim().toLowerCase();
131
+ pushRl.close();
132
+
133
+ if (push === "y" || push === "yes") {
134
+ const branch = capture("git", ["branch", "--show-current"]);
135
+ if (!branch) {
136
+ fail(`Release was published, but git is in detached HEAD. Push ${gitTag} manually.`);
137
+ }
138
+
139
+ run("git", ["push", "origin", branch]);
140
+ run("git", ["push", "origin", gitTag]);
141
+ }
142
+
143
+ console.log(`\nPublished ${pkg.name}@${version}.`);
144
+ }
145
+
146
+ main().catch((error) => {
147
+ fail(error instanceof Error ? error.message : String(error));
148
+ });