@moneymap/ui 0.0.3 → 0.0.5

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,283 +1,404 @@
1
- # @moneymap/ui
2
-
3
- This guide explains how to build and publish the `@moneymap/ui` library to npm registry.
4
-
5
- ## Prerequisites
6
-
7
- - Node.js and pnpm installed
8
- - npm account with access to publish to `@moneymap` scope
9
- - Access to the MoneyMap monorepo
10
-
11
- ## Project Structure
12
-
13
- ```
14
- libs/ui/
15
- ├── src/ # Source components
16
- ├── dist/ # Build output (generated)
17
- ├── package.json # Package configuration
18
- ├── rollup.config.cjs # Build configuration
19
- └── README.md # This file
20
- ```
21
-
22
- ## Publishing Workflow
23
-
24
- ### 1. Clean and Build
25
-
26
- Reset Nx cache and build the library:
27
-
28
- ```bash
29
- # From workspace root
30
- nx reset
31
- nx build ui
32
- ```
33
-
34
- This generates the build output in `libs/ui/dist/`:
35
- - `dist/index.esm.js` - Compiled JavaScript bundle
36
- - `dist/index.d.ts` - TypeScript declarations
37
- - `dist/src/` - Source files for `@moneymap/source` export
38
-
39
- ### 2. Login to npm
40
-
41
- Ensure you're logged into npm with an account that has publish access:
42
-
43
- ```bash
44
- npm login
45
- ```
46
-
47
- Verify your login:
48
-
49
- ```bash
50
- npm whoami
51
- ```
52
-
53
- ### 3. Test Package (Dry Run)
54
-
55
- Preview what will be published without actually publishing:
56
-
57
- ```bash
58
- cd libs/ui
59
- npm pack --dry-run
60
- ```
61
-
62
- **Expected output should include:**
63
- - ✅ `dist/index.esm.js`
64
- - ✅ `dist/index.d.ts`
65
- - `dist/src/` (source files)
66
- - ✅ `package.json`
67
- - ✅ `README.md`
68
- - ❌ No config files (`.babelrc`, `rollup.config.cjs`, `tsconfig.*`)
69
-
70
- ### 4. Version Bump
71
-
72
- **Important:** You must increment the version before publishing.
73
-
74
- #### For Prerelease (Alpha/Beta)
75
-
76
- ```bash
77
- # From libs/ui/
78
- npm version prerelease --preid=alpha
79
- # Example: 0.0.1-alpha.0 → 0.0.1-alpha.1
80
- # Example: 0.0.1-beta.0 → 0.0.1-beta.1
81
- ```
82
-
83
- #### For Patch Release
84
-
85
- ```bash
86
- npm version patch
87
- # Example: 0.0.1 → 0.0.2
88
- ```
89
-
90
- #### For Minor Release
91
-
92
- ```bash
93
- npm version minor
94
- # Example: 0.0.1 → 0.1.0
95
- ```
96
-
97
- #### For Major Release
98
-
99
- ```bash
100
- npm version major
101
- # Example: 0.0.3 → 1.0.0
102
- ```
103
-
104
- #### Manual Version Update
105
-
106
- Alternatively, edit `libs/ui/package.json` directly:
107
-
108
- ```json
109
- {
110
- "version": "0.0.1"
111
- }
112
- ```
113
-
114
- ### 5. Publish to npm
115
-
116
- #### Publish Prerelease (Alpha/Beta)
117
-
118
- ```bash
119
- # From libs/ui/
120
- npm publish --tag alpha --access public
121
- ```
122
-
123
- This publishes with the `alpha` tag, so it won't become the default `latest` version.
124
-
125
- **Installing prerelease:**
126
- ```bash
127
- npm install @moneymap/ui@alpha
128
- # or specific version
129
- npm install @moneymap/ui@0.0.3-alpha.1
130
- ```
131
-
132
- #### Publish Stable Release
133
-
134
- ```bash
135
- # From libs/ui/
136
- npm publish --access public
137
- ```
138
-
139
- This publishes with the `latest` tag (default).
140
-
141
- **Installing stable:**
142
- ```bash
143
- npm install @moneymap/ui
144
- ```
145
-
146
- ### 6. Verify Publication
147
-
148
- Check the published package:
149
-
150
- ```bash
151
- npm view @moneymap/ui
152
-
153
- # Check all versions
154
- npm view @moneymap/ui versions
155
-
156
- # Check dist-tags
157
- npm view @moneymap/ui dist-tags
158
- ```
159
-
160
- ## Quick Reference Commands
161
-
162
- ```bash
163
- # Full deployment workflow (stable release)
164
- nx reset
165
- nx build ui
166
- cd libs/ui
167
- npm pack --dry-run # Verify package contents
168
- npm version patch # Bump version
169
- npm publish --access public # Publish
170
-
171
- # Full deployment workflow (prerelease)
172
- nx reset
173
- nx build ui
174
- cd libs/ui
175
- npm pack --dry-run
176
- npm version prerelease --preid=alpha
177
- npm publish --tag alpha --access public
178
- ```
179
-
180
- ## Troubleshooting
181
-
182
- ### Cannot publish over previously published version
183
-
184
- You're trying to publish a version that already exists. Bump the version number:
185
-
186
- ```bash
187
- npm version patch
188
- ```
189
-
190
- ### Package includes unwanted files
191
-
192
- Check the `files` field in `libs/ui/package.json`:
193
-
194
- ```json
195
- {
196
- "files": [
197
- "dist",
198
- "src/**/*.ts",
199
- "src/**/*.tsx",
200
- "!src/**/*.test.ts",
201
- "!src/**/*.spec.ts"
202
- ]
203
- }
204
- ```
205
-
206
- Run `npm pack --dry-run` to preview before publishing.
207
-
208
- ## Package Configuration
209
-
210
- ### package.json
211
-
212
- The `libs/ui/package.json` controls what gets published:
213
-
214
- ```json
215
- {
216
- "name": "@moneymap/ui",
217
- "version": "0.0.1",
218
- "main": "./dist/index.esm.js",
219
- "types": "./dist/index.d.ts",
220
- "exports": {
221
- ".": {
222
- "@moneymap/source": "./src/index.ts",
223
- "types": "./dist/index.d.ts",
224
- "import": "./dist/index.esm.js"
225
- }
226
- },
227
- "files": [
228
- "dist",
229
- "src/**/*.ts",
230
- "src/**/*.tsx",
231
- "!src/**/*.test.ts",
232
- "!src/**/*.spec.ts"
233
- ]
234
- }
235
- ```
236
-
237
- ### rollup.config.cjs
238
-
239
- The build configuration uses Rollup with SWC for fast compilation:
240
-
241
- ```javascript
242
- module.exports = withNx({
243
- main: './src/index.ts',
244
- outputPath: './dist',
245
- compiler: 'swc',
246
- format: ['esm'],
247
- external: ['react', 'react-dom', 'react/jsx-runtime'],
248
- assets: [
249
- { input: '.', output: '.', glob: 'README.md' },
250
- {
251
- input: './src',
252
- output: './src',
253
- glob: '**/*.ts',
254
- ignore: ['**/*.spec.ts', '**/*.test.ts'],
255
- },
256
- {
257
- input: './src',
258
- output: './src',
259
- glob: '**/*.tsx',
260
- ignore: ['**/*.spec.tsx', '**/*.test.tsx'],
261
- },
262
- ]
263
- });
264
- ```
265
-
266
- ## Version Strategy
267
-
268
- - **Prerelease (alpha/beta):** For testing new features
269
- - Format: `0.0.1-alpha.0`, `0.0.1-beta.1`
270
- - Publish with: `npm publish --tag alpha`
271
-
272
- - **Patch (0.0.x):** Bug fixes and minor changes
273
- - Command: `npm version patch`
274
-
275
- - **Minor (0.x.0):** New features, backward compatible
276
- - Command: `npm version minor`
277
-
278
- - **Major (x.0.0):** Breaking changes
279
- - Command: `npm version major`
280
-
281
- ## Support
282
-
283
- For questions or issues, contact the MoneyMap development team.
1
+ # @moneymap/ui
2
+
3
+ > **⚠️ Tailwind CSS v3 Required:** This library requires Tailwind CSS to be configured in your project. See [Setup](#setup-required) below.
4
+
5
+ ## Setup Required
6
+
7
+ ### Tailwind CSS v3 Setup
8
+
9
+ 1. **Install Tailwind CSS:**
10
+
11
+ ```bash
12
+ npm install -D tailwindcss postcss autoprefixer
13
+ npx tailwindcss init -p
14
+ ```
15
+
16
+ 2. **Configure Tailwind to scan the library** (`tailwind.config.js`):
17
+
18
+ ```javascript
19
+ /** @type {import('tailwindcss').Config} */
20
+ module.exports = {
21
+ content: [
22
+ './src/**/*.{js,jsx,ts,tsx}',
23
+ './node_modules/@moneymap/ui/**/*.{js,jsx,ts,tsx}', // Add this
24
+ ],
25
+ theme: {
26
+ extend: {
27
+ colors: {
28
+ border: 'hsl(var(--border))',
29
+ input: 'hsl(var(--input))',
30
+ ring: 'hsl(var(--ring))',
31
+ background: 'hsl(var(--background))',
32
+ foreground: 'hsl(var(--foreground))',
33
+ primary: {
34
+ DEFAULT: 'hsl(var(--primary))',
35
+ foreground: 'hsl(var(--primary-foreground))',
36
+ },
37
+ secondary: {
38
+ DEFAULT: 'hsl(var(--secondary))',
39
+ foreground: 'hsl(var(--secondary-foreground))',
40
+ },
41
+ destructive: {
42
+ DEFAULT: 'hsl(var(--destructive))',
43
+ foreground: 'hsl(var(--destructive-foreground))',
44
+ },
45
+ muted: {
46
+ DEFAULT: 'hsl(var(--muted))',
47
+ foreground: 'hsl(var(--muted-foreground))',
48
+ },
49
+ accent: {
50
+ DEFAULT: 'hsl(var(--accent))',
51
+ foreground: 'hsl(var(--accent-foreground))',
52
+ },
53
+ },
54
+ borderRadius: {
55
+ lg: 'var(--radius)',
56
+ md: 'calc(var(--radius) - 2px)',
57
+ sm: 'calc(var(--radius) - 4px)',
58
+ },
59
+ },
60
+ },
61
+ plugins: [],
62
+ };
63
+ ```
64
+
65
+ 3. **Add CSS variables to your global CSS** (e.g., `globals.css` or `index.css`):
66
+
67
+ ```css
68
+ @tailwind base;
69
+ @tailwind components;
70
+ @tailwind utilities;
71
+
72
+ @layer base {
73
+ :root {
74
+ --background: 0 0% 100%;
75
+ --foreground: 240 10% 3.9%;
76
+ --card: 0 0% 100%;
77
+ --card-foreground: 240 10% 3.9%;
78
+ --primary: 240 5.9% 10%;
79
+ --primary-foreground: 0 0% 98%;
80
+ --secondary: 240 4.8% 95.9%;
81
+ --secondary-foreground: 240 5.9% 10%;
82
+ --muted: 240 4.8% 95.9%;
83
+ --muted-foreground: 240 3.8% 46.1%;
84
+ --accent: 240 4.8% 95.9%;
85
+ --accent-foreground: 240 5.9% 10%;
86
+ --destructive: 0 84.2% 60.2%;
87
+ --destructive-foreground: 0 0% 98%;
88
+ --border: 240 5.9% 90%;
89
+ --input: 240 5.9% 90%;
90
+ --ring: 240 5.9% 10%;
91
+ --radius: 0.5rem;
92
+ }
93
+
94
+ .dark {
95
+ --background: 240 10% 3.9%;
96
+ --foreground: 0 0% 98%;
97
+ --card: 240 10% 3.9%;
98
+ --card-foreground: 0 0% 98%;
99
+ --primary: 0 0% 98%;
100
+ --primary-foreground: 240 5.9% 10%;
101
+ --secondary: 240 3.7% 15.9%;
102
+ --secondary-foreground: 0 0% 98%;
103
+ --muted: 240 3.7% 15.9%;
104
+ --muted-foreground: 240 5% 64.9%;
105
+ --accent: 240 3.7% 15.9%;
106
+ --accent-foreground: 0 0% 98%;
107
+ --destructive: 0 62.8% 30.6%;
108
+ --destructive-foreground: 0 0% 98%;
109
+ --border: 240 3.7% 15.9%;
110
+ --input: 240 3.7% 15.9%;
111
+ --ring: 240 4.9% 83.9%;
112
+ }
113
+ }
114
+ ```
115
+
116
+ ---
117
+
118
+ # Maintainers
119
+
120
+ The sections below are for developers who need to build and publish the `@moneymap/ui` library to npm registry.
121
+
122
+ ## Prerequisites
123
+
124
+ - Node.js and pnpm installed
125
+ - npm account with access to publish to `@moneymap` scope
126
+ - Access to the MoneyMap monorepo
127
+
128
+ ## Project Structure
129
+
130
+ ```
131
+ libs/ui/
132
+ ├── src/ # Source components
133
+ ├── dist/ # Build output (generated)
134
+ ├── package.json # Package configuration
135
+ ├── rollup.config.cjs # Build configuration
136
+ └── README.md # This file
137
+ ```
138
+
139
+ ## Publishing Workflow
140
+
141
+ ### 1. Clean and Build
142
+
143
+ Reset Nx cache and build the library:
144
+
145
+ ```bash
146
+ # From workspace root
147
+ nx reset
148
+ nx build ui
149
+ ```
150
+
151
+ This generates the build output in `libs/ui/dist/`:
152
+
153
+ - `dist/index.esm.js` - Compiled JavaScript bundle
154
+ - `dist/index.d.ts` - TypeScript declarations
155
+ - `dist/src/` - Source files for `@moneymap/source` export
156
+
157
+ ### 2. Login to npm
158
+
159
+ Ensure you're logged into npm with an account that has publish access:
160
+
161
+ ```bash
162
+ npm login
163
+ ```
164
+
165
+ Verify your login:
166
+
167
+ ```bash
168
+ npm whoami
169
+ ```
170
+
171
+ ### 3. Test Package (Dry Run)
172
+
173
+ Preview what will be published without actually publishing:
174
+
175
+ ```bash
176
+ cd libs/ui
177
+ npm pack --dry-run
178
+ ```
179
+
180
+ **Expected output should include:**
181
+
182
+ - `dist/index.esm.js`
183
+ - ✅ `dist/index.d.ts`
184
+ - `dist/src/` (source files)
185
+ - ✅ `package.json`
186
+ - ✅ `README.md`
187
+ - No config files (`.babelrc`, `rollup.config.cjs`, `tsconfig.*`)
188
+
189
+ ### 4. Version Bump
190
+
191
+ **Important:** You must increment the version before publishing.
192
+
193
+ #### For Prerelease (Alpha/Beta)
194
+
195
+ ```bash
196
+ # From libs/ui/
197
+ npm version prerelease --preid=alpha
198
+ # Example: 0.0.1-alpha.0 → 0.0.1-alpha.1
199
+ # Example: 0.0.1-beta.0 → 0.0.1-beta.1
200
+ ```
201
+
202
+ #### For Patch Release
203
+
204
+ ```bash
205
+ npm version patch
206
+ # Example: 0.0.1 0.0.2
207
+ ```
208
+
209
+ #### For Minor Release
210
+
211
+ ```bash
212
+ npm version minor
213
+ # Example: 0.0.1 → 0.1.0
214
+ ```
215
+
216
+ #### For Major Release
217
+
218
+ ```bash
219
+ npm version major
220
+ # Example: 0.0.1 → 1.0.0
221
+ ```
222
+
223
+ #### Manual Version Update
224
+
225
+ Alternatively, edit `libs/ui/package.json` directly:
226
+
227
+ ```json
228
+ {
229
+ "version": "0.0.1"
230
+ }
231
+ ```
232
+
233
+ ### 5. Publish to npm
234
+
235
+ #### Publish Prerelease (Alpha/Beta)
236
+
237
+ ```bash
238
+ # From libs/ui/
239
+ npm publish --tag alpha --access public
240
+ ```
241
+
242
+ This publishes with the `alpha` tag, so it won't become the default `latest` version.
243
+
244
+ **Installing prerelease:**
245
+
246
+ ```bash
247
+ npm install @moneymap/ui@alpha
248
+ # or specific version
249
+ npm install @moneymap/ui@0.0.1-alpha.1
250
+ ```
251
+
252
+ #### Publish Stable Release
253
+
254
+ ```bash
255
+ # From libs/ui/
256
+ npm publish --access public
257
+ ```
258
+
259
+ This publishes with the `latest` tag (default).
260
+
261
+ **Installing stable:**
262
+
263
+ ```bash
264
+ npm install @moneymap/ui
265
+ ```
266
+
267
+ ### 6. Verify Publication
268
+
269
+ Check the published package:
270
+
271
+ ```bash
272
+ npm view @moneymap/ui
273
+
274
+ # Check all versions
275
+ npm view @moneymap/ui versions
276
+
277
+ # Check dist-tags
278
+ npm view @moneymap/ui dist-tags
279
+ ```
280
+
281
+ ## Quick Reference Commands
282
+
283
+ ```bash
284
+ # Full deployment workflow (stable release)
285
+ nx reset
286
+ nx build ui
287
+ cd libs/ui
288
+ npm pack --dry-run # Verify package contents
289
+ npm version patch # Bump version
290
+ npm publish --access public # Publish
291
+
292
+ # Full deployment workflow (prerelease)
293
+ nx reset
294
+ nx build ui
295
+ cd libs/ui
296
+ npm pack --dry-run
297
+ npm version prerelease --preid=alpha
298
+ npm publish --tag alpha --access public
299
+ ```
300
+
301
+ ## Troubleshooting
302
+
303
+ ### Cannot publish over previously published version
304
+
305
+ You're trying to publish a version that already exists. Bump the version number:
306
+
307
+ ```bash
308
+ npm version patch
309
+ ```
310
+
311
+ ### Package includes unwanted files
312
+
313
+ Check the `files` field in `libs/ui/package.json`:
314
+
315
+ ```json
316
+ {
317
+ "files": [
318
+ "dist",
319
+ "src/**/*.ts",
320
+ "src/**/*.tsx",
321
+ "!src/**/*.test.ts",
322
+ "!src/**/*.spec.ts"
323
+ ]
324
+ }
325
+ ```
326
+
327
+ Run `npm pack --dry-run` to preview before publishing.
328
+
329
+ ## Package Configuration
330
+
331
+ ### package.json
332
+
333
+ The `libs/ui/package.json` controls what gets published:
334
+
335
+ ```json
336
+ {
337
+ "name": "@moneymap/ui",
338
+ "version": "0.0.1",
339
+ "main": "./dist/index.esm.js",
340
+ "types": "./dist/index.d.ts",
341
+ "exports": {
342
+ ".": {
343
+ "@moneymap/source": "./src/index.ts",
344
+ "types": "./dist/index.d.ts",
345
+ "import": "./dist/index.esm.js"
346
+ }
347
+ },
348
+ "files": [
349
+ "dist",
350
+ "src/**/*.ts",
351
+ "src/**/*.tsx",
352
+ "!src/**/*.test.ts",
353
+ "!src/**/*.spec.ts"
354
+ ]
355
+ }
356
+ ```
357
+
358
+ ### rollup.config.cjs
359
+
360
+ The build configuration uses Rollup with SWC for fast compilation:
361
+
362
+ ```javascript
363
+ module.exports = withNx({
364
+ main: './src/index.ts',
365
+ outputPath: './dist',
366
+ compiler: 'swc',
367
+ format: ['esm'],
368
+ external: ['react', 'react-dom', 'react/jsx-runtime'],
369
+ assets: [
370
+ { input: '.', output: '.', glob: 'README.md' },
371
+ {
372
+ input: './src',
373
+ output: './src',
374
+ glob: '**/*.ts',
375
+ ignore: ['**/*.spec.ts', '**/*.test.ts'],
376
+ },
377
+ {
378
+ input: './src',
379
+ output: './src',
380
+ glob: '**/*.tsx',
381
+ ignore: ['**/*.spec.tsx', '**/*.test.tsx'],
382
+ },
383
+ ],
384
+ });
385
+ ```
386
+
387
+ ## Version Strategy
388
+
389
+ - **Prerelease (alpha/beta):** For testing new features
390
+ - Format: `0.0.1-alpha.0`, `0.0.1-beta.1`
391
+ - Publish with: `npm publish --tag alpha`
392
+
393
+ - **Patch (0.0.x):** Bug fixes and minor changes
394
+ - Command: `npm version patch`
395
+
396
+ - **Minor (0.x.0):** New features, backward compatible
397
+ - Command: `npm version minor`
398
+
399
+ - **Major (x.0.0):** Breaking changes
400
+ - Command: `npm version major`
401
+
402
+ ## Support
403
+
404
+ For questions or issues, contact the MoneyMap development team.