@purpleproser/soundboard-downloader-cli 1.6.3 → 1.8.4

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
@@ -1,6 +1,9 @@
1
1
  # @purpleproser/soundboard-downloader-cli
2
2
 
3
- [![Socket Badge](https://badge.socket.dev/npm/package/@purpleproser/soundboard-downloader-cli/1.6.0)](https://badge.socket.dev/npm/package/@purpleproser/soundboard-downloader-cli/1.6.0)
3
+ [![npm version](https://img.shields.io/npm/v/@purpleproser/soundboard-downloader-cli?style=for-the-badge&logo=npm&logoColor=white&color=CB3837)](https://www.npmjs.com/package/@purpleproser/soundboard-downloader-cli)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@purpleproser/soundboard-downloader-cli?style=for-the-badge&logo=npm&logoColor=white&color=CB3837)](https://www.npmjs.com/package/@purpleproser/soundboard-downloader-cli)
5
+ [![License](https://img.shields.io/badge/license-MIT-blue?style=for-the-badge)](LICENSE)
6
+ [![Socket Badge](https://badge.socket.dev/npm/package/@purpleproser/soundboard-downloader-cli/1.6.2)](https://badge.socket.dev/npm/package/@purpleproser/soundboard-downloader-cli/1.6.2)
4
7
 
5
8
  A Node.js command-line tool to download soundboard sounds from [MyInstants](https://myinstants.com).
6
9
 
@@ -15,10 +18,10 @@ A Node.js command-line tool to download soundboard sounds from [MyInstants](http
15
18
 
16
19
  ## Tech Stack
17
20
 
18
- - **Inquirer** - Interactive CLI prompts
21
+ - **prompts** - Lightweight interactive CLI prompts
19
22
  - **jsdom** - HTML parsing and DOM manipulation
20
23
  - **ora** - Elegant terminal spinners
21
- - **open** - Opens URLs in the user's browser to allow previewing the sound
24
+ - **opener** - Opens URLs in the user's browser to allow previewing the sound
22
25
 
23
26
  ## Prerequisites
24
27
 
@@ -157,6 +160,42 @@ soundboard-downloader
157
160
 
158
161
  Contributions are welcome! Please open an issue or submit a pull request.
159
162
 
163
+ ## Compliance with MyInstants Terms of Use
164
+
165
+ This tool is designed to comply with [MyInstants Terms of Use](https://www.myinstants.com/en/terms_of_use.html).
166
+
167
+ ### Compliance Features
168
+
169
+ ✅ **Personal Use Only**
170
+ This tool is for personal, non-commercial use only. Commercial use violates MyInstants' terms.
171
+
172
+ ✅ **Official Functionality**
173
+ Uses MyInstants' official download buttons and links, exactly as a manual user would.
174
+
175
+ ✅ **No Circumvention**
176
+ Does not bypass any access controls, paywalls, or copyright protections.
177
+
178
+ ✅ **Rate Limiting**
179
+ Includes 1-second delays between API requests to avoid being flagged as automated scraping.
180
+
181
+ ### User Responsibilities
182
+
183
+ When using this tool, you agree to:
184
+
185
+ - **Non-commercial use only** - No business or commercial applications
186
+ - **Respect rate limits** - Do not make excessive automated requests
187
+ - **Honor copyright** - Respect MyInstants' terms and copyright protections
188
+ - **Accept revocable access** - MyInstants may change their terms or block access at any time
189
+
190
+ ### Important Notice
191
+
192
+ MyInstants grants access to their website under a revocable license. While this tool is designed to comply with their current terms, it may stop working if:
193
+ - MyInstants changes their website structure
194
+ - MyInstants updates their terms of service
195
+ - MyInstants decides to block automated tools
196
+
197
+ Always check the [current MyInstants Terms of Use](https://www.myinstants.com/en/terms_of_use.html) for the latest requirements.
198
+
160
199
  ## Legal Disclaimer
161
200
 
162
201
  **Important Notice About Copyright and Usage:**
@@ -44,6 +44,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
44
44
  exports.getNodeDownloadPage = exports.getAllSoundNodes = exports.hasNextPage = exports.getSoundNodesPage = void 0;
45
45
  const api_config_1 = require("./api-config");
46
46
  const MockApi = __importStar(require("./my-instants.api.mock"));
47
+ const rate_limiter_1 = require("../utils/rate-limiter");
47
48
  /**
48
49
  * Fetch a single page of sound nodes from myinstants.com
49
50
  * @param searchString The search term
@@ -58,7 +59,7 @@ const getSoundNodesPage = async ({ searchString, page = 1 }) => {
58
59
  }
59
60
  const escapedSearchParam = encodeURIComponent(searchString);
60
61
  const url = `https://www.myinstants.com/en/search/?name=${escapedSearchParam}&page=${page}`;
61
- const response = await fetch(url);
62
+ const response = await (0, rate_limiter_1.rateLimitedFetch)(url);
62
63
  if (!response.ok) {
63
64
  throw new Error(`Failed to fetch page ${page} for search: ${searchString}`);
64
65
  }
@@ -79,7 +80,7 @@ const hasNextPage = async ({ searchString, page = 1 }) => {
79
80
  const escapedSearchParam = encodeURIComponent(searchString);
80
81
  const url = `https://www.myinstants.com/en/search/?name=${escapedSearchParam}&page=${page + 1}`;
81
82
  try {
82
- const response = await fetch(url, { method: 'HEAD' });
83
+ const response = await (0, rate_limiter_1.rateLimitedFetch)(url, { method: 'HEAD' });
83
84
  return response.ok;
84
85
  }
85
86
  catch (error) {
@@ -129,7 +130,7 @@ const getNodeDownloadPage = async (soundNodeDetailsURL) => {
129
130
  return MockApi.getNodeDownloadPage(soundNodeDetailsURL);
130
131
  }
131
132
  const root = `https://www.myinstants.com${soundNodeDetailsURL}`;
132
- const response = await fetch(root);
133
+ const response = await (0, rate_limiter_1.rateLimitedFetch)(root);
133
134
  if (!response.ok) {
134
135
  throw new Error(`Failed to fetch sound detail page: ${soundNodeDetailsURL}`);
135
136
  }
@@ -1 +1 @@
1
- {"version":3,"file":"my-instants.api.js","sourceRoot":"","sources":["../../src/api/my-instants.api.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,6CAAsD;AACtD,gEAAkD;AAElD;;;;;;GAMG;AACI,MAAM,iBAAiB,GAAG,KAAK,EAAE,EAAE,YAAY,EAAE,IAAI,GAAG,CAAC,EAAS,EAAmB,EAAE;IAC5F,gCAAgC;IAChC,IAAI,IAAA,uBAAU,GAAE,EAAE,CAAC;QACjB,OAAO,OAAO,CAAC,iBAAiB,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC5D,MAAM,GAAG,GAAG,8CAA8C,kBAAkB,SAAS,I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CAAC;IAChE,MAAM,QAAQ,GAAG,MAAM,IAAA,+BAAgB,EAAC,IAAI,CAAC,CAAC;IAE9C,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,sCAAsC,mBAAmB,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AACzB,CAAC,CAAC;AAdW,QAAA,mBAAmB,uBAc9B"}
package/dist/main.js CHANGED
File without changes
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /**
3
+ * Rate limiting utility to ensure compliance with MyInstants Terms of Use
4
+ * Adds reasonable delays between requests to avoid being seen as scraping
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.getRateLimitDelay = exports.resetRateLimiter = exports.rateLimitedFetch = void 0;
8
+ /**
9
+ * Minimum delay between requests (in milliseconds)
10
+ * This helps avoid being flagged as automated scraping
11
+ */
12
+ const MIN_REQUEST_DELAY = 1000; // 1 second
13
+ /**
14
+ * Track the last request time for rate limiting
15
+ */
16
+ let lastRequestTime = 0;
17
+ /**
18
+ * Rate-limited fetch wrapper
19
+ * Ensures minimum delay between consecutive requests to MyInstants
20
+ */
21
+ const rateLimitedFetch = async (input, init) => {
22
+ // Calculate time since last request
23
+ const now = Date.now();
24
+ const timeSinceLastRequest = now - lastRequestTime;
25
+ // If we're making requests too quickly, add a delay
26
+ if (timeSinceLastRequest < MIN_REQUEST_DELAY) {
27
+ const delayNeeded = MIN_REQUEST_DELAY - timeSinceLastRequest;
28
+ await new Promise(resolve => setTimeout(resolve, delayNeeded));
29
+ }
30
+ // Update last request time
31
+ lastRequestTime = Date.now();
32
+ // Make the actual fetch request
33
+ return fetch(input, init);
34
+ };
35
+ exports.rateLimitedFetch = rateLimitedFetch;
36
+ /**
37
+ * Reset the rate limiter (useful for testing)
38
+ */
39
+ const resetRateLimiter = () => {
40
+ lastRequestTime = 0;
41
+ };
42
+ exports.resetRateLimiter = resetRateLimiter;
43
+ /**
44
+ * Get the current rate limit delay
45
+ */
46
+ const getRateLimitDelay = () => {
47
+ return MIN_REQUEST_DELAY;
48
+ };
49
+ exports.getRateLimitDelay = getRateLimitDelay;
50
+ //# sourceMappingURL=rate-limiter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limiter.js","sourceRoot":"","sources":["../../src/utils/rate-limiter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;GAGG;AACH,MAAM,iBAAiB,GAAG,IAAI,CAAC,CAAC,WAAW;AAE3C;;GAEG;AACH,IAAI,eAAe,GAAG,CAAC,CAAC;AAExB;;;GAGG;AACI,MAAM,gBAAgB,GAAG,KAAK,EAAE,KAAwB,EAAE,IAAkB,EAAqB,EAAE;IACxG,oCAAoC;IACpC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,MAAM,oBAAoB,GAAG,GAAG,GAAG,eAAe,CAAC;IAEnD,oDAAoD;IACpD,IAAI,oBAAoB,GAAG,iBAAiB,EAAE,CAAC;QAC7C,MAAM,WAAW,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;QAC7D,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,2BAA2B;IAC3B,eAAe,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE7B,gCAAgC;IAChC,OAAO,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAC;AAhBW,QAAA,gBAAgB,oBAgB3B;AAEF;;GAEG;AACI,MAAM,gBAAgB,GAAG,GAAS,EAAE;IACzC,eAAe,GAAG,CAAC,CAAC;AACtB,CAAC,CAAC;AAFW,QAAA,gBAAgB,oBAE3B;AAEF;;GAEG;AACI,MAAM,iBAAiB,GAAG,GAAW,EAAE;IAC5C,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@purpleproser/soundboard-downloader-cli",
3
- "version": "1.6.3",
4
- "description": "Easily download sounds from myinstants.com using this interactive CLI tool",
3
+ "version": "1.8.4",
4
+ "description": "Easily download sounds from myinstants.com using this interactive CLI tool (for personal, non-commercial use only)",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -12,12 +12,6 @@
12
12
  "bin": {
13
13
  "soundboard-downloader": "./dist/main.js"
14
14
  },
15
- "scripts": {
16
- "test": "vitest --coverage",
17
- "start": "ts-node ./src/main.ts",
18
- "build": "tsc -p tsconfig.build.json",
19
- "prepublishOnly": "npm run build"
20
- },
21
15
  "keywords": [
22
16
  "soundboard",
23
17
  "myinstants",
@@ -34,20 +28,33 @@
34
28
  "url": "https://github.com/blacksagres/soundboard-downloader-cli/issues"
35
29
  },
36
30
  "homepage": "https://github.com/blacksagres/soundboard-downloader-cli#readme",
31
+ "files": [
32
+ "dist",
33
+ "README.md",
34
+ "LICENCE",
35
+ "package.json"
36
+ ],
37
37
  "devDependencies": {
38
+ "@types/node": "^25.0.0",
38
39
  "@types/jsdom": "^28.0.0",
39
40
  "@types/opener": "^1.4.3",
40
41
  "@types/prompts": "^2.4.9",
41
42
  "@vitest/coverage-v8": "^4.0.18",
42
43
  "ts-node": "^10.9.2",
43
- "typescript": "^5.9.3",
44
+ "typescript": "^6.0.2",
44
45
  "vitest": "^4.0.18"
45
46
  },
46
47
  "dependencies": {
47
- "jsdom": "^28.0.0",
48
+ "jsdom": "^29.1.1",
48
49
  "opener": "^1.5.2",
49
50
  "ora": "^9.3.0",
50
51
  "prompts": "^2.4.2",
51
52
  "valibot": "^1.2.0"
53
+ },
54
+ "scripts": {
55
+ "test": "vitest run --coverage",
56
+ "test:watch": "vitest --coverage",
57
+ "start": "ts-node ./src/main.ts",
58
+ "build": "tsc -p tsconfig.build.json"
52
59
  }
53
- }
60
+ }
@@ -1,14 +0,0 @@
1
- # To get started with Dependabot version updates, you'll need to specify which
2
- # package ecosystems to update and where the package manifests are located.
3
- # Please see the documentation for all configuration options:
4
- # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
-
6
- version: 2
7
- updates:
8
- - package-ecosystem: "npm" # See documentation for possible values
9
- directory: "/" # Location of package manifests
10
- labels:
11
- - "security"
12
- schedule:
13
- interval: "daily"
14
- target-branch: "main"
@@ -1,37 +0,0 @@
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
- - name: Check if version exists
25
- id: check_version
26
- run: |
27
- VERSION=$(node -p "require('./package.json').version")
28
- if npm view @purpleproser/soundboard-downloader-cli@$VERSION >/dev/null 2>&1; then
29
- echo "version_exists=true" >> $GITHUB_OUTPUT
30
- echo "Version $VERSION already exists in npm registry"
31
- else
32
- echo "version_exists=false" >> $GITHUB_OUTPUT
33
- echo "Version $VERSION does not exist in npm registry"
34
- fi
35
- - name: Publish to npm (only if version doesn't exist)
36
- if: steps.check_version.outputs.version_exists != 'true'
37
- run: npm publish --provenance
@@ -1,25 +0,0 @@
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
@@ -1,29 +0,0 @@
1
- name: 🧪 Run Tests
2
-
3
- permissions:
4
- contents: read
5
-
6
- on:
7
- pull_request:
8
- branches: [main]
9
-
10
- jobs:
11
- test:
12
- name: Run tests
13
- runs-on: ubuntu-latest
14
-
15
- steps:
16
- - uses: actions/checkout@v4
17
-
18
- - uses: actions/setup-node@v4
19
- with:
20
- node-version: 24
21
- cache: "npm"
22
-
23
- - name: Install dependencies
24
- run: npm install
25
-
26
- - name: Run tests
27
- run: npm test -- --reporter=verbose
28
- env:
29
- NODE_OPTIONS: --max-old-space-size=4096
package/CHANGELOG.md DELETED
@@ -1,169 +0,0 @@
1
- # Changelog
2
-
3
- This changelog is automatically generated by [release-please](https://github.com/google-github-actions/release-please-action).
4
-
5
- ## [1.6.3](https://github.com/blacksagres/soundboard-downloader-cli/compare/v1.6.2...v1.6.3) (2026-03-10)
6
-
7
-
8
- ### Bug Fixes
9
-
10
- * replace @inquirer/prompts with prompts ([366c79b](https://github.com/blacksagres/soundboard-downloader-cli/commit/366c79b6d842ca4de5da7ea843c15b66c10bddcf))
11
- * replace open with opener ([97ec29d](https://github.com/blacksagres/soundboard-downloader-cli/commit/97ec29d3cc487abad964fea89129a82e1424a6e5))
12
-
13
- ## [1.6.2](https://github.com/blacksagres/soundboard-downloader-cli/compare/v1.6.1...v1.6.2) (2026-03-07)
14
-
15
-
16
- ### Bug Fixes
17
-
18
- * add correct parameters for dependabot workflow ([f1737c1](https://github.com/blacksagres/soundboard-downloader-cli/commit/f1737c1ec83f67b68fd182e967fa7ffceaaf0194))
19
- * explicitely add read only permission to workflow ([3f17d79](https://github.com/blacksagres/soundboard-downloader-cli/commit/3f17d798c789f5e26e74282b60f8df6e49493918))
20
-
21
- ## [1.6.1](https://github.com/blacksagres/soundboard-downloader-cli/compare/v1.6.0...v1.6.1) (2026-03-07)
22
-
23
-
24
- ### Bug Fixes
25
-
26
- * run npm audit ([7dfe691](https://github.com/blacksagres/soundboard-downloader-cli/commit/7dfe69192dfe2aac1f407b3eb731fe15531334bb))
27
-
28
- ## [1.6.0](https://github.com/blacksagres/soundboard-downloader-cli/compare/v1.5.0...v1.6.0) (2026-03-01)
29
-
30
-
31
- ### Features
32
-
33
- * data validation with valibot ([1357286](https://github.com/blacksagres/soundboard-downloader-cli/commit/1357286c9c22153fccc6571f1b7dd1f554bbb057))
34
- * paginate search list to avoid blastinhg the myinstants page with requests ([439751c](https://github.com/blacksagres/soundboard-downloader-cli/commit/439751cb70d3586aae8d026db902932d41fc2a68))
35
- * restore single selection for sounds to keep UI clean ([c21895d](https://github.com/blacksagres/soundboard-downloader-cli/commit/c21895dcf373d55b1b87659371c5550d21773355))
36
-
37
-
38
- ### Bug Fixes
39
-
40
- * use a mock api for integration tests ([9f410df](https://github.com/blacksagres/soundboard-downloader-cli/commit/9f410dfa796bafc11dc49177667388a84e638e41))
41
-
42
- ## [1.5.0](https://github.com/blacksagres/soundboard-downloader-cli/compare/v1.4.0...v1.5.0) (2026-02-26)
43
-
44
-
45
- ### Features
46
-
47
- * download multiple files ([c2e257c](https://github.com/blacksagres/soundboard-downloader-cli/commit/c2e257cc6e9916679c86c902609fb328431cebbd))
48
-
49
- ## [1.4.0](https://github.com/blacksagres/soundboard-downloader-cli/compare/v1.3.0...v1.4.0) (2026-02-20)
50
-
51
-
52
- ### Features
53
-
54
- * add music note emoji to sound list for better UX ([7d6f12a](https://github.com/blacksagres/soundboard-downloader-cli/commit/7d6f12a12a46902e1d3bb261723094e8b1b470f9))
55
-
56
- ## [1.3.0](https://github.com/blacksagres/soundboard-downloader-cli/compare/v1.2.3...v1.3.0) (2026-02-20)
57
-
58
-
59
- ### Features
60
-
61
- * show total number of sounds found ([6b661df](https://github.com/blacksagres/soundboard-downloader-cli/commit/6b661dfd96f6e7a03289f7c7b153ca3dd345d6ab))
62
-
63
- ## [1.2.3](https://github.com/blacksagres/soundboard-downloader-cli/compare/v1.2.2...v1.2.3) (2026-02-20)
64
-
65
-
66
- ### Bug Fixes
67
-
68
- * prevent republishing existing versions ([#10](https://github.com/blacksagres/soundboard-downloader-cli/issues/10)) ([cf43fa6](https://github.com/blacksagres/soundboard-downloader-cli/commit/cf43fa611b2ac3b9b7700acfb23383deb33e7296))
69
-
70
- ## 1.0.0 (2026-02-20)
71
-
72
-
73
- ### Features
74
-
75
- * add new option to display url ([2e64f55](https://github.com/blacksagres/soundboard-downloader-cli/commit/2e64f55fab67f3a26db1698be374316e9132d4b0))
76
- * add npm provenance to publishing workflow ([7b467c1](https://github.com/blacksagres/soundboard-downloader-cli/commit/7b467c1c2d092b136988e5cf61a12df73efa429a))
77
- * display all results in terminal ([b3d7e20](https://github.com/blacksagres/soundboard-downloader-cli/commit/b3d7e2026eb9cedee3ad44ef47ab081d0c1f3510))
78
- * publish dist ([602b341](https://github.com/blacksagres/soundboard-downloader-cli/commit/602b341d1566f7a464d4da53498d4b5412113232))
79
- * **ui:** add a better commander ([fd2cd3f](https://github.com/blacksagres/soundboard-downloader-cli/commit/fd2cd3f5343a14ea94012dfbb204a7ca0a5e76e0))
80
-
81
-
82
- ### Bug Fixes
83
-
84
- * add correct release type to config ([fb86613](https://github.com/blacksagres/soundboard-downloader-cli/commit/fb866133e36a22ef9de04872449d967d42f5cc35))
85
- * add preinstall and postinstall to see if it works ([06eaf63](https://github.com/blacksagres/soundboard-downloader-cli/commit/06eaf637d5aa5233d88e9e5dfd5007d8e8104560))
86
- * add the correct url to the download link ([72d510d](https://github.com/blacksagres/soundboard-downloader-cli/commit/72d510d7515472aa0e3ca4a93f7c4afaf01cb6bf))
87
- * catch exit errors ([a9503e4](https://github.com/blacksagres/soundboard-downloader-cli/commit/a9503e4d1cfc5fa7ebcef009ed299b93806c8808))
88
- * configure trusted publisher in npm and adjust the publish file ([cf33842](https://github.com/blacksagres/soundboard-downloader-cli/commit/cf33842708df2d3075c1fa5ed1da440f9931557d))
89
- * handle potential undefined from file name generation ([de8233f](https://github.com/blacksagres/soundboard-downloader-cli/commit/de8233f8df39c053ae2f2ff2ce50a03c8b5593c5))
90
- * infinite install loop ([323f9ed](https://github.com/blacksagres/soundboard-downloader-cli/commit/323f9edf5033cd75a4e2f2b419af0267ba5ba6c3))
91
- * make vitest ignore files outside src ([d43ee2c](https://github.com/blacksagres/soundboard-downloader-cli/commit/d43ee2cf0ec027ba99d2668418be8770f65add78))
92
- * my big brain sorting that broke the links ([53cbc5b](https://github.com/blacksagres/soundboard-downloader-cli/commit/53cbc5b67cea0dffaf43d7740112826be5cf659c))
93
- * prevent shipping declaration files in the package ([e7c9d68](https://github.com/blacksagres/soundboard-downloader-cli/commit/e7c9d68c4427624d71d44177db6a98e7f6b7b1e7))
94
- * prevent test files from being added to build ([ac679ff](https://github.com/blacksagres/soundboard-downloader-cli/commit/ac679ffd4e0e7bc0500d7f302ba586b9a479f9e4))
95
- * prevent tests from running until fixed ([74142b8](https://github.com/blacksagres/soundboard-downloader-cli/commit/74142b8771959faa73efdc14d8b7c49d6f80a8e5))
96
- * remove need for temp folder ([8d7e2fa](https://github.com/blacksagres/soundboard-downloader-cli/commit/8d7e2faf1aa479a048d0cd7ad0623c686e82bd23))
97
- * remove prepare script ([737d7e4](https://github.com/blacksagres/soundboard-downloader-cli/commit/737d7e4d88cf49a211ec85705b1bf11ea37f5ff1))
98
- * unblock other workflows until I know what's wrong with the test ([8cb6d59](https://github.com/blacksagres/soundboard-downloader-cli/commit/8cb6d59050da184072480efac887b52b22caaf72))
99
- * use the correct yml file for publishing to npm ([8877330](https://github.com/blacksagres/soundboard-downloader-cli/commit/88773308eed96262d6a6994809ffc87fa92b5dd5))
100
-
101
- ## [1.2.2](https://github.com/blacksagres/soundboard-downloader-cli/compare/v1.2.1...v1.2.2) (2026-02-15)
102
-
103
-
104
- ### Bug Fixes
105
-
106
- * prevent tests from running until fixed ([2da9ad1](https://github.com/blacksagres/soundboard-downloader-cli/commit/2da9ad1e3616dddb4868babde7c39a97f92a2c30))
107
- * use the correct yml file for publishing to npm ([364cbb8](https://github.com/blacksagres/soundboard-downloader-cli/commit/364cbb8fe95456fb036d90a1a8bd014bccc7cea7))
108
-
109
- ## [1.2.1](https://github.com/blacksagres/soundboard-downloader-cli/compare/v1.2.0...v1.2.1) (2026-02-15)
110
-
111
-
112
- ### Bug Fixes
113
-
114
- * configure trusted publisher in npm and adjust the publish file ([8cbddce](https://github.com/blacksagres/soundboard-downloader-cli/commit/8cbddce0b6e80ce099bd848aef855d5e27abbc18))
115
-
116
- ## [1.2.0](https://github.com/blacksagres/soundboard-downloader-cli/compare/v1.1.1...v1.2.0) (2026-02-15)
117
-
118
-
119
- ### Features
120
-
121
- * add new option to display url ([51758d3](https://github.com/blacksagres/soundboard-downloader-cli/commit/51758d3c26602a649f5172a8dcb31981f5e7bc89))
122
-
123
-
124
- ### Bug Fixes
125
-
126
- * add correct release type to config ([737d1b9](https://github.com/blacksagres/soundboard-downloader-cli/commit/737d1b925ccaae715061a2023470e0f3d7534688))
127
- * handle potential undefined from file name generation ([484129f](https://github.com/blacksagres/soundboard-downloader-cli/commit/484129f79da05d56edee650c320fcc82cf81d042))
128
- * make vitest ignore files outside src ([7313579](https://github.com/blacksagres/soundboard-downloader-cli/commit/7313579f62f482bbd069da7de539f10697e2de83))
129
- * prevent shipping declaration files in the package ([fad7dc7](https://github.com/blacksagres/soundboard-downloader-cli/commit/fad7dc76c1b916a5becfa9677a486821b75c9792))
130
- * prevent test files from being added to build ([268b43f](https://github.com/blacksagres/soundboard-downloader-cli/commit/268b43fb788d7f9438b2473c4376349aa27e446b))
131
- * remove prepare script ([362e823](https://github.com/blacksagres/soundboard-downloader-cli/commit/362e823434f368bede87541d9fef3e70ca260343))
132
- * unblock other workflows until I know what's wrong with the test ([9f8c092](https://github.com/blacksagres/soundboard-downloader-cli/commit/9f8c092c6086cbbaaec087ae1de02dc47f5c954d))
133
-
134
- ## v1.0.1 (2024-02-14)
135
-
136
- ### Features
137
-
138
- - **download**: simplify download location to use current working directory
139
-
140
- ### Bug Fixes
141
-
142
- - **publish**: fix scoped package publishing with public access config
143
- - **deps**: remove unused @types/node dependency
144
-
145
- ### Documentation
146
-
147
- - **readme**: update with clear download location examples
148
- - **readme**: add npm scope vs GitHub username explanation
149
- - **changelog**: add comprehensive change tracking
150
- - **release**: add management guide for future releases
151
-
152
- ### Chores
153
-
154
- - **ci**: set up GitHub Actions for automated releases
155
- - **config**: add release-please workflow
156
-
157
- ## v1.0.0 (2024-02-14)
158
-
159
- ### Features(v1.0.0)
160
-
161
- - **core**: initial implementation with MyInstants API integration
162
- - **cli**: interactive interface with @inquirer/prompts
163
- - **download**: sound download with progress indicators
164
- - **playback**: browser playback option using open package
165
-
166
- ### Documentation(v1.0.0)
167
-
168
- - **readme**: initial setup and usage instructions
169
- - **license**: add MIT license file
package/src/api/README.md DELETED
@@ -1,128 +0,0 @@
1
- # API Mocking System
2
-
3
- This directory contains the API mocking system for the soundboard downloader CLI.
4
-
5
- ## Overview
6
-
7
- The mocking system allows you to switch between real API calls to myinstants.com and mock data for testing purposes. This is particularly useful for:
8
-
9
- - Running tests in CI environments (GitHub Actions, etc.)
10
- - Avoiding rate limiting issues
11
- - Having predictable test data
12
- - Faster test execution
13
- - Offline development
14
-
15
- ## Files
16
-
17
- - `api-config.ts` - Configuration system for switching between real and mock API
18
- - `my-instants.api.ts` - Main API layer with conditional mock support
19
- - `my-instants.api.mock.ts` - Mock implementation with predictable test data
20
-
21
- ## Usage
22
-
23
- ### In Tests
24
-
25
- ```typescript
26
- import { setApiMode } from "./api/api-config";
27
- import { getPaginatedResults, getAllResults } from "./service/my-instants.service";
28
-
29
- // Switch to mock mode before running tests
30
- beforeAll(() => {
31
- setApiMode("mock");
32
- });
33
-
34
- // Now all API calls will use mock data
35
- test("pagination works", async () => {
36
- const results = await getPaginatedResults("test", 1);
37
- // results will contain predictable mock data
38
- });
39
- ```
40
-
41
- ### In Development
42
-
43
- ```typescript
44
- import { setApiMode, getApiMode, isMockMode } from "./api/api-config";
45
-
46
- // Check current mode
47
- console.log(`Current mode: ${getApiMode()}`); // 'real' or 'mock'
48
- console.log(`Using mock: ${isMockMode()}`); // true or false
49
-
50
- // Switch modes
51
- setApiMode("mock"); // Use mock data
52
- setApiMode("real"); // Use real API
53
- ```
54
-
55
- ## Mock Data Structure
56
-
57
- The mock API provides predictable test data:
58
-
59
- - **14 total sounds** in the mock database
60
- - **6 sounds per page** for pagination
61
- - **Valid download URLs** for all sounds
62
- - **Consistent labels** (Wilhelm Scream, THX Deep Note, Test Sound 1-12)
63
-
64
- ### Example Mock Results
65
-
66
- **Pagination (Page 1):**
67
- ```json
68
- [
69
- {"label": "Wilhelm Scream", "download_url": "https://.../test-sound.mp3"},
70
- {"label": "THX Deep Note", "download_url": "https://.../test-sound.mp3"},
71
- {"label": "Test Sound 1", "download_url": "https://.../test-sound.mp3"},
72
- {"label": "Test Sound 2", "download_url": "https://.../test-sound.mp3"},
73
- {"label": "Test Sound 3", "download_url": "https://.../test-sound.mp3"},
74
- {"label": "Test Sound 4", "download_url": "https://.../test-sound.mp3"}
75
- ]
76
- ```
77
-
78
- **Fetch All:**
79
- - Returns all 14 sounds sorted alphabetically
80
- - Same structure as pagination results
81
-
82
- ## CI Integration
83
-
84
- The mock API is automatically used in CI environments. In your GitHub Actions workflow:
85
-
86
- ```yaml
87
- - name: Run tests
88
- run: npm test
89
- env:
90
- NODE_ENV: test
91
- ```
92
-
93
- The test file automatically detects CI environments and uses mock data.
94
-
95
- ## Benefits
96
-
97
- 1. **Reliability**: Tests don't depend on external API availability
98
- 2. **Speed**: Mock responses are instantaneous
99
- 3. **Predictability**: Always get the same test data
100
- 4. **No Rate Limiting**: Avoid GitHub Actions IP blocking
101
- 5. **Offline Testing**: Can run tests without internet connection
102
-
103
- ## Implementation Details
104
-
105
- The mock system works by:
106
-
107
- 1. **Intercepting API calls**: Each function in `my-instants.api.ts` checks `isMockMode()`
108
- 2. **Returning mock data**: If in mock mode, calls the corresponding mock function
109
- 3. **Maintaining interface**: Mock functions have the same signature as real functions
110
- 4. **HTML templates**: Mock functions return HTML strings that match the real site structure
111
-
112
- The mock HTML templates include the necessary DOM structure that the service layer expects to parse.
113
-
114
- ## Adding More Mock Data
115
-
116
- To add more test sounds, edit the `mockSounds` array in `my-instants.api.mock.ts`:
117
-
118
- ```typescript
119
- const mockSounds = [
120
- ...existingSounds,
121
- {
122
- label: "New Test Sound",
123
- detail_url: "/en/instant/new-test-sound/"
124
- }
125
- ];
126
- ```
127
-
128
- The system will automatically handle pagination based on the array length.
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "./tsconfig",
3
- "exclude": ["**/*.test.ts", "**/*.mock.ts", "vitest.config.ts"],
4
- "compilerOptions": {
5
- "declaration": false,
6
- "declarationMap": false
7
- }
8
- }
package/tsconfig.json DELETED
@@ -1,43 +0,0 @@
1
- {
2
- // Visit https://aka.ms/tsconfig to read more about this file
3
- "compilerOptions": {
4
- // File Layout
5
- "rootDir": "./src",
6
- "outDir": "./dist",
7
-
8
- // Environment Settings
9
- // See also https://aka.ms/tsconfig/module
10
- "module": "commonjs",
11
- "target": "esnext",
12
- // For nodejs:
13
- "lib": ["esnext"],
14
- "types": ["node"],
15
-
16
- // Other Outputs
17
- "sourceMap": true,
18
- "declaration": true,
19
- "declarationMap": true,
20
-
21
- // Stricter Typechecking Options
22
- "noUncheckedIndexedAccess": true,
23
- "exactOptionalPropertyTypes": true,
24
-
25
- // Style Options
26
- // "noImplicitReturns": true,
27
- // "noImplicitOverride": true,
28
- // "noUnusedLocals": true,
29
- // "noUnusedParameters": true,
30
- // "noFallthroughCasesInSwitch": true,
31
- // "noPropertyAccessFromIndexSignature": true,
32
-
33
- // Recommended Options
34
- "strict": true,
35
- "jsx": "react-jsx",
36
- "verbatimModuleSyntax": false,
37
- "isolatedModules": true,
38
- "noUncheckedSideEffectImports": true,
39
- "moduleDetection": "force",
40
- "skipLibCheck": true,
41
- "esModuleInterop": true
42
- }
43
- }
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "./tsconfig",
3
- "exclude": ["**/*.test.ts", "**/*.mock.ts", "vitest.config.ts"],
4
- "compilerOptions": {
5
- "declaration": false,
6
- "declarationMap": false
7
- }
8
- }
package/vite.config.js DELETED
@@ -1,13 +0,0 @@
1
- import { defineConfig } from "vitest/config";
2
-
3
- export default defineConfig({
4
- test: {
5
- exclude: ["**/node_modules/**", "**/dist/**", "./temp/**"],
6
- // Increase timeout for network tests
7
- testTimeout: 30000,
8
- // Retry failed tests (helpful for flaky network tests)
9
- retries: 1,
10
- // Show more detailed output
11
- verbose: true,
12
- },
13
- });