vinh-ui-button 3.1.0
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 +7 -0
- package/dist/README.md +203 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.css +7 -0
- package/dist/index.esm.js +14 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/lib/button/ui.d.ts +3 -0
- package/dist/src/lib/button/ui.d.ts.map +1 -0
- package/package.json +21 -0
package/README.md
ADDED
package/dist/README.md
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# Nx TypeScript Repository
|
|
2
|
+
|
|
3
|
+
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
|
|
4
|
+
|
|
5
|
+
โจ A repository showcasing key [Nx](https://nx.dev) features for TypeScript monorepos โจ
|
|
6
|
+
|
|
7
|
+
## ๐ฆ Project Overview
|
|
8
|
+
|
|
9
|
+
This repository demonstrates a production-ready TypeScript monorepo with:
|
|
10
|
+
|
|
11
|
+
- **3 Publishable Packages** - Ready for NPM publishing
|
|
12
|
+
|
|
13
|
+
- `@org/strings` - String manipulation utilities
|
|
14
|
+
- `@org/async` - Async utility functions with retry logic
|
|
15
|
+
- `@org/colors` - Color conversion and manipulation utilities
|
|
16
|
+
|
|
17
|
+
- **1 Internal Library**
|
|
18
|
+
- `@org/utils` - Shared utilities (private, not published)
|
|
19
|
+
|
|
20
|
+
## ๐ Quick Start
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Clone the repository
|
|
24
|
+
git clone <your-fork-url>
|
|
25
|
+
cd typescript-template
|
|
26
|
+
|
|
27
|
+
# Install dependencies
|
|
28
|
+
npm install
|
|
29
|
+
|
|
30
|
+
# Build all packages
|
|
31
|
+
npx nx run-many -t build
|
|
32
|
+
|
|
33
|
+
# Run tests
|
|
34
|
+
npx nx run-many -t test
|
|
35
|
+
|
|
36
|
+
# Lint all projects
|
|
37
|
+
npx nx run-many -t lint
|
|
38
|
+
|
|
39
|
+
# Run everything in parallel
|
|
40
|
+
npx nx run-many -t lint test build --parallel=3
|
|
41
|
+
|
|
42
|
+
# Visualize the project graph
|
|
43
|
+
npx nx graph
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## โญ Featured Nx Capabilities
|
|
47
|
+
|
|
48
|
+
This repository showcases several powerful Nx features:
|
|
49
|
+
|
|
50
|
+
### 1. ๐ Module Boundaries
|
|
51
|
+
|
|
52
|
+
Enforces architectural constraints using tags. Each package has specific dependencies it can use:
|
|
53
|
+
|
|
54
|
+
- `scope:shared` (utils) - Can be used by all packages
|
|
55
|
+
- `scope:strings` - Can only depend on shared utilities
|
|
56
|
+
- `scope:async` - Can only depend on shared utilities
|
|
57
|
+
- `scope:colors` - Can only depend on shared utilities
|
|
58
|
+
|
|
59
|
+
**Try it out:**
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# See the current project graph and boundaries
|
|
63
|
+
npx nx graph
|
|
64
|
+
|
|
65
|
+
# View a specific project's details
|
|
66
|
+
npx nx show project strings --web
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
[Learn more about module boundaries โ](https://nx.dev/features/enforce-module-boundaries)
|
|
70
|
+
|
|
71
|
+
### 2. ๐ ๏ธ Custom Run Commands
|
|
72
|
+
|
|
73
|
+
Packages can define custom commands beyond standard build/test/lint:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Run the custom build-base command for strings package
|
|
77
|
+
npx nx run strings:build-base
|
|
78
|
+
|
|
79
|
+
# See all available targets for a project
|
|
80
|
+
npx nx show project strings
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
[Learn more about custom run commands โ](https://nx.dev/concepts/executors-and-configurations)
|
|
84
|
+
|
|
85
|
+
### 3. ๐ง Self-Healing CI
|
|
86
|
+
|
|
87
|
+
The CI pipeline includes `nx fix-ci` which automatically identifies and suggests fixes for common issues. To test it, you can make a change to `async-retry.spec.ts` so that it fails, and create a PR.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Run tests and see the failure
|
|
91
|
+
npx nx test async
|
|
92
|
+
|
|
93
|
+
# In CI, this command provides automated fixes
|
|
94
|
+
npx nx fix-ci
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
[Learn more about self-healing CI โ](https://nx.dev/ci/features/self-healing-ci)
|
|
98
|
+
|
|
99
|
+
### 4. ๐ฆ Package Publishing
|
|
100
|
+
|
|
101
|
+
Manage releases and publishing with Nx Release:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Dry run to see what would be published
|
|
105
|
+
npx nx release --dry-run
|
|
106
|
+
|
|
107
|
+
# Version and release packages
|
|
108
|
+
npx nx release
|
|
109
|
+
|
|
110
|
+
# Publish only specific packages
|
|
111
|
+
npx nx release publish --projects=strings,colors
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
[Learn more about Nx Release โ](https://nx.dev/features/manage-releases)
|
|
115
|
+
|
|
116
|
+
## ๐ Project Structure
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
โโโ packages/
|
|
120
|
+
โ โโโ strings/ [scope:strings] - String utilities (publishable)
|
|
121
|
+
โ โโโ async/ [scope:async] - Async utilities (publishable)
|
|
122
|
+
โ โโโ colors/ [scope:colors] - Color utilities (publishable)
|
|
123
|
+
โ โโโ utils/ [scope:shared] - Shared utilities (private)
|
|
124
|
+
โโโ nx.json - Nx configuration
|
|
125
|
+
โโโ tsconfig.json - TypeScript configuration
|
|
126
|
+
โโโ eslint.config.mjs - ESLint with module boundary rules
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## ๐ท๏ธ Understanding Tags
|
|
130
|
+
|
|
131
|
+
This repository uses tags to enforce module boundaries:
|
|
132
|
+
|
|
133
|
+
| Package | Tag | Can Import From |
|
|
134
|
+
| -------------- | --------------- | ---------------------- |
|
|
135
|
+
| `@org/utils` | `scope:shared` | Nothing (base library) |
|
|
136
|
+
| `@org/strings` | `scope:strings` | `scope:shared` |
|
|
137
|
+
| `@org/async` | `scope:async` | `scope:shared` |
|
|
138
|
+
| `@org/colors` | `scope:colors` | `scope:shared` |
|
|
139
|
+
|
|
140
|
+
The ESLint configuration enforces these boundaries, preventing circular dependencies and maintaining clean architecture.
|
|
141
|
+
|
|
142
|
+
## ๐งช Testing Module Boundaries
|
|
143
|
+
|
|
144
|
+
To see module boundary enforcement in action:
|
|
145
|
+
|
|
146
|
+
1. Try importing `@org/colors` into `@org/strings`
|
|
147
|
+
2. Run `npx nx lint strings`
|
|
148
|
+
3. You'll see an error about violating module boundaries
|
|
149
|
+
|
|
150
|
+
## ๐ Useful Commands
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Project exploration
|
|
154
|
+
npx nx graph # Interactive dependency graph
|
|
155
|
+
npx nx list # List installed plugins
|
|
156
|
+
npx nx show project strings --web # View project details
|
|
157
|
+
|
|
158
|
+
# Development
|
|
159
|
+
npx nx build strings # Build a specific package
|
|
160
|
+
npx nx test async # Test a specific package
|
|
161
|
+
npx nx lint colors # Lint a specific package
|
|
162
|
+
|
|
163
|
+
# Running multiple tasks
|
|
164
|
+
npx nx run-many -t build # Build all projects
|
|
165
|
+
npx nx run-many -t test --parallel=3 # Test in parallel
|
|
166
|
+
npx nx run-many -t lint test build # Run multiple targets
|
|
167
|
+
|
|
168
|
+
# Affected commands (great for CI)
|
|
169
|
+
npx nx affected -t build # Build only affected projects
|
|
170
|
+
npx nx affected -t test # Test only affected projects
|
|
171
|
+
|
|
172
|
+
# Release management
|
|
173
|
+
npx nx release --dry-run # Preview release changes
|
|
174
|
+
npx nx release # Create a new release
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Nx Cloud
|
|
178
|
+
|
|
179
|
+
Nx Cloud ensures a [fast and scalable CI](https://nx.dev/ci/intro/why-nx-cloud?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) pipeline. It includes features such as:
|
|
180
|
+
|
|
181
|
+
- [Remote caching](https://nx.dev/ci/features/remote-cache?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
|
|
182
|
+
- [Task distribution across multiple machines](https://nx.dev/ci/features/distribute-task-execution?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
|
|
183
|
+
- [Automated e2e test splitting](https://nx.dev/ci/features/split-e2e-tasks?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
|
|
184
|
+
- [Task flakiness detection and rerunning](https://nx.dev/ci/features/flaky-tasks?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
|
|
185
|
+
|
|
186
|
+
## ๐ Learn More
|
|
187
|
+
|
|
188
|
+
- [Nx Documentation](https://nx.dev)
|
|
189
|
+
- [Module Boundaries](https://nx.dev/features/enforce-module-boundaries)
|
|
190
|
+
- [Custom Commands](https://nx.dev/concepts/executors-and-configurations)
|
|
191
|
+
- [Self-Healing CI](https://nx.dev/ci/features/self-healing-ci)
|
|
192
|
+
- [Releasing Packages](https://nx.dev/features/manage-releases)
|
|
193
|
+
- [Nx Cloud](https://nx.dev/ci/intro/why-nx-cloud)
|
|
194
|
+
|
|
195
|
+
## ๐ฌ Community
|
|
196
|
+
|
|
197
|
+
Join the Nx community:
|
|
198
|
+
|
|
199
|
+
- [Discord](https://go.nx.dev/community)
|
|
200
|
+
- [X (Twitter)](https://twitter.com/nxdevtools)
|
|
201
|
+
- [LinkedIn](https://www.linkedin.com/company/nrwl)
|
|
202
|
+
- [YouTube](https://www.youtube.com/@nxdevtools)
|
|
203
|
+
- [Blog](https://nx.dev/blog)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src\\index";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
var styles = {};
|
|
4
|
+
|
|
5
|
+
function MyOrgUiButton() {
|
|
6
|
+
return jsx("div", {
|
|
7
|
+
className: styles['container'],
|
|
8
|
+
children: jsx("h1", {
|
|
9
|
+
children: "Welcome to MyOrgUiButton!"
|
|
10
|
+
})
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { MyOrgUiButton };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../../src/lib/button/ui.tsx"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,4CAM5B;AAED,eAAe,aAAa,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vinh-ui-button",
|
|
3
|
+
"version": "3.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.esm.js",
|
|
6
|
+
"module": "./dist/index.esm.js",
|
|
7
|
+
"types": "./dist/index.esm.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./package.json": "./package.json",
|
|
10
|
+
".": {
|
|
11
|
+
"@org/source": "./src/index.ts",
|
|
12
|
+
"types": "./dist/index.esm.d.ts",
|
|
13
|
+
"import": "./dist/index.esm.js",
|
|
14
|
+
"default": "./dist/index.esm.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"!**/*.tsbuildinfo"
|
|
20
|
+
]
|
|
21
|
+
}
|