@purpleproser/soundboard-downloader-cli 1.1.0 โ†’ 1.2.2

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.
@@ -0,0 +1,24 @@
1
+ name: ๐Ÿ“ฆ๏ธ Publish to NPM
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ id-token: write # Required for OIDC
10
+ contents: read
11
+
12
+ jobs:
13
+ publish:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - uses: actions/setup-node@v4
19
+ with:
20
+ node-version: "24"
21
+ registry-url: "https://registry.npmjs.org"
22
+ - run: npm ci
23
+ - run: npm run build --if-present
24
+ - run: npm publish
@@ -0,0 +1,25 @@
1
+ name: โžก๏ธ Release please
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ permissions:
9
+ contents: write
10
+ issues: write
11
+ pull-requests: write
12
+
13
+ jobs:
14
+ release-please:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: googleapis/release-please-action@v4
18
+ with:
19
+ # this assumes that you have created a personal access token
20
+ # (PAT) and configured it as a GitHub action secret named
21
+ # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
22
+ token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
23
+ # this is a built-in strategy in release-please, see "Action Inputs"
24
+ # for more options
25
+ release-type: node
@@ -0,0 +1,24 @@
1
+ name: ๐Ÿงช Run Tests
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+
7
+ jobs:
8
+ test:
9
+ name: Run tests
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - uses: actions/setup-node@v4
16
+ with:
17
+ node-version: 20
18
+ cache: "npm"
19
+
20
+ - name: Install dependencies
21
+ run: npm install
22
+
23
+ - name: Run tests
24
+ run: npm test
package/CHANGELOG.md ADDED
@@ -0,0 +1,73 @@
1
+ # Changelog
2
+
3
+ This changelog is automatically generated by [release-please](https://github.com/google-github-actions/release-please-action).
4
+
5
+ ## [1.2.2](https://github.com/blacksagres/soundboard-downloader-cli/compare/v1.2.1...v1.2.2) (2026-02-15)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * prevent tests from running until fixed ([2da9ad1](https://github.com/blacksagres/soundboard-downloader-cli/commit/2da9ad1e3616dddb4868babde7c39a97f92a2c30))
11
+ * use the correct yml file for publishing to npm ([364cbb8](https://github.com/blacksagres/soundboard-downloader-cli/commit/364cbb8fe95456fb036d90a1a8bd014bccc7cea7))
12
+
13
+ ## [1.2.1](https://github.com/blacksagres/soundboard-downloader-cli/compare/v1.2.0...v1.2.1) (2026-02-15)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * configure trusted publisher in npm and adjust the publish file ([8cbddce](https://github.com/blacksagres/soundboard-downloader-cli/commit/8cbddce0b6e80ce099bd848aef855d5e27abbc18))
19
+
20
+ ## [1.2.0](https://github.com/blacksagres/soundboard-downloader-cli/compare/v1.1.1...v1.2.0) (2026-02-15)
21
+
22
+
23
+ ### Features
24
+
25
+ * add new option to display url ([51758d3](https://github.com/blacksagres/soundboard-downloader-cli/commit/51758d3c26602a649f5172a8dcb31981f5e7bc89))
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * add correct release type to config ([737d1b9](https://github.com/blacksagres/soundboard-downloader-cli/commit/737d1b925ccaae715061a2023470e0f3d7534688))
31
+ * handle potential undefined from file name generation ([484129f](https://github.com/blacksagres/soundboard-downloader-cli/commit/484129f79da05d56edee650c320fcc82cf81d042))
32
+ * make vitest ignore files outside src ([7313579](https://github.com/blacksagres/soundboard-downloader-cli/commit/7313579f62f482bbd069da7de539f10697e2de83))
33
+ * prevent shipping declaration files in the package ([fad7dc7](https://github.com/blacksagres/soundboard-downloader-cli/commit/fad7dc76c1b916a5becfa9677a486821b75c9792))
34
+ * prevent test files from being added to build ([268b43f](https://github.com/blacksagres/soundboard-downloader-cli/commit/268b43fb788d7f9438b2473c4376349aa27e446b))
35
+ * remove prepare script ([362e823](https://github.com/blacksagres/soundboard-downloader-cli/commit/362e823434f368bede87541d9fef3e70ca260343))
36
+ * unblock other workflows until I know what's wrong with the test ([9f8c092](https://github.com/blacksagres/soundboard-downloader-cli/commit/9f8c092c6086cbbaaec087ae1de02dc47f5c954d))
37
+
38
+ ## v1.0.1 (2024-02-14)
39
+
40
+ ### Features
41
+
42
+ - **download**: simplify download location to use current working directory
43
+
44
+ ### Bug Fixes
45
+
46
+ - **publish**: fix scoped package publishing with public access config
47
+ - **deps**: remove unused @types/node dependency
48
+
49
+ ### Documentation
50
+
51
+ - **readme**: update with clear download location examples
52
+ - **readme**: add npm scope vs GitHub username explanation
53
+ - **changelog**: add comprehensive change tracking
54
+ - **release**: add management guide for future releases
55
+
56
+ ### Chores
57
+
58
+ - **ci**: set up GitHub Actions for automated releases
59
+ - **config**: add release-please workflow
60
+
61
+ ## v1.0.0 (2024-02-14)
62
+
63
+ ### Features(v1.0.0)
64
+
65
+ - **core**: initial implementation with MyInstants API integration
66
+ - **cli**: interactive interface with @inquirer/prompts
67
+ - **download**: sound download with progress indicators
68
+ - **playback**: browser playback option using open package
69
+
70
+ ### Documentation(v1.0.0)
71
+
72
+ - **readme**: initial setup and usage instructions
73
+ - **license**: add MIT license file
package/README.md CHANGED
@@ -1,26 +1,24 @@
1
1
  # @purpleproser/soundboard-downloader-cli
2
2
 
3
- A command-line tool to download soundboard sounds from MyInstants.
3
+ A Node.js command-line tool to download soundboard sounds from [MyInstants](https://myinstants.com).
4
4
 
5
- **npm Package**: `@purpleproser/soundboard-downloader-cli`
6
- **GitHub Repository**: [blacksagres/soundboard-downloader-cli](https://github.com/blacksagres/soundboard-downloader-cli) Built with TypeScript and Node.js.
5
+ **๐Ÿ“ฆ๏ธ npm package**: `@purpleproser/soundboard-downloader-cli`
6
+
7
+ **GitHub Repository**: [blacksagres/soundboard-downloader-cli](https://github.com/blacksagres/soundboard-downloader-cli)
7
8
 
8
9
  ## Features
9
10
 
10
11
  - ๐Ÿ” Search for sounds by name using interactive prompts
11
12
  - ๐ŸŽต Preview sounds by playing them in your browser
12
- - โฌ‡๏ธ Download individual sounds to your local machine
13
13
  - ๐Ÿ“ Downloads are saved directly in your current working directory
14
14
  - โœจ Simple and easy-to-use interactive interface
15
15
 
16
16
  ## Tech Stack
17
17
 
18
- - **TypeScript** - Type-safe development
19
- - **Node.js** - Runtime environment
20
18
  - **Inquirer** - Interactive CLI prompts
21
19
  - **jsdom** - HTML parsing and DOM manipulation
22
20
  - **ora** - Elegant terminal spinners
23
- - **open** - Opens URLs in the user's browser
21
+ - **open** - Opens URLs in the user's browser to allow previewing the sound
24
22
 
25
23
  ## Prerequisites
26
24
 
@@ -129,18 +127,6 @@ $ npm start
129
127
 
130
128
  ## Development
131
129
 
132
- ### Project Structure
133
-
134
- ```
135
- src/
136
- โ”œโ”€โ”€ main.ts # Entry point
137
- โ”œโ”€โ”€ api/
138
- โ”‚ โ””โ”€โ”€ my-instants.api.ts # API layer for MyInstants
139
- โ”œโ”€โ”€ components/ # CLI components
140
- โ””โ”€โ”€ service/
141
- โ””โ”€โ”€ my-instants.service.ts # Business logic
142
- ```
143
-
144
130
  ### Available Scripts
145
131
 
146
132
  - `npm start` - Run in development mode with ts-node
package/dist/main.js CHANGED
@@ -6,9 +6,20 @@ const ora_1 = require("ora");
6
6
  const prompts_1 = require("@inquirer/prompts");
7
7
  const open_1 = require("open");
8
8
  const file_downloader_service_1 = require("./service/file-downloader.service");
9
+ process.on("uncaughtException", (error) => {
10
+ if (error instanceof Error && error.name === "ExitPromptError") {
11
+ console.log("๐Ÿ‘‹ until next time!");
12
+ }
13
+ else {
14
+ // Rethrow unknown errors
15
+ console.error(error);
16
+ }
17
+ });
9
18
  (async function () {
10
19
  const answer = await (0, prompts_1.input)({
11
20
  message: "What sound effects are you looking for?",
21
+ required: true,
22
+ default: "wilhelm scream",
12
23
  });
13
24
  const spinner = (0, ora_1.default)({
14
25
  text: "Loading result...",
@@ -18,7 +29,8 @@ const file_downloader_service_1 = require("./service/file-downloader.service");
18
29
  const sounds = await (0, my_instants_service_1.getSoundNodes)(answer);
19
30
  spinner.stop();
20
31
  const selection = await (0, prompts_1.select)({
21
- message: "Which one to download?",
32
+ message: "Which one to download? (use the keyboard arrows to navigate, search for something directly)",
33
+ pageSize: 30,
22
34
  choices: sounds.map((sound) => ({
23
35
  name: sound.label,
24
36
  value: `${sound.label}||${sound.download_url}`,
@@ -37,11 +49,18 @@ const file_downloader_service_1 = require("./service/file-downloader.service");
37
49
  name: "Play",
38
50
  value: "action:play",
39
51
  },
52
+ {
53
+ name: "Show download URL (you can pipe this to other commands)",
54
+ value: "action:show-url",
55
+ },
40
56
  ];
41
57
  const action = await (0, prompts_1.select)({
42
58
  message: `Selected: ${label}`,
43
59
  choices: actions,
44
60
  });
61
+ if (action === "action:show-url") {
62
+ console.log(downloadUrl);
63
+ }
45
64
  if (action === "action:play") {
46
65
  (0, open_1.default)(downloadUrl);
47
66
  }
@@ -52,6 +71,9 @@ const file_downloader_service_1 = require("./service/file-downloader.service");
52
71
  spinner: "growHorizontal",
53
72
  }).start();
54
73
  const downloadFileName = downloadUrl.split("/").pop();
74
+ if (!downloadFileName) {
75
+ throw new ReferenceError(`Could not find download file name for: [${downloadUrl}], could it be a malformed link?`);
76
+ }
55
77
  // Download directly to current working directory
56
78
  (0, file_downloader_service_1.downloadFile)(downloadUrl, {
57
79
  destination: downloadFileName,
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;AAEA,uEAA8D;AAC9D,6BAAsB;AACtB,+CAAkD;AAClD,+BAAwB;AACxB,+EAAiE;AAEjE,CAAC,KAAK;IACJ,MAAM,MAAM,GAAG,MAAM,IAAA,eAAK,EAAC;QACzB,OAAO,EAAE,yCAAyC;KACnD,CAAC,CAAC;IAEH,MAAM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AAG,IAAA,aAAG,EAAC;YAC1B,IAAI,EAAE,qBAAqB;YAC3B,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,gBAAgB;SAC1B,CAAC,CAAC,KAAK,EAAE,CAAC;QAEX,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QAEtD,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,MAAM,IAAI,cAAc,CACtB,2CAA2C,WAAW,kCAAkC,CACzF,CAAC;QACJ,CAAC;QAED,iDAAiD;QACjD,IAAA,sCAAY,EAAC,WAAW,EAAE;YACxB,WAAW,EAAE,gBAAgB;YAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE;YACtC,QAAQ,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE;SACvC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleproser/soundboard-downloader-cli",
3
- "version": "1.1.0",
3
+ "version": "1.2.2",
4
4
  "description": "Easily download sounds from myinstants.com using this interactive CLI tool",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -13,10 +13,9 @@
13
13
  "soundboard-downloader": "./dist/main.js"
14
14
  },
15
15
  "scripts": {
16
- "test": "echo \"Error: no test specified\" && exit 1",
16
+ "test": "vitest",
17
17
  "start": "ts-node ./src/main.ts",
18
- "build": "tsc",
19
- "prepare": "npm run build",
18
+ "build": "tsc -p tsconfig.prod.json",
20
19
  "prepublishOnly": "npm run build"
21
20
  },
22
21
  "keywords": [
@@ -38,7 +37,8 @@
38
37
  "devDependencies": {
39
38
  "@types/jsdom": "^27.0.0",
40
39
  "ts-node": "^10.9.2",
41
- "typescript": "^5.9.3"
40
+ "typescript": "^5.9.3",
41
+ "vitest": "^4.0.18"
42
42
  },
43
43
  "dependencies": {
44
44
  "@inquirer/prompts": "^8.2.0",
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "./tsconfig",
3
+ "exclude": ["**/*.test.ts", "**/*.mock.ts"],
4
+ "compilerOptions": {
5
+ "declaration": false,
6
+ "declarationMap": false
7
+ }
8
+ }
package/vite.config.js ADDED
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from "vitest/config";
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ exclude: ["**/node_modules/**", "**/dist/**", "./temp/**"],
6
+ },
7
+ });
Binary file