Skip to content

Commit 11d315b

Browse files
authored
Created @codemod-utils/threads (#272)
* chore: Scaffolded package * chore: Added lockfile * feature: Created utilities * refactor: Added tests * refactor: Covered the error case. Removed unused code. * chore: Added changeset
1 parent cc3a6c1 commit 11d315b

32 files changed

Lines changed: 682 additions & 0 deletions

.changeset/wicked-years-accept.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@codemod-utils/threads": minor
3+
---
4+
5+
Created @codemod-utils/threads

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pnpx @codemod-utils/cli <your-codemod-name>
3838
- [`@codemod-utils/files`](./packages/files/README.md)
3939
- [`@codemod-utils/package-json`](./packages/package-json/README.md)
4040
- [`@codemod-utils/tests`](./packages/tests/README.md)
41+
- [`@codemod-utils/threads`](./packages/threads/README.md)
4142

4243

4344
## Documentation

packages/threads/.npmignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# compiled output
2+
/tmp/
3+
4+
# dependencies
5+
/node_modules/
6+
7+
# misc
8+
/.DS_Store
9+
/.env*
10+
/.eslintcache
11+
/.git/
12+
/.github/
13+
/.gitignore
14+
/.pnpm-debug.log
15+
/.prettierignore
16+
/build.sh
17+
/eslint.config.mjs
18+
/prettier.config.mjs
19+
/tests/

packages/threads/.prettierignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# compiled output
2+
/dist/
3+
/dist-for-testing/
4+
/tmp/
5+
6+
# misc
7+
!.*
8+
.*/
9+
10+
# specific to this package
11+
README.md

packages/threads/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# @codemod-utils/threads

packages/threads/LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2026 Isaac J. Lee
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

packages/threads/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[![This project uses GitHub Actions for continuous integration.](https://github.com/ijlee2/codemod-utils/actions/workflows/ci.yml/badge.svg)](https://github.com/ijlee2/codemod-utils/actions/workflows/ci.yml)
2+
3+
# @codemod-utils/threads
4+
5+
_Utilities for parallelization_
6+
7+
8+
## What is it?
9+
10+
`@codemod-utils/threads` provides methods that help you parallelize code.
11+
12+
13+
## Documentation
14+
15+
Visit https://codemod-utils.netlify.app/docs/packages/codemod-utils-threads.
16+
17+
18+
## Compatibility
19+
20+
- Node.js v22 or above
21+
22+
23+
## Contributing
24+
25+
See the [Contributing](../../CONTRIBUTING.md) guide for details.
26+
27+
28+
## License
29+
30+
This project is licensed under the [MIT License](./LICENSE.md).

packages/threads/build.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env sh
2+
3+
ENVIRONMENT=$1
4+
5+
if [ $ENVIRONMENT = "--production" ]
6+
then
7+
# Clean slate
8+
rm -rf "dist"
9+
10+
# Compile TypeScript
11+
tsc --project "tsconfig.build.json"
12+
13+
echo "SUCCESS: Built dist.\n"
14+
15+
elif [ $ENVIRONMENT = "--test" ]
16+
then
17+
# Clean slate
18+
rm -rf "dist-for-testing"
19+
20+
# Compile TypeScript
21+
tsc --project "tsconfig.json"
22+
23+
echo "SUCCESS: Built dist-for-testing.\n"
24+
25+
fi

packages/threads/eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from '@shared-configs/eslint-config-node/typescript';

packages/threads/package.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"name": "@codemod-utils/threads",
3+
"version": "0.0.0",
4+
"private": true,
5+
"description": "Utilities for parallelization",
6+
"keywords": [
7+
"codemod",
8+
"ember-codemod"
9+
],
10+
"homepage": "https://codemod-utils.netlify.app/",
11+
"repository": {
12+
"type": "git",
13+
"url": "git@github.com:ijlee2/codemod-utils.git",
14+
"directory": "packages/threads"
15+
},
16+
"license": "MIT",
17+
"author": "Isaac J. Lee",
18+
"type": "module",
19+
"exports": {
20+
".": "./dist/index.js",
21+
"./*": {
22+
"types": "./dist/*.d.ts",
23+
"default": "./dist/*.js"
24+
}
25+
},
26+
"main": "dist/index.js",
27+
"types": "dist/index.d.ts",
28+
"typesVersions": {
29+
"*": {
30+
"*": [
31+
"dist/*"
32+
]
33+
}
34+
},
35+
"files": [
36+
"dist"
37+
],
38+
"scripts": {
39+
"build": "sh build.sh --production",
40+
"format": "prettier . --cache --write",
41+
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"",
42+
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" && pnpm format",
43+
"lint:format": "prettier . --cache --check",
44+
"lint:js": "eslint . --cache",
45+
"lint:js:fix": "eslint . --fix",
46+
"lint:types": "tsc --noEmit",
47+
"test": "sh build.sh --test && mt dist-for-testing --quiet"
48+
},
49+
"devDependencies": {
50+
"@codemod-utils/tests": "workspace:*",
51+
"@shared-configs/eslint-config-node": "workspace:*",
52+
"@shared-configs/prettier": "workspace:*",
53+
"@shared-configs/typescript": "workspace:*",
54+
"@sondr3/minitest": "^0.1.2",
55+
"@types/node": "^22.19.11",
56+
"concurrently": "^9.2.1",
57+
"eslint": "^9.39.2",
58+
"prettier": "^3.8.1",
59+
"typescript": "^5.9.3"
60+
},
61+
"engines": {
62+
"node": "22.* || >= 24"
63+
}
64+
}

0 commit comments

Comments
 (0)