@nathievzm/lumi 1.0.0 → 1.0.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.
@@ -1,3 +1,3 @@
1
1
  {
2
- "extends": ["@commitlint/config-conventional"]
2
+ "extends": ["@commitlint/config-conventional"]
3
3
  }
package/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ # force git to always use lf for all text files, no matter the os
2
+ * text=auto eol=lf
@@ -0,0 +1,30 @@
1
+ name: auto assign author
2
+
3
+ on:
4
+ issues:
5
+ types: [opened]
6
+ pull_request:
7
+ types: [opened]
8
+
9
+ jobs:
10
+ assign:
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ issues: write
14
+ pull-requests: write
15
+ steps:
16
+ - name: assign the user who opened the ticket or pr
17
+ uses: actions/github-script@v7
18
+ with:
19
+ github-token: ${{ secrets.LUMI_AUTOASSIGN_TOKEN }}
20
+ script: |
21
+ // grab the username of the person who triggered the action
22
+ const author = context.actor
23
+
24
+ // tell github's api to assign the ticket to that username
25
+ await github.rest.issues.addAssignees({
26
+ owner: context.repo.owner,
27
+ repo: context.repo.repo,
28
+ issue_number: context.issue.number,
29
+ assignees: [author]
30
+ })
package/.oxfmtrc.json CHANGED
@@ -1,32 +1,39 @@
1
1
  {
2
- "$schema": "./node_modules/oxfmt/configuration_schema.json",
3
- "arrowParens": "avoid",
4
- "bracketSameLine": true,
5
- "bracketSpacing": true,
6
- "embeddedLanguageFormatting": "auto",
7
- "endOfLine": "crlf",
8
- "insertFinalNewline": true,
9
- "jsdoc": {
10
- "bracketSpacing": true,
11
- "lineWrappingStyle": "balance",
12
- "separateReturnsFromParam": true,
13
- "capitalizeDescriptions": true,
14
- "descriptionWithDot": false,
15
- "commentLineStrategy": "multiline"
16
- },
17
- "objectWrap": "preserve",
18
- "printWidth": 120,
19
- "proseWrap": "always",
20
- "quoteProps": "consistent",
21
- "semi": false,
22
- "singleQuote": true,
23
- "sortImports": {
24
- "newlinesBetween": true
25
- },
26
- "sortPackageJson": {
27
- "sortScripts": true
28
- },
29
- "tabWidth": 4,
30
- "trailingComma": "none",
31
- "useTabs": true
2
+ "$schema": "./node_modules/oxfmt/configuration_schema.json",
3
+ "arrowParens": "avoid",
4
+ "bracketSameLine": true,
5
+ "bracketSpacing": true,
6
+ "embeddedLanguageFormatting": "auto",
7
+ "endOfLine": "lf",
8
+ "insertFinalNewline": true,
9
+ "jsdoc": {
10
+ "bracketSpacing": true,
11
+ "lineWrappingStyle": "balance",
12
+ "separateReturnsFromParam": true,
13
+ "capitalizeDescriptions": true,
14
+ "descriptionWithDot": false,
15
+ "commentLineStrategy": "multiline"
16
+ },
17
+ "objectWrap": "preserve",
18
+ "printWidth": 120,
19
+ "proseWrap": "always",
20
+ "quoteProps": "consistent",
21
+ "semi": false,
22
+ "singleQuote": true,
23
+ "sortImports": {
24
+ "newlinesBetween": true
25
+ },
26
+ "sortPackageJson": {
27
+ "sortScripts": true
28
+ },
29
+ "tabWidth": 4,
30
+ "trailingComma": "none",
31
+ "overrides": [
32
+ {
33
+ "files": ["*.yml", "*.yaml"],
34
+ "options": {
35
+ "tabWidth": 2
36
+ }
37
+ }
38
+ ]
32
39
  }
package/.oxlintrc.json CHANGED
@@ -1,35 +1,35 @@
1
1
  {
2
- "$schema": "./node_modules/oxlint/configuration_schema.json",
3
- "plugins": ["typescript", "unicorn", "oxc", "eslint", "import", "jsdoc", "node", "promise"],
4
- "categories": {
5
- "correctness": "error",
6
- "suspicious": "error",
7
- "pedantic": "warn",
8
- "perf": "warn",
9
- "style": "warn",
10
- "restriction": "off",
11
- "nursery": "off"
12
- },
13
- "rules": {
14
- "no-nodejs-modules": "off",
15
- "no-magic-numbers": "off",
16
- "no-ternary": "off",
17
- "sort-imports": ["warn", { "ignoreDeclarationSort": true }],
18
- "consistent-type-specifier-style": ["warn", "prefer-inline"],
19
- "prefer-default-export": "off",
20
- "no-named-export": "off",
21
- "prefer-readonly-parameter-types": ["warn", { "ignoreInferredTypes": true }],
22
- "group-exports": "off",
23
- "unicorn/no-useless-undefined": "off",
24
- "no-continue": "off",
25
- "require-param-type": "off",
26
- "require-returns-type": "off"
27
- },
28
- "env": {
29
- "builtin": true
30
- },
31
- "options": {
32
- "typeAware": true,
33
- "typeCheck": true
34
- }
2
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
3
+ "plugins": ["typescript", "unicorn", "oxc", "eslint", "import", "jsdoc", "node", "promise"],
4
+ "categories": {
5
+ "correctness": "error",
6
+ "suspicious": "error",
7
+ "pedantic": "warn",
8
+ "perf": "warn",
9
+ "style": "warn",
10
+ "restriction": "off",
11
+ "nursery": "off"
12
+ },
13
+ "rules": {
14
+ "no-nodejs-modules": "off",
15
+ "no-magic-numbers": "off",
16
+ "no-ternary": "off",
17
+ "sort-imports": ["warn", { "ignoreDeclarationSort": true }],
18
+ "consistent-type-specifier-style": ["warn", "prefer-inline"],
19
+ "prefer-default-export": "off",
20
+ "no-named-export": "off",
21
+ "prefer-readonly-parameter-types": ["warn", { "ignoreInferredTypes": true }],
22
+ "group-exports": "off",
23
+ "unicorn/no-useless-undefined": "off",
24
+ "no-continue": "off",
25
+ "require-param-type": "off",
26
+ "require-returns-type": "off"
27
+ },
28
+ "env": {
29
+ "builtin": true
30
+ },
31
+ "options": {
32
+ "typeAware": true,
33
+ "typeCheck": true
34
+ }
35
35
  }
@@ -1,36 +1,36 @@
1
1
  {
2
- // Use IntelliSense to learn about possible attributes.
3
- // Hover to view descriptions of existing attributes.
4
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
- "version": "0.2.0",
6
- "configurations": [
7
- {
8
- "type": "bun",
9
- "internalConsoleOptions": "neverOpen",
10
- "request": "launch",
11
- "name": "Debug File",
12
- "program": "${file}",
13
- "cwd": "${workspaceFolder}",
14
- "stopOnEntry": false,
15
- "watchMode": false
16
- },
17
- {
18
- "type": "bun",
19
- "internalConsoleOptions": "neverOpen",
20
- "request": "launch",
21
- "name": "Run File",
22
- "program": "${file}",
23
- "cwd": "${workspaceFolder}",
24
- "noDebug": true,
25
- "watchMode": false
26
- },
27
- {
28
- "type": "bun",
29
- "internalConsoleOptions": "neverOpen",
30
- "request": "attach",
31
- "name": "Attach Bun",
32
- "url": "ws://localhost:6499/",
33
- "stopOnEntry": false
34
- }
35
- ]
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "type": "bun",
9
+ "internalConsoleOptions": "neverOpen",
10
+ "request": "launch",
11
+ "name": "Debug File",
12
+ "program": "${file}",
13
+ "cwd": "${workspaceFolder}",
14
+ "stopOnEntry": false,
15
+ "watchMode": false
16
+ },
17
+ {
18
+ "type": "bun",
19
+ "internalConsoleOptions": "neverOpen",
20
+ "request": "launch",
21
+ "name": "Run File",
22
+ "program": "${file}",
23
+ "cwd": "${workspaceFolder}",
24
+ "noDebug": true,
25
+ "watchMode": false
26
+ },
27
+ {
28
+ "type": "bun",
29
+ "internalConsoleOptions": "neverOpen",
30
+ "request": "attach",
31
+ "name": "Attach Bun",
32
+ "url": "ws://localhost:6499/",
33
+ "stopOnEntry": false
34
+ }
35
+ ]
36
36
  }
@@ -1,11 +1,12 @@
1
1
  {
2
- "oxc.fmt.configPath": ".oxfmtrc.json",
3
- "editor.defaultFormatter": "oxc.oxc-vscode",
4
- "editor.formatOnSave": true,
5
- "oxc.enable.oxlint": true,
6
- "oxc.enable.oxfmt": true,
7
- "editor.codeActionsOnSave": {
8
- "source.fixAll.oxc": "always"
9
- },
10
- "files.insertFinalNewline": false
2
+ "oxc.fmt.configPath": ".oxfmtrc.json",
3
+ "editor.defaultFormatter": "oxc.oxc-vscode",
4
+ "editor.formatOnSave": true,
5
+ "oxc.enable.oxlint": true,
6
+ "oxc.enable.oxfmt": true,
7
+ "editor.codeActionsOnSave": {
8
+ "source.fixAll.oxc": "always"
9
+ },
10
+ "files.insertFinalNewline": false,
11
+ "files.trimTrailingWhitespace": true
11
12
  }
package/CHANGELOG.md ADDED
@@ -0,0 +1,58 @@
1
+ ## [1.0.1](https://github.com/nathievzm/lumi/compare/v1.0.0...v1.0.1) (2026-05-10)
2
+
3
+ ### Bug Fixes
4
+
5
+ - format arg by passing cli value ([#22](https://github.com/nathievzm/lumi/issues/22))
6
+ ([8a88391](https://github.com/nathievzm/lumi/commit/8a88391009addb9129eac53a6744affad7693ddf))
7
+ - **index, image:** add support to all image extensions using an third-party library
8
+ ([#24](https://github.com/nathievzm/lumi/issues/24))
9
+ ([183189f](https://github.com/nathievzm/lumi/commit/183189f724c3ecf444308384eb5d11de3e28ed80))
10
+ - **index, image:** exclude all files that aren't images ([#24](https://github.com/nathievzm/lumi/issues/24))
11
+ ([ebb03f4](https://github.com/nathievzm/lumi/commit/ebb03f49cc0628dd19ce303d74417f435f2fc268))
12
+
13
+ ### Features
14
+
15
+ - **package.json:** update urls for repository and bugs
16
+ ([781733a](https://github.com/nathievzm/lumi/commit/781733a84562a5e4940a4d645c5845cda496a16a))
17
+ - **prompt:** ask width and height in a single prompt ([#30](https://github.com/nathievzm/lumi/issues/30))
18
+ ([93872d4](https://github.com/nathievzm/lumi/commit/93872d42caddb6aee8da0cdacb41533bb1946ccd))
19
+ - remove prompt for input folder and assume current folder as input ([#23](https://github.com/nathievzm/lumi/issues/23))
20
+ ([f0f43c8](https://github.com/nathievzm/lumi/commit/f0f43c8841450364f130670336685b2a1b5f0aa5))
21
+ - rename package name and bin command
22
+ ([44df0a7](https://github.com/nathievzm/lumi/commit/44df0a734d6ba5e1a629a49658c1511eb01bc485))
23
+ - use current path and default name of 'output' for the output folder
24
+ ([#40](https://github.com/nathievzm/lumi/issues/40))
25
+ ([6bb9dd6](https://github.com/nathievzm/lumi/commit/6bb9dd6bc87ddb9df1aae2a374198909fc64cdfa))
26
+
27
+ # [1.0.0](https://github.com/nathievzm/lumi/compare/bd74fd40baea7cd88c4f547d1aeabcc2c53b47ac...v1.0.0) (2026-05-05)
28
+
29
+ ### Bug Fixes
30
+
31
+ - **folder:** change log type to info
32
+ ([ede37a1](https://github.com/nathievzm/lumi/commit/ede37a1485bd1b5de82d71b9722ae7686ac61d25))
33
+
34
+ ### Features
35
+
36
+ - add .env.example file ([917b862](https://github.com/nathievzm/lumi/commit/917b862a558847d16e86ca6ff94fabe33f2a5992))
37
+ - add logic to allow users select the format for each extension found in the input
38
+ ([0461325](https://github.com/nathievzm/lumi/commit/0461325e9a414ab71903b16da3f7b20fd1134bb3))
39
+ - add logic to prompt width and height if user didn't provide it via cli or env
40
+ ([d7a0a21](https://github.com/nathievzm/lumi/commit/d7a0a21eee9d3b4e1c4544e92ce0406cb26b521e))
41
+ - add prompt to ask for the input folder in case it's not by cli or env
42
+ ([59551de](https://github.com/nathievzm/lumi/commit/59551decf7a3b6cdb6e665dd28e4e20a860f642a))
43
+ - add support to specify default concurrency limit by env variable
44
+ ([eda599d](https://github.com/nathievzm/lumi/commit/eda599d88bef56af992482a58a08d3004e33d378))
45
+ - allow setting the default format and limit via cli
46
+ ([d273210](https://github.com/nathievzm/lumi/commit/d273210efb0512b8800d889974f670d96f6a302f))
47
+ - create images module and add prompt for the output folder name
48
+ ([88c68f4](https://github.com/nathievzm/lumi/commit/88c68f41b716fb2aff90b8fe82fcf7f184723eff))
49
+ - develop functionality to resize images
50
+ ([bd74fd4](https://github.com/nathievzm/lumi/commit/bd74fd40baea7cd88c4f547d1aeabcc2c53b47ac))
51
+ - implement @clack/prompts to enhance the cli ux
52
+ ([6138c15](https://github.com/nathievzm/lumi/commit/6138c15f4c484cbea711a5c1e11b59221e008097))
53
+ - implement p-limit to limit the concurrent promises
54
+ ([bb25145](https://github.com/nathievzm/lumi/commit/bb25145092d75f51845810b30de524cb1b3bdd31))
55
+ - move all helper files to the lib folder
56
+ ([9df89cf](https://github.com/nathievzm/lumi/commit/9df89cf28b1d6510fce115f7db5ef989c47cf71c))
57
+ - move logic to check the output folder to an isolated module
58
+ ([35b3e0a](https://github.com/nathievzm/lumi/commit/35b3e0ae732a60ec49ca6fea4c8e1b5388528e12))
package/README.md CHANGED
@@ -1,108 +1,108 @@
1
- # ✨ lumi ✨
2
-
3
- A fast, interactive CLI tool for batch image processing. Resize, convert, and optimize your images with ease, powered by
4
- [Bun](https://bun.sh) and [Sharp](https://sharp.pixelplumbing.com/).
5
-
6
- ## 🚀 Features
7
-
8
- - **Batch Processing:** Process hundreds of images in seconds with high concurrency.
9
- - **Interactive UI:** User-friendly prompts for missing configurations using `@clack/prompts`.
10
- - **Progress Tracking:** Real-time feedback with `spinnies` progress indicators.
11
- - **Smart Resizing:** Automatically fits images while maintaining aspect ratio (`contain` fit).
12
- - **Multi-Format Support:** Convert between all formats supported by Sharp (WebP, PNG, JPEG, GIF, AVIF, etc.).
13
- - **Animated Support:** Seamlessly handles animated GIFs and WebP files.
14
- - **Concurrency Control:** Fine-tune performance with configurable processing limits.
15
- - **Environment Driven:** Fully configurable via `.env` files or CLI flags.
16
-
17
- ## 📦 Installation
18
-
19
- You don't even need to install it if you use `bunx`! Run it directly from anywhere in your terminal:
20
-
21
- ```bash
22
- bunx @nathievzm/lumi
23
- ```
24
-
25
- Or install it globally:
26
-
27
- ```bash
28
- bun install -g @nathievzm/lumi
29
- ```
30
-
31
- ## 🛠️ Usage
32
-
33
- If installed globally, simply run:
34
-
35
- ```bash
36
- lumi [options]
37
- ```
38
-
39
- ### Interactive Mode
40
-
41
- If you run **lumi** without providing required flags (like input/output folders or dimensions), it will guide you
42
- through the configuration using cute, interactive prompts. You can even choose specific output formats for each unique
43
- extension found!
44
-
45
- ### CLI Options
46
-
47
- You can bypass the prompts by providing the flags directly:
48
-
49
- ```bash
50
- bunx @nathievzm/lumi -i ./my-vacation-pics -s 1080 -f .webp
51
- ```
52
-
53
- | Flag | Shortcut | Description | Default |
54
- | :--------- | :------- | :---------------------------- | :------------------ |
55
- | `--input` | `-i` | Input directory path | `INPUT_FOLDER` env |
56
- | `--output` | `-o` | Output directory path | `OUTPUT_FOLDER` env |
57
- | `--width` | `-w` | Target width in pixels | `WIDTH` env |
58
- | `--height` | `-h` | Target height in pixels | `HEIGHT` env |
59
- | `--size` | `-s` | Sets both width and height | - |
60
- | `--format` | `-f` | Output format (e.g., `.webp`) | `FORMAT` env |
61
- | `--limit` | `-l` | Max concurrent operations | `LIMIT` env |
62
-
63
- ### 🌍 Environment Variables
64
-
65
- **lumi** also reads from a `.env` file in your current working directory. This is useful for saving your preferred
66
- defaults:
67
-
68
- ```env
69
- WIDTH = '800'
70
- HEIGHT = '600'
71
- INPUT_FOLDER = './input'
72
- OUTPUT_FOLDER = './output'
73
- FORMAT = '.webp'
74
- LIMIT = '10'
75
- ```
76
-
77
- ---
78
-
79
- ## 🧑‍💻 Local Development
80
-
81
- If you want to contribute or run the project from source:
82
-
83
- ### Clone the repository
84
-
85
- ```bash
86
- git clone https://github.com/nathievzm/lumi.git
87
- cd lumi
88
- ```
89
-
90
- ### Install dependencies
91
-
92
- ```bash
93
- bun install
94
- ```
95
-
96
- ### Available Scripts
97
-
98
- - `bun start`: Run the application.
99
- - `bun dev`: Start with hot reloading.
100
- - `bun lint`: Check for code quality issues.
101
- - `bun lint:fix`: Fix linting issues automatically.
102
- - `bun fmt`: Format the codebase.
103
- - `bun fmt:check`: Check for formatting issues.
104
- - `bun prepare`: Setup husky hooks.
105
-
106
- ## 📄 License
107
-
108
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
1
+ # ✨ lumi ✨
2
+
3
+ A fast, interactive CLI tool for batch image processing. Resize, convert, and optimize your images with ease, powered by
4
+ [Bun](https://bun.sh) and [Sharp](https://sharp.pixelplumbing.com/).
5
+
6
+ ## 🚀 Features
7
+
8
+ - **Batch Processing:** Process hundreds of images in seconds with high concurrency.
9
+ - **Interactive UI:** User-friendly prompts for missing configurations using `@clack/prompts`.
10
+ - **Progress Tracking:** Real-time feedback with `spinnies` progress indicators.
11
+ - **Smart Resizing:** Automatically fits images while maintaining aspect ratio (`contain` fit).
12
+ - **Multi-Format Support:** Convert between all formats supported by Sharp (WebP, PNG, JPEG, GIF, AVIF, etc.).
13
+ - **Animated Support:** Seamlessly handles animated GIFs and WebP files.
14
+ - **Concurrency Control:** Fine-tune performance with configurable processing limits.
15
+ - **Environment Driven:** Fully configurable via `.env` files or CLI flags.
16
+
17
+ ## 📦 Installation
18
+
19
+ You don't even need to install it if you use `bunx`! Run it directly from anywhere in your terminal:
20
+
21
+ ```bash
22
+ bunx @nathievzm/lumi
23
+ ```
24
+
25
+ Or install it globally:
26
+
27
+ ```bash
28
+ bun install -g @nathievzm/lumi
29
+ ```
30
+
31
+ ## 🛠️ Usage
32
+
33
+ If installed globally, simply run:
34
+
35
+ ```bash
36
+ lumi [options]
37
+ ```
38
+
39
+ ### Interactive Mode
40
+
41
+ If you run **lumi** without providing required flags (like input/output folders or dimensions), it will guide you
42
+ through the configuration using cute, interactive prompts. You can even choose specific output formats for each unique
43
+ extension found!
44
+
45
+ ### CLI Options
46
+
47
+ You can bypass the prompts by providing the flags directly:
48
+
49
+ ```bash
50
+ bunx @nathievzm/lumi -i ./my-vacation-pics -s 1080 -f .webp
51
+ ```
52
+
53
+ | Flag | Shortcut | Description | Default |
54
+ | :--------- | :------- | :---------------------------- | :------------------ |
55
+ | `--input` | `-i` | Input directory path | `INPUT_FOLDER` env |
56
+ | `--output` | `-o` | Output directory path | `OUTPUT_FOLDER` env |
57
+ | `--width` | `-w` | Target width in pixels | `WIDTH` env |
58
+ | `--height` | `-h` | Target height in pixels | `HEIGHT` env |
59
+ | `--size` | `-s` | Sets both width and height | - |
60
+ | `--format` | `-f` | Output format (e.g., `.webp`) | `FORMAT` env |
61
+ | `--limit` | `-l` | Max concurrent operations | `LIMIT` env |
62
+
63
+ ### 🌍 Environment Variables
64
+
65
+ **lumi** also reads from a `.env` file in your current working directory. This is useful for saving your preferred
66
+ defaults:
67
+
68
+ ```env
69
+ WIDTH = '800'
70
+ HEIGHT = '600'
71
+ INPUT_FOLDER = './input'
72
+ OUTPUT_FOLDER = './output'
73
+ FORMAT = '.webp'
74
+ LIMIT = '10'
75
+ ```
76
+
77
+ ---
78
+
79
+ ## 🧑‍💻 Local Development
80
+
81
+ If you want to contribute or run the project from source:
82
+
83
+ ### Clone the repository
84
+
85
+ ```bash
86
+ git clone https://github.com/nathievzm/lumi.git
87
+ cd lumi
88
+ ```
89
+
90
+ ### Install dependencies
91
+
92
+ ```bash
93
+ bun install
94
+ ```
95
+
96
+ ### Available Scripts
97
+
98
+ - `bun start`: Run the application.
99
+ - `bun dev`: Start with hot reloading.
100
+ - `bun lint`: Check for code quality issues.
101
+ - `bun lint:fix`: Fix linting issues automatically.
102
+ - `bun fmt`: Format the codebase.
103
+ - `bun fmt:check`: Check for formatting issues.
104
+ - `bun prepare`: Setup husky hooks.
105
+
106
+ ## 📄 License
107
+
108
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
package/lefthook.yml ADDED
@@ -0,0 +1,24 @@
1
+ pre-commit:
2
+ # running all checks at the same time for maximum speed ⚡
3
+ parallel: true
4
+ jobs:
5
+ - name: format
6
+ glob: '*.{ts,js,json,yml,yaml,md}'
7
+ run: bun fmt {staged_files} && git add {staged_files}
8
+
9
+ - name: lint
10
+ run: bun lint
11
+
12
+ - name: types
13
+ run: bunx --bun tsc --noEmit
14
+
15
+ commit-msg:
16
+ jobs:
17
+ - name: commitlint
18
+ # using bun to run commitlint as fast as possible 🌸
19
+ run: bunx --bun commitlint --edit {1}
20
+
21
+ pre-push:
22
+ jobs:
23
+ - name: test-placeholder
24
+ run: echo "ready to push! tests will go here in the future ✨"