@mgwilt/nx-uv 0.1.2 → 0.1.3-beta.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 (113) hide show
  1. package/README.md +299 -14
  2. package/executors.json +37 -12
  3. package/generators.json +19 -4
  4. package/package.json +22 -3
  5. package/src/executors/auth/auth.d.ts +4 -0
  6. package/src/executors/auth/auth.js +10 -0
  7. package/src/executors/auth/auth.js.map +1 -0
  8. package/src/executors/auth/schema.d.ts +8 -0
  9. package/src/executors/auth/schema.json +36 -0
  10. package/src/executors/cache/cache.d.ts +4 -0
  11. package/src/executors/cache/cache.js +10 -0
  12. package/src/executors/cache/cache.js.map +1 -0
  13. package/src/executors/cache/schema.d.ts +8 -0
  14. package/src/executors/cache/schema.json +33 -0
  15. package/src/executors/pip/pip.d.ts +4 -0
  16. package/src/executors/pip/pip.js +10 -0
  17. package/src/executors/pip/pip.js.map +1 -0
  18. package/src/executors/pip/schema.d.ts +17 -0
  19. package/src/executors/pip/schema.json +46 -0
  20. package/src/executors/project/project.d.ts +4 -0
  21. package/src/executors/project/project.js +10 -0
  22. package/src/executors/project/project.js.map +1 -0
  23. package/src/executors/project/schema.d.ts +21 -0
  24. package/src/executors/project/schema.json +54 -0
  25. package/src/executors/python/python.d.ts +4 -0
  26. package/src/executors/python/python.js +10 -0
  27. package/src/executors/python/python.js.map +1 -0
  28. package/src/executors/python/schema.d.ts +16 -0
  29. package/src/executors/python/schema.json +45 -0
  30. package/src/executors/self/schema.d.ts +8 -0
  31. package/src/executors/self/schema.json +33 -0
  32. package/src/executors/self/self.d.ts +4 -0
  33. package/src/executors/self/self.js +10 -0
  34. package/src/executors/self/self.js.map +1 -0
  35. package/src/executors/shared/options.d.ts +23 -0
  36. package/src/executors/shared/options.js +3 -0
  37. package/src/executors/shared/options.js.map +1 -0
  38. package/src/executors/shared/run-uv.d.ts +5 -6
  39. package/src/executors/shared/run-uv.js +134 -8
  40. package/src/executors/shared/run-uv.js.map +1 -1
  41. package/src/executors/tool/schema.d.ts +15 -0
  42. package/src/executors/tool/schema.json +44 -0
  43. package/src/executors/tool/tool.d.ts +4 -0
  44. package/src/executors/tool/tool.js +10 -0
  45. package/src/executors/tool/tool.js.map +1 -0
  46. package/src/executors/uv/schema.d.ts +5 -0
  47. package/src/executors/uv/schema.json +46 -0
  48. package/src/executors/uv/uv.d.ts +4 -0
  49. package/src/executors/uv/uv.js +14 -0
  50. package/src/executors/uv/uv.js.map +1 -0
  51. package/src/generators/convert/convert.d.ts +4 -0
  52. package/src/generators/convert/convert.js +49 -0
  53. package/src/generators/convert/convert.js.map +1 -0
  54. package/src/generators/convert/schema.d.ts +4 -0
  55. package/src/generators/convert/schema.json +17 -0
  56. package/src/generators/integration/integration.d.ts +4 -0
  57. package/src/generators/integration/integration.js +266 -0
  58. package/src/generators/integration/integration.js.map +1 -0
  59. package/src/generators/integration/schema.d.ts +21 -0
  60. package/src/generators/integration/schema.json +43 -0
  61. package/src/generators/{python-package → project}/files/package/pyproject.toml.template +1 -1
  62. package/src/generators/project/files/package/src/__moduleName__/main.py.template +5 -0
  63. package/src/generators/project/files/script/README.md.template +3 -0
  64. package/src/generators/project/files/script/main.py.template +1 -0
  65. package/src/generators/project/files/script/pyproject.toml.template +6 -0
  66. package/src/generators/project/project.d.ts +4 -0
  67. package/src/generators/project/project.js +164 -0
  68. package/src/generators/project/project.js.map +1 -0
  69. package/src/generators/project/schema.d.ts +12 -0
  70. package/src/generators/project/schema.json +46 -0
  71. package/src/generators/shared.d.ts +15 -0
  72. package/src/generators/shared.js +149 -0
  73. package/src/generators/shared.js.map +1 -0
  74. package/src/generators/workspace/schema.d.ts +11 -0
  75. package/src/generators/workspace/schema.json +41 -0
  76. package/src/generators/workspace/workspace.d.ts +4 -0
  77. package/src/generators/workspace/workspace.js +71 -0
  78. package/src/generators/workspace/workspace.js.map +1 -0
  79. package/src/index.d.ts +27 -8
  80. package/src/index.js +28 -9
  81. package/src/index.js.map +1 -1
  82. package/src/plugins/create-nodes.d.ts +14 -0
  83. package/src/plugins/create-nodes.js +197 -0
  84. package/src/plugins/create-nodes.js.map +1 -0
  85. package/src/tools/coverage-badge.d.ts +29 -0
  86. package/src/tools/coverage-badge.js +131 -0
  87. package/src/tools/coverage-badge.js.map +1 -0
  88. package/src/tools/llms.d.ts +59 -0
  89. package/src/tools/llms.js +324 -0
  90. package/src/tools/llms.js.map +1 -0
  91. package/src/executors/add/add.d.ts +0 -4
  92. package/src/executors/add/add.js +0 -28
  93. package/src/executors/add/add.js.map +0 -1
  94. package/src/executors/add/schema.d.ts +0 -8
  95. package/src/executors/add/schema.json +0 -43
  96. package/src/executors/run/run.d.ts +0 -4
  97. package/src/executors/run/run.js +0 -30
  98. package/src/executors/run/run.js.map +0 -1
  99. package/src/executors/run/schema.d.ts +0 -9
  100. package/src/executors/run/schema.json +0 -48
  101. package/src/executors/sync/schema.d.ts +0 -6
  102. package/src/executors/sync/schema.json +0 -30
  103. package/src/executors/sync/sync.d.ts +0 -4
  104. package/src/executors/sync/sync.js +0 -19
  105. package/src/executors/sync/sync.js.map +0 -1
  106. package/src/generators/python-package/python-package.d.ts +0 -4
  107. package/src/generators/python-package/python-package.js +0 -98
  108. package/src/generators/python-package/python-package.js.map +0 -1
  109. package/src/generators/python-package/schema.d.ts +0 -7
  110. package/src/generators/python-package/schema.json +0 -36
  111. /package/src/generators/{python-package → project}/files/package/README.md.template +0 -0
  112. /package/src/generators/{python-package → project}/files/package/src/__moduleName__/__init__.py.template +0 -0
  113. /package/src/generators/{python-package → project}/files/package/tests/test_smoke.py.template +0 -0
package/README.md CHANGED
@@ -1,24 +1,309 @@
1
1
  # @mgwilt/nx-uv
2
2
 
3
- Nx plugin for integrating [uv](https://docs.astral.sh/uv/) workflows into an Nx monorepo.
3
+ [Nx](https://nx.dev/) plugin for running [uv](https://docs.astral.sh/uv/) workflows in [Nx](https://nx.dev/) monorepos.
4
4
 
5
- ## Executors
5
+ [![CI](https://github.com/mgwilt/nx-uv/actions/workflows/ci.yml/badge.svg)](https://github.com/mgwilt/nx-uv/actions/workflows/ci.yml)
6
+ [![Coverage](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/mgwilt/nx-uv/badges/.github/badges/coverage.json)](https://github.com/mgwilt/nx-uv/blob/badges/.github/badges/coverage.json)
7
+ [![npm beta](https://img.shields.io/npm/v/%40mgwilt%2Fnx-uv/beta?label=npm%20beta&cacheSeconds=300)](https://www.npmjs.com/package/@mgwilt/nx-uv?activeTab=versions)
6
8
 
7
- - `@mgwilt/nx-uv:sync` runs `uv sync`
8
- - `@mgwilt/nx-uv:run` runs `uv run`
9
- - `@mgwilt/nx-uv:add` runs `uv add`
9
+ ## When to use this plugin
10
10
 
11
- ## Generator
11
+ - Run [uv](https://docs.astral.sh/uv/) commands through [Nx](https://nx.dev/) targets instead of ad-hoc shell scripts.
12
+ - Infer useful [uv](https://docs.astral.sh/uv/) targets from existing `pyproject.toml` files.
13
+ - Scaffold [uv](https://docs.astral.sh/uv/)-ready [Python](https://www.python.org/) projects and workspace config.
14
+ - Keep [Python](https://www.python.org/) work in the same task graph, caching, and CI flow as the rest of your monorepo.
12
15
 
13
- - `@mgwilt/nx-uv:python-package`
14
- - Creates a Python package in `packages/py/<name>` by default.
15
- - Generates `pyproject.toml`, `src/<module>/__init__.py`, and optional tests.
16
- - Adds Nx targets: `sync`, `add`, `run`, `test`, `lint`.
16
+ ## Tools
17
17
 
18
- ## Local Usage
18
+ - Executors for [uv](https://docs.astral.sh/uv/) command families:
19
+ - `@mgwilt/nx-uv:project`
20
+ - `@mgwilt/nx-uv:uv`
21
+ - `@mgwilt/nx-uv:pip`
22
+ - `@mgwilt/nx-uv:tool`
23
+ - `@mgwilt/nx-uv:python`
24
+ - `@mgwilt/nx-uv:auth`
25
+ - `@mgwilt/nx-uv:cache`
26
+ - `@mgwilt/nx-uv:self`
27
+ - Generators:
28
+ - `@mgwilt/nx-uv:workspace`
29
+ - `@mgwilt/nx-uv:project`
30
+ - `@mgwilt/nx-uv:integration`
31
+ - `@mgwilt/nx-uv:convert`
32
+ - [Nx](https://nx.dev/) plugin inference (`createNodesV2`) for `pyproject.toml`.
33
+
34
+ ## Install
35
+
36
+ Prerequisites:
37
+
38
+ - [Nx](https://nx.dev/) workspace
39
+ - [uv](https://docs.astral.sh/uv/) installed and available on `PATH`
40
+
41
+ Install the plugin:
42
+
43
+ ```bash
44
+ pnpm add -D @mgwilt/nx-uv
45
+ ```
46
+
47
+ ## Brand new monorepo example
48
+
49
+ This walkthrough creates a new [Nx](https://nx.dev/) monorepo and uses this plugin to scaffold a working [uv](https://docs.astral.sh/uv/) + [Python](https://www.python.org/) example.
50
+
51
+ 1. Create a new workspace:
52
+
53
+ ```bash
54
+ pnpm create nx-workspace@latest acme-monorepo --preset=ts --packageManager=pnpm --nxCloud=skip --interactive=false
55
+ cd acme-monorepo
56
+ ```
57
+
58
+ 2. Install this plugin (beta channel) and initialize workspace-level [uv](https://docs.astral.sh/uv/) config:
59
+
60
+ ```bash
61
+ pnpm add -D @mgwilt/nx-uv@beta
62
+ pnpm nx g @mgwilt/nx-uv:workspace --name=acme --membersGlob='packages/py/*'
63
+ ```
64
+
65
+ 3. Generate a [Python](https://www.python.org/) app and scaffold integrations:
66
+
67
+ ```bash
68
+ pnpm nx g @mgwilt/nx-uv:project api --projectType=app --directory=packages/py
69
+ pnpm nx g @mgwilt/nx-uv:integration --template=fastapi --project=api
70
+ pnpm nx g @mgwilt/nx-uv:integration --template=github
71
+ ```
72
+
73
+ Expected file tree (key files) after step 3:
74
+
75
+ ```text
76
+ acme-monorepo/
77
+ ├── nx.json
78
+ ├── package.json
79
+ ├── pyproject.toml
80
+ ├── .github/
81
+ │ └── workflows/
82
+ │ └── uv-ci.yml
83
+ └── packages/
84
+ └── py/
85
+ └── api/
86
+ ├── README.md
87
+ ├── pyproject.toml
88
+ ├── main.py
89
+ ├── Dockerfile.fastapi
90
+ ├── src/
91
+ │ └── api/
92
+ │ ├── __init__.py
93
+ │ └── main.py
94
+ └── tests/
95
+ └── test_smoke.py
96
+ ```
97
+
98
+ 4. Add runtime and dev dependencies with [uv](https://docs.astral.sh/uv/):
99
+
100
+ ```bash
101
+ cd packages/py/api
102
+ uv add fastapi uvicorn
103
+ uv add --dev pytest ruff
104
+ cd ../../..
105
+ ```
106
+
107
+ 5. Run plugin-backed targets via [Nx](https://nx.dev/):
19
108
 
20
109
  ```bash
21
- pnpm nx g @mgwilt/nx-uv:python-package shared
22
- pnpm nx run shared:sync
23
- pnpm nx run shared:test
110
+ pnpm nx run api:sync
111
+ pnpm nx run api:uv
112
+ pnpm nx run api:run
113
+ pnpm nx run api:test
114
+ pnpm nx run api:build
115
+ ```
116
+
117
+ At this point you have a working monorepo with:
118
+
119
+ - Root `pyproject.toml` and [uv](https://docs.astral.sh/uv/) workspace members
120
+ - A generated `api` [Python](https://www.python.org/) project under `packages/py/api`
121
+ - Generated [FastAPI](https://fastapi.tiangolo.com/) starter files and a [GitHub Actions](https://github.com/features/actions) Nx-first CI template
122
+ - [Nx](https://nx.dev/) targets that run uv commands consistently in CI/local dev
123
+
124
+ ## Quick start (existing workspace)
125
+
126
+ 1. Add the plugin to `nx.json`:
127
+
128
+ ```json
129
+ {
130
+ "plugins": [
131
+ {
132
+ "plugin": "@mgwilt/nx-uv",
133
+ "options": {
134
+ "targetPrefix": "uv:",
135
+ "inferencePreset": "standard",
136
+ "includeGlobalTargets": false
137
+ }
138
+ }
139
+ ]
140
+ }
24
141
  ```
142
+
143
+ 2. (Optional, recommended for new repos) Initialize [uv](https://docs.astral.sh/uv/) workspace config:
144
+
145
+ ```bash
146
+ pnpm nx g @mgwilt/nx-uv:workspace --name=acme
147
+ ```
148
+
149
+ 3. Generate a [Python](https://www.python.org/) project wired for [uv](https://docs.astral.sh/uv/) + [Nx](https://nx.dev/):
150
+
151
+ ```bash
152
+ pnpm nx g @mgwilt/nx-uv:project services/api --projectType=app
153
+ ```
154
+
155
+ 4. Run [uv](https://docs.astral.sh/uv/)-backed targets:
156
+
157
+ ```bash
158
+ pnpm nx run api:sync
159
+ pnpm nx run api:test
160
+ pnpm nx run api:build
161
+ ```
162
+
163
+ ## Existing [Python](https://www.python.org/) projects
164
+
165
+ If your repo already has `pyproject.toml` files, the plugin can infer targets (for example `uv:sync`, `uv:run`, `uv:test`) based on your configured `targetPrefix` and inference preset.
166
+
167
+ ### Customizing inferred targets
168
+
169
+ You can disable or override inferred targets in plugin options:
170
+
171
+ ```json
172
+ {
173
+ "plugins": [
174
+ {
175
+ "plugin": "@mgwilt/nx-uv",
176
+ "options": {
177
+ "targetPrefix": "uv:",
178
+ "inferencePreset": "standard",
179
+ "inferredTargets": {
180
+ "test": false,
181
+ "lint": {
182
+ "command": "run",
183
+ "commandArgs": ["--", "ruff", "check", "src"]
184
+ }
185
+ }
186
+ }
187
+ }
188
+ ]
189
+ }
190
+ ```
191
+
192
+ Supported inferred target keys are: `sync`, `run`, `lock`, `test`, `lint`, `build`, `tree`, `export`, `format`, `venv`, `publish`.
193
+
194
+ ## Integration templates
195
+
196
+ Use integration templates to scaffold common [uv](https://docs.astral.sh/uv/) ecosystem files for CI, containers, dependency automation, and notebook workflows.
197
+
198
+ ### How file output location works
199
+
200
+ - `--project=<name>` sets `<baseDir>` to that [Nx](https://nx.dev/) project's root.
201
+ - `--directory=<path>` sets `<baseDir>` to that directory relative to workspace root.
202
+ - If neither is set, `<baseDir>` defaults to workspace root (`.`).
203
+ - Workspace-level templates always write to repo root, even if `--project` or `--directory` is provided.
204
+ - Workspace-level templates are:
205
+ - `github`
206
+ - `gitlab`
207
+ - `dependency-bots`
208
+ - `pre-commit`
209
+
210
+ ### Template matrix
211
+
212
+ | Template | Scope | Files generated | Best for |
213
+ | --------------------- | -------------- | --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
214
+ | `alternative-indexes` | `baseDir` | `<baseDir>/uv.indexes.toml.snippet` | Defining custom/internal [Python](https://www.python.org/) indexes |
215
+ | `aws-lambda` | `baseDir` | `<baseDir>/Dockerfile.lambda` | Packaging [uv](https://docs.astral.sh/uv/)-based [AWS Lambda](https://aws.amazon.com/lambda/) workloads |
216
+ | `coiled` | `baseDir` | `<baseDir>/scripts/coiled-example.py` | Starting distributed [Python](https://www.python.org/) experiments with [Coiled](https://coiled.io/) |
217
+ | `dependency-bots` | workspace root | `renovate.json`, `.github/dependabot.yml` | Automated dependency update workflows with [Renovate](https://docs.renovatebot.com/) and [Dependabot](https://docs.github.com/en/code-security/dependabot) |
218
+ | `docker` | `baseDir` | `<baseDir>/Dockerfile` | Containerizing a [uv](https://docs.astral.sh/uv/) project with [Docker](https://www.docker.com/) |
219
+ | `fastapi` | `baseDir` | `<baseDir>/main.py`, `<baseDir>/Dockerfile.fastapi` | Bootstrapping a [FastAPI](https://fastapi.tiangolo.com/) service with [uv](https://docs.astral.sh/uv/) |
220
+ | `github` | workspace root | `.github/workflows/uv-ci.yml` | [GitHub Actions](https://github.com/features/actions) Nx-first CI starter using `nx affected` |
221
+ | `gitlab` | workspace root | `.gitlab-ci.uv.yml` | [GitLab CI/CD](https://docs.gitlab.com/ee/ci/) Nx-first CI starter using `nx run-many` |
222
+ | `jupyter` | `baseDir` | `<baseDir>/scripts/setup-jupyter-kernel.sh` | Registering a [uv](https://docs.astral.sh/uv/)-managed [Jupyter](https://jupyter.org/) kernel |
223
+ | `marimo` | `baseDir` | `<baseDir>/notebooks/example.marimo.py` | Starting [marimo](https://marimo.io/) notebook workflows |
224
+ | `pre-commit` | workspace root | `.pre-commit-config.yaml` | Local code quality hooks for [uv](https://docs.astral.sh/uv/) projects using [pre-commit](https://pre-commit.com/) |
225
+ | `pytorch` | `baseDir` | `<baseDir>/uv.pytorch.toml.snippet` | Configuring [PyTorch](https://pytorch.org/) index/source snippets |
226
+
227
+ ### Command examples for all templates
228
+
229
+ ```bash
230
+ pnpm nx g @mgwilt/nx-uv:integration --template=alternative-indexes --project=api
231
+ pnpm nx g @mgwilt/nx-uv:integration --template=aws-lambda --project=api
232
+ pnpm nx g @mgwilt/nx-uv:integration --template=coiled --project=api
233
+ pnpm nx g @mgwilt/nx-uv:integration --template=dependency-bots
234
+ pnpm nx g @mgwilt/nx-uv:integration --template=docker --project=api
235
+ pnpm nx g @mgwilt/nx-uv:integration --template=fastapi --project=api
236
+ pnpm nx g @mgwilt/nx-uv:integration --template=github
237
+ pnpm nx g @mgwilt/nx-uv:integration --template=gitlab
238
+ pnpm nx g @mgwilt/nx-uv:integration --template=jupyter --project=api
239
+ pnpm nx g @mgwilt/nx-uv:integration --template=marimo --project=api
240
+ pnpm nx g @mgwilt/nx-uv:integration --template=pre-commit
241
+ pnpm nx g @mgwilt/nx-uv:integration --template=pytorch --project=api
242
+ ```
243
+
244
+ ### Common options
245
+
246
+ - `--overwrite=true` replaces existing files instead of skipping them.
247
+ - `--directory=<path>` writes baseDir-aware templates into a non-project directory.
248
+ - `--skipFormat=true` skips formatter execution after generation.
249
+ - Prefer `--project` for app/lib scaffolds and no location flag for workspace-level templates.
250
+
251
+ ### Notes and pitfalls
252
+
253
+ - Templates are starter scaffolds; you should review and harden generated files for production use.
254
+ - Running the same template multiple times without `--overwrite=true` leaves existing files unchanged.
255
+ - Workspace-level templates are intentionally global and may affect repository-wide automation.
256
+
257
+ ## Compatibility and versioning
258
+
259
+ - Runtime [uv](https://docs.astral.sh/uv/) compatibility checks verify that `uv` is available and executable.
260
+ - `uv 0.9.x` and `0.10.x` are currently the tested ranges. Other versions log a warning and continue.
261
+ - This package is pre-v1 and published on the [npm](https://www.npmjs.com/) `beta` dist-tag.
262
+
263
+ ## Troubleshooting
264
+
265
+ ### Nx plugin bootstrap failures
266
+
267
+ If `quality:ci` fails before running tasks with worker/bootstrap errors (for example `Failed to load ... Nx plugin(s)`), run:
268
+
269
+ ```bash
270
+ pnpm nx report
271
+ pnpm nx reset
272
+ NX_DAEMON=false pnpm quality:ci
273
+ ```
274
+
275
+ If bootstrap still fails, run direct checks to isolate whether the issue is Nx plugin startup or project logic:
276
+
277
+ ```bash
278
+ pnpm exec eslint .
279
+ pnpm exec tsc -p tsconfig.lib.json --noEmit
280
+ pnpm exec tsc -p tsconfig.spec.json --noEmit
281
+ pnpm exec vitest run -c vitest.unit.config.mts
282
+ pnpm exec vitest run -c vitest.integration.config.mts
283
+ pnpm exec vitest run -c vitest.e2e.config.mts
284
+ pnpm exec vitest run -c vitest.coverage.config.mts
285
+ ```
286
+
287
+ ### E2E execution permissions
288
+
289
+ The e2e suite executes a temporary shim binary from the local filesystem. In restricted environments (for example `noexec` mounts or sandboxed process policies), e2e tests may be skipped when executable spawning is not permitted.
290
+
291
+ ## LLM context files
292
+
293
+ This repository publishes LLM-friendly docs artifacts:
294
+
295
+ - `llms.txt`: concise index of high-signal project docs.
296
+ - `llms-full.txt`: expanded inline content for the same curated sources.
297
+
298
+ Regenerate and validate them with:
299
+
300
+ ```bash
301
+ pnpm llms:generate
302
+ pnpm llms:check
303
+ ```
304
+
305
+ ## Additional docs
306
+
307
+ - [Documentation index](docs/index.md)
308
+ - [Maintainer guide (quality gates, CI, release)](docs/maintainers.md)
309
+ - [Sample scaffolding patterns](samples/README.md)
package/executors.json CHANGED
@@ -1,19 +1,44 @@
1
1
  {
2
2
  "executors": {
3
- "sync": {
4
- "implementation": "./src/executors/sync/sync",
5
- "schema": "./src/executors/sync/schema.json",
6
- "description": "Run uv sync for a Python package."
3
+ "uv": {
4
+ "implementation": "./src/executors/uv/uv",
5
+ "schema": "./src/executors/uv/schema.json",
6
+ "description": "Run any uv command via argument passthrough."
7
7
  },
8
- "run": {
9
- "implementation": "./src/executors/run/run",
10
- "schema": "./src/executors/run/schema.json",
11
- "description": "Run arbitrary commands through uv run."
8
+ "project": {
9
+ "implementation": "./src/executors/project/project",
10
+ "schema": "./src/executors/project/schema.json",
11
+ "description": "Run uv project-oriented commands (run/init/add/remove/sync/lock/build/publish/etc)."
12
12
  },
13
- "add": {
14
- "implementation": "./src/executors/add/add",
15
- "schema": "./src/executors/add/schema.json",
16
- "description": "Add dependencies through uv add."
13
+ "pip": {
14
+ "implementation": "./src/executors/pip/pip",
15
+ "schema": "./src/executors/pip/schema.json",
16
+ "description": "Run uv pip subcommands."
17
+ },
18
+ "tool": {
19
+ "implementation": "./src/executors/tool/tool",
20
+ "schema": "./src/executors/tool/schema.json",
21
+ "description": "Run uv tool subcommands."
22
+ },
23
+ "python": {
24
+ "implementation": "./src/executors/python/python",
25
+ "schema": "./src/executors/python/schema.json",
26
+ "description": "Run uv python subcommands."
27
+ },
28
+ "auth": {
29
+ "implementation": "./src/executors/auth/auth",
30
+ "schema": "./src/executors/auth/schema.json",
31
+ "description": "Run uv auth subcommands."
32
+ },
33
+ "cache": {
34
+ "implementation": "./src/executors/cache/cache",
35
+ "schema": "./src/executors/cache/schema.json",
36
+ "description": "Run uv cache subcommands."
37
+ },
38
+ "self": {
39
+ "implementation": "./src/executors/self/self",
40
+ "schema": "./src/executors/self/schema.json",
41
+ "description": "Run uv self subcommands."
17
42
  }
18
43
  }
19
44
  }
package/generators.json CHANGED
@@ -1,9 +1,24 @@
1
1
  {
2
2
  "generators": {
3
- "python-package": {
4
- "factory": "./src/generators/python-package/python-package",
5
- "schema": "./src/generators/python-package/schema.json",
6
- "description": "Generate a Python package with uv and Nx targets."
3
+ "workspace": {
4
+ "factory": "./src/generators/workspace/workspace",
5
+ "schema": "./src/generators/workspace/schema.json",
6
+ "description": "Configure a uv workspace root and Nx plugin inference settings."
7
+ },
8
+ "project": {
9
+ "factory": "./src/generators/project/project",
10
+ "schema": "./src/generators/project/schema.json",
11
+ "description": "Generate a Python app/lib/script project wired for uv and Nx."
12
+ },
13
+ "convert": {
14
+ "factory": "./src/generators/convert/convert",
15
+ "schema": "./src/generators/convert/schema.json",
16
+ "description": "Convert existing Python Nx projects to new uv targets and executors."
17
+ },
18
+ "integration": {
19
+ "factory": "./src/generators/integration/integration",
20
+ "schema": "./src/generators/integration/schema.json",
21
+ "description": "Scaffold uv integration templates (CI, Docker, FastAPI, Lambda, and more)."
7
22
  }
8
23
  }
9
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mgwilt/nx-uv",
3
- "version": "0.1.2",
3
+ "version": "0.1.3-beta.1",
4
4
  "description": "Nx plugin for uv workflows in Nx monorepos",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -18,11 +18,16 @@
18
18
  "python"
19
19
  ],
20
20
  "dependencies": {
21
+ "@iarna/toml": "^2.2.5",
21
22
  "@nx/devkit": "22.5.3",
22
23
  "@nx/vite": "22.5.3",
24
+ "minimatch": "^10.2.4",
23
25
  "tslib": "^2.3.0",
24
26
  "vitest": "^4.0.18"
25
27
  },
28
+ "peerDependencies": {
29
+ "nx": ">=22 <=23"
30
+ },
26
31
  "devDependencies": {
27
32
  "@commitlint/cli": "^20.4.2",
28
33
  "@commitlint/config-conventional": "^20.4.2",
@@ -39,6 +44,7 @@
39
44
  "eslint-config-prettier": "^10.1.8",
40
45
  "jsdom": "^27.1.0",
41
46
  "jsonc-eslint-parser": "^2.4.0",
47
+ "lefthook": "^2.1.2",
42
48
  "nx": "22.5.3",
43
49
  "prettier": "^3.6.2",
44
50
  "typescript": "~5.9.2",
@@ -49,10 +55,23 @@
49
55
  "generators": "./generators.json",
50
56
  "scripts": {
51
57
  "build": "nx run nx-uv:build",
58
+ "coverage:badge": "nx run nx-uv:coverage-badge",
59
+ "typecheck": "nx run nx-uv:typecheck",
60
+ "format:check": "nx run nx-uv:format-check",
52
61
  "lint": "nx run nx-uv:lint",
53
62
  "test": "nx run nx-uv:test",
54
- "release:version": "nx release version",
55
- "release:publish": "nx release publish",
63
+ "test:unit": "nx run nx-uv:test-unit",
64
+ "test:integration": "nx run nx-uv:test-integration",
65
+ "test:e2e": "nx run nx-uv:test-e2e",
66
+ "test:coverage": "nx run nx-uv:test-coverage",
67
+ "quality:local": "nx run nx-uv:quality-local",
68
+ "quality:ci": "nx run nx-uv:quality-ci",
69
+ "samples:generate": "node tools/generate-samples.cjs",
70
+ "llms:generate": "node tools/generate-llms.cjs",
71
+ "llms:check": "node tools/check-llms.cjs",
72
+ "hooks:install": "lefthook install",
73
+ "release:version": "nx release version --preid beta",
74
+ "release:publish": "nx release publish --tag beta",
56
75
  "commitlint": "commitlint --from=HEAD~1 --to=HEAD"
57
76
  }
58
77
  }
@@ -0,0 +1,4 @@
1
+ import { PromiseExecutor } from "@nx/devkit";
2
+ import { AuthExecutorSchema } from "./schema";
3
+ declare const authExecutor: PromiseExecutor<AuthExecutorSchema>;
4
+ export default authExecutor;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const run_uv_1 = require("../shared/run-uv");
4
+ const authExecutor = async (options, context) => {
5
+ var _a;
6
+ const args = ["auth", options.command, ...((_a = options.commandArgs) !== null && _a !== void 0 ? _a : [])];
7
+ return (0, run_uv_1.runUvCommand)(args, options, context);
8
+ };
9
+ exports.default = authExecutor;
10
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../src/executors/auth/auth.ts"],"names":[],"mappings":";;AACA,6CAAgD;AAGhD,MAAM,YAAY,GAAwC,KAAK,EAC7D,OAAO,EACP,OAAO,EACP,EAAE;;IACF,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAA,OAAO,CAAC,WAAW,mCAAI,EAAE,CAAC,CAAC,CAAC;IACvE,OAAO,IAAA,qBAAY,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF,kBAAe,YAAY,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { UvBaseExecutorSchema } from "../shared/options";
2
+
3
+ export type UvAuthCommand = "login" | "logout" | "token" | "dir";
4
+
5
+ export interface AuthExecutorSchema extends UvBaseExecutorSchema {
6
+ command: UvAuthCommand;
7
+ commandArgs?: string[];
8
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "version": 2,
4
+ "title": "uv auth executor",
5
+ "description": "Run uv auth subcommands.",
6
+ "type": "object",
7
+ "properties": {
8
+ "cwd": { "type": "string" },
9
+ "directory": { "type": "string" },
10
+ "project": { "type": "string" },
11
+ "configFile": { "type": "string" },
12
+ "noConfig": { "type": "boolean", "default": false },
13
+ "offline": { "type": "boolean", "default": false },
14
+ "noProgress": { "type": "boolean", "default": false },
15
+ "quiet": { "type": "boolean", "default": false },
16
+ "verbose": { "type": "boolean", "default": false },
17
+ "color": { "type": "string", "enum": ["auto", "always", "never"] },
18
+ "nativeTls": { "type": "boolean", "default": false },
19
+ "cacheDir": { "type": "string" },
20
+ "noCache": { "type": "boolean", "default": false },
21
+ "managedPython": { "type": "boolean", "default": false },
22
+ "noManagedPython": { "type": "boolean", "default": false },
23
+ "noPythonDownloads": { "type": "boolean", "default": false },
24
+ "allowInsecureHost": { "type": "array", "items": { "type": "string" } },
25
+ "env": { "type": "object", "additionalProperties": { "type": "string" } },
26
+ "extraArgs": { "type": "array", "items": { "type": "string" } },
27
+ "skipVersionCheck": { "type": "boolean", "default": false },
28
+ "command": {
29
+ "type": "string",
30
+ "enum": ["login", "logout", "token", "dir"]
31
+ },
32
+ "commandArgs": { "type": "array", "items": { "type": "string" } }
33
+ },
34
+ "required": ["command"],
35
+ "additionalProperties": false
36
+ }
@@ -0,0 +1,4 @@
1
+ import { PromiseExecutor } from "@nx/devkit";
2
+ import { CacheExecutorSchema } from "./schema";
3
+ declare const cacheExecutor: PromiseExecutor<CacheExecutorSchema>;
4
+ export default cacheExecutor;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const run_uv_1 = require("../shared/run-uv");
4
+ const cacheExecutor = async (options, context) => {
5
+ var _a;
6
+ const args = ["cache", options.command, ...((_a = options.commandArgs) !== null && _a !== void 0 ? _a : [])];
7
+ return (0, run_uv_1.runUvCommand)(args, options, context);
8
+ };
9
+ exports.default = cacheExecutor;
10
+ //# sourceMappingURL=cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../../src/executors/cache/cache.ts"],"names":[],"mappings":";;AACA,6CAAgD;AAGhD,MAAM,aAAa,GAAyC,KAAK,EAC/D,OAAO,EACP,OAAO,EACP,EAAE;;IACF,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAA,OAAO,CAAC,WAAW,mCAAI,EAAE,CAAC,CAAC,CAAC;IACxE,OAAO,IAAA,qBAAY,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF,kBAAe,aAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { UvBaseExecutorSchema } from "../shared/options";
2
+
3
+ export type UvCacheCommand = "clean" | "prune" | "dir" | "size";
4
+
5
+ export interface CacheExecutorSchema extends UvBaseExecutorSchema {
6
+ command: UvCacheCommand;
7
+ commandArgs?: string[];
8
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "version": 2,
4
+ "title": "uv cache executor",
5
+ "description": "Run uv cache subcommands.",
6
+ "type": "object",
7
+ "properties": {
8
+ "cwd": { "type": "string" },
9
+ "directory": { "type": "string" },
10
+ "project": { "type": "string" },
11
+ "configFile": { "type": "string" },
12
+ "noConfig": { "type": "boolean", "default": false },
13
+ "offline": { "type": "boolean", "default": false },
14
+ "noProgress": { "type": "boolean", "default": false },
15
+ "quiet": { "type": "boolean", "default": false },
16
+ "verbose": { "type": "boolean", "default": false },
17
+ "color": { "type": "string", "enum": ["auto", "always", "never"] },
18
+ "nativeTls": { "type": "boolean", "default": false },
19
+ "cacheDir": { "type": "string" },
20
+ "noCache": { "type": "boolean", "default": false },
21
+ "managedPython": { "type": "boolean", "default": false },
22
+ "noManagedPython": { "type": "boolean", "default": false },
23
+ "noPythonDownloads": { "type": "boolean", "default": false },
24
+ "allowInsecureHost": { "type": "array", "items": { "type": "string" } },
25
+ "env": { "type": "object", "additionalProperties": { "type": "string" } },
26
+ "extraArgs": { "type": "array", "items": { "type": "string" } },
27
+ "skipVersionCheck": { "type": "boolean", "default": false },
28
+ "command": { "type": "string", "enum": ["clean", "prune", "dir", "size"] },
29
+ "commandArgs": { "type": "array", "items": { "type": "string" } }
30
+ },
31
+ "required": ["command"],
32
+ "additionalProperties": false
33
+ }
@@ -0,0 +1,4 @@
1
+ import { PromiseExecutor } from "@nx/devkit";
2
+ import { PipExecutorSchema } from "./schema";
3
+ declare const pipExecutor: PromiseExecutor<PipExecutorSchema>;
4
+ export default pipExecutor;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const run_uv_1 = require("../shared/run-uv");
4
+ const pipExecutor = async (options, context) => {
5
+ var _a;
6
+ const args = ["pip", options.command, ...((_a = options.commandArgs) !== null && _a !== void 0 ? _a : [])];
7
+ return (0, run_uv_1.runUvCommand)(args, options, context);
8
+ };
9
+ exports.default = pipExecutor;
10
+ //# sourceMappingURL=pip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pip.js","sourceRoot":"","sources":["../../../../src/executors/pip/pip.ts"],"names":[],"mappings":";;AACA,6CAAgD;AAGhD,MAAM,WAAW,GAAuC,KAAK,EAC3D,OAAO,EACP,OAAO,EACP,EAAE;;IACF,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAA,OAAO,CAAC,WAAW,mCAAI,EAAE,CAAC,CAAC,CAAC;IACtE,OAAO,IAAA,qBAAY,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { UvBaseExecutorSchema } from "../shared/options";
2
+
3
+ export type UvPipCommand =
4
+ | "compile"
5
+ | "sync"
6
+ | "install"
7
+ | "uninstall"
8
+ | "freeze"
9
+ | "list"
10
+ | "show"
11
+ | "tree"
12
+ | "check";
13
+
14
+ export interface PipExecutorSchema extends UvBaseExecutorSchema {
15
+ command: UvPipCommand;
16
+ commandArgs?: string[];
17
+ }