simple-merge-class-names 2.0.0 → 2.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.
Files changed (2) hide show
  1. package/README.md +33 -28
  2. package/package.json +38 -38
package/README.md CHANGED
@@ -7,13 +7,16 @@ A straightforward utility for merging CSS class names in `React + Tailwind` and
7
7
  - [Installation](#installation)
8
8
  - [Install Prettier With VSCode (Most Recommended)](#install-prettier-with-vscode-most-recommended)
9
9
  - [Usage](#usage)
10
+
10
11
  - [Workflow To Minimize Typing Strain](#workflow-to-minimize-typing-strain)
12
+
13
+ - [Argument Handling](#argument-handling)
14
+ - [Breaking Changes From Version 1.X.X](#breaking-changes-from-version-1xx)
15
+ - [Testing](#testing)
16
+ - [Source Code](#source-code)
11
17
  - [Why the Mismatch Between Exported Function and Package Name?](#why-the-mismatch-between-exported-function-and-package-name)
12
18
  - [Where This Package Excels](#where-this-package-excels)
13
- - [Source Code](#source-code)
14
- - [Argument Handling](#argument-handling)
15
- - [Changes From Version 1.X.X](#changes-from-version-1xx)
16
- - [Testing](#testing)
19
+
17
20
  - [Production Considerations](#production-considerations)
18
21
  - [License](#license)
19
22
 
@@ -90,15 +93,29 @@ function MyComponent() {
90
93
  - Replaces single quotes with double quotes.
91
94
  - Neatly arranges each class name on a new line.
92
95
 
93
- ## Why the Mismatch Between Exported Function and Package Name?
96
+ ## Argument Handling
94
97
 
95
- I wanted to name the package as `mergeClassNames` to reflect the single exported function, but the NPM Package Registry does not allow capital letters, only lower case and dash characters.
98
+ `mergeClassNames` only accepts **_non-empty string values_**, everything else like empty strings (`""`), `null`, `undefined`, numbers, objects and arrays is _ignored_. This ensures stricter and predictable output.
96
99
 
97
- In addition there was already a package named `merge-class-names` but it is no longer maintained (and the developer recommends `clsx` instead).
100
+ ### Breaking Changes From Version 1.X.X
98
101
 
99
- ## Where This Package Excels
102
+ In pervious versions, arguments that were not strings were implicitly converted to strings by the JavaScript engine.
100
103
 
101
- While similar packages exist (`clsx`) with better features and potentially improved performance, `simple-merge-class-names` focuses on being very straightforward and easy to reason about, as defined in its source code.
104
+ ## Testing
105
+
106
+ This project uses `Vitest` as the test runner for fast, modern testing.
107
+
108
+ #### Run All Testing Once
109
+
110
+ ```bash
111
+ pnpm test
112
+ ```
113
+
114
+ #### Run Tests In Watch Mode
115
+
116
+ ```bash
117
+ pnpm test:watch
118
+ ```
102
119
 
103
120
  ## Source Code
104
121
 
@@ -126,29 +143,15 @@ export const mergeClassNames = (...args) => {
126
143
  };
127
144
  ```
128
145
 
129
- ### Argument Handling
130
-
131
- `mergeClassNames` only accepts **_non-empty string values_**, everything else like empty strings (`""`), `null`, `undefined`, numbers, objects and arrays is _ignored_. This ensures stricter and predictable output.
132
-
133
- #### Breaking Changes From Version 1.X.X
134
-
135
- In pervious versions, arguments that were not strings were implicitly converted to strings by the JavaScript engine.
136
-
137
- ### Testing
138
-
139
- This project uses `Vitest` as the test runner for fast, modern testing.
146
+ ## Why the Mismatch Between Exported Function and Package Name?
140
147
 
141
- #### Run All Testing Once
148
+ I wanted to name the package as `mergeClassNames` to reflect the single exported function, but the NPM Package Registry does not allow capital letters, only lower case and dash characters.
142
149
 
143
- ```bash
144
- pnpm test
145
- ```
150
+ In addition there was already a package named `merge-class-names` but it is no longer maintained (and the developer recommends `clsx` instead).
146
151
 
147
- #### Run Tests In Watch Mode
152
+ ## Where This Package Excels
148
153
 
149
- ```bash
150
- pnpm test:watch
151
- ```
154
+ While similar packages exist (`clsx`) with better features and potentially improved performance, `simple-merge-class-names` focuses on being very straightforward and easy to reason about, as defined in its source code.
152
155
 
153
156
  ## Production Considerations
154
157
 
@@ -158,4 +161,6 @@ If you are considering this package for production, you might also want to look
158
161
 
159
162
  This project is licensed under the AGPL-3.0 License. See `LICENSE.txt` for full details.
160
163
 
164
+ ---
165
+
161
166
  Enjoy 😉
package/package.json CHANGED
@@ -1,38 +1,38 @@
1
- {
2
- "name": "simple-merge-class-names",
3
- "version": "2.0.0",
4
- "description": "Example usage: <div className = {mergeClassNames('flex', 'flex-col')}/>",
5
- "main": "mergeClassNames.js",
6
- "exports": "./mergeClassNames.js",
7
- "files": [
8
- "package.json",
9
- "mergeClassNames.js",
10
- "LICENSE.txt",
11
- "README.md"
12
- ],
13
- "scripts": {
14
- "test": "vitest",
15
- "test:watch": "vitest --watch",
16
- "test:ui": "vitest --ui"
17
- },
18
- "keywords": [
19
- "merge",
20
- "class-names-merger",
21
- "utility",
22
- "react",
23
- "tailwindcss"
24
- ],
25
- "author": "Abdullah Fatota",
26
- "license": "AGPL-3.0",
27
- "repository": {
28
- "type": "git",
29
- "url": "git+https://github.com/new-AF/simple-merge-class-names.git"
30
- },
31
- "bugs": {
32
- "url": "https://github.com/new-AF/simple-merge-class-names/issues"
33
- },
34
- "homepage": "https://github.com/new-AF/simple-merge-class-names",
35
- "devDependencies": {
36
- "vitest": "^3.2.3"
37
- }
38
- }
1
+ {
2
+ "name": "simple-merge-class-names",
3
+ "version": "2.0.1",
4
+ "description": "Example usage: <div className = {mergeClassNames('flex', 'flex-col')}/>",
5
+ "main": "mergeClassNames.js",
6
+ "exports": "./mergeClassNames.js",
7
+ "files": [
8
+ "package.json",
9
+ "mergeClassNames.js",
10
+ "LICENSE.txt",
11
+ "README.md"
12
+ ],
13
+ "scripts": {
14
+ "test": "vitest",
15
+ "test:watch": "vitest --watch",
16
+ "test:ui": "vitest --ui"
17
+ },
18
+ "keywords": [
19
+ "merge",
20
+ "class-names-merger",
21
+ "utility",
22
+ "react",
23
+ "tailwindcss"
24
+ ],
25
+ "author": "Abdullah Fatota",
26
+ "license": "AGPL-3.0",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/new-AF/simple-merge-class-names.git"
30
+ },
31
+ "bugs": {
32
+ "url": "https://github.com/new-AF/simple-merge-class-names/issues"
33
+ },
34
+ "homepage": "https://github.com/new-AF/simple-merge-class-names",
35
+ "devDependencies": {
36
+ "vitest": "^3.2.3"
37
+ }
38
+ }