create-nx-archweave 0.0.0-stage → 0.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/LICENSE +21 -0
- package/README.md +192 -2
- package/dist/bin.d.ts +3 -0
- package/dist/bin.js +1167 -0
- package/dist/cli/execute.d.ts +55 -0
- package/dist/cli/execute.js +153 -0
- package/dist/cli/host-probe.d.ts +12 -0
- package/dist/cli/host-probe.js +27 -0
- package/dist/cli/package-manager.d.ts +62 -0
- package/dist/cli/package-manager.js +139 -0
- package/dist/cli/parse-args.d.ts +41 -0
- package/dist/cli/parse-args.js +166 -0
- package/dist/cli/plan.d.ts +107 -0
- package/dist/cli/plan.js +434 -0
- package/dist/cli/plugins.d.ts +33 -0
- package/dist/cli/plugins.js +74 -0
- package/dist/cli/preflight.d.ts +5 -0
- package/dist/cli/preflight.js +7 -0
- package/dist/cli/prompts.d.ts +85 -0
- package/dist/cli/prompts.js +150 -0
- package/dist/cli/spawnable-command.d.ts +28 -0
- package/dist/cli/spawnable-command.js +71 -0
- package/dist/cli/types.d.ts +60 -0
- package/dist/cli/types.js +53 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +851 -0
- package/dist/render-usage.d.ts +4 -0
- package/dist/render-usage.js +71 -0
- package/package.json +79 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 nx-archweave contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,193 @@
|
|
|
1
|
-
#
|
|
1
|
+
# create-nx-archweave
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
One command takes you from an empty directory to a configured Nx workspace with:
|
|
4
|
+
|
|
5
|
+
- FSD Lite structure
|
|
6
|
+
- AI agent rules
|
|
7
|
+
- GitHub templates
|
|
8
|
+
- optional AI PR review (Claude, Gemini, GPT, Cursor)
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
# npm
|
|
12
|
+
npx create-nx-archweave my-app
|
|
13
|
+
|
|
14
|
+
# pnpm
|
|
15
|
+
pnpm dlx create-nx-archweave my-app
|
|
16
|
+
|
|
17
|
+
# yarn berry (yarn 1 has no dlx: use npx … --package-manager=yarn)
|
|
18
|
+
yarn dlx create-nx-archweave my-app
|
|
19
|
+
|
|
20
|
+
# bun
|
|
21
|
+
bunx create-nx-archweave my-app
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Anything you don't pass as a flag, the CLI asks you interactively. The `quick-start` preset deliberately keeps the questions to a minimum.
|
|
25
|
+
|
|
26
|
+
## Requirements
|
|
27
|
+
|
|
28
|
+
- Node >= 22.18
|
|
29
|
+
- npm, pnpm >= 10, yarn (classic or berry) or bun
|
|
30
|
+
- network access to github.com (Nx's react template is downloaded from there)
|
|
31
|
+
|
|
32
|
+
**react-vite and older package managers.** You can't create react-vite with npm 10 or yarn 1. Both of those fail inside `create-nx-workspace`'s own install of Nx's react template. So the CLI never offers npm 10 or yarn 1 for react-vite. If a flag names one of them, the CLI stops before creating anything.
|
|
33
|
+
|
|
34
|
+
## Choosing a package manager
|
|
35
|
+
|
|
36
|
+
The CLI asks for the package manager too:
|
|
37
|
+
|
|
38
|
+
- It only offers package managers that are installed and can create the workspace.
|
|
39
|
+
- It preselects the one that launched the CLI: `npx` → npm, `pnpm dlx` → pnpm, `yarn dlx` → yarn, `bunx` → bun.
|
|
40
|
+
- Without a terminal, it uses the launching package manager, else npm.
|
|
41
|
+
|
|
42
|
+
A few things to know for specific package managers:
|
|
43
|
+
|
|
44
|
+
- **Yarn 4** holds back versions younger than a day (`npmMinimalAgeGate`). So in a yarn workspace, a new release resolves only after 24 hours. Wait, or set `YARN_NPM_MINIMAL_AGE_GATE=0` for that one run.
|
|
45
|
+
- **pnpm 11** records the dependency build scripts it skipped as not allowed, at the end. To allow one, run `pnpm nx g @clearlydev/nx-archweave:allow-builds --packages=<package> --apply` inside the workspace. That command sets `<package>: true` under `allowBuilds` and runs `pnpm rebuild <package>`.
|
|
46
|
+
- **bun:** the last step prints the install scripts bun blocked (`bun pm untrusted`). Those scripts stay blocked. To allow one, run `bun pm trust <package>` inside the workspace.
|
|
47
|
+
|
|
48
|
+
## What it runs
|
|
49
|
+
|
|
50
|
+
The CLI prints its plan up front. Then it runs three steps with the package manager you chose.
|
|
51
|
+
|
|
52
|
+
- It never re-implements `create-nx-workspace`.
|
|
53
|
+
- It never commits for you.
|
|
54
|
+
- `--preset=next` replaces the template for `--frontend=next`.
|
|
55
|
+
- pnpm adds a fourth step that records the build scripts pnpm skipped. bun adds one that lists the install scripts bun blocked (`bun pm untrusted`).
|
|
56
|
+
|
|
57
|
+
Here are the three steps for npm and pnpm.
|
|
58
|
+
|
|
59
|
+
**Step 1: create the workspace**
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# npm
|
|
63
|
+
npx -y create-nx-workspace@23.3.0 <name> \
|
|
64
|
+
--template=nrwl/react-template \
|
|
65
|
+
--pm=npm --nxCloud=skip --interactive=false
|
|
66
|
+
|
|
67
|
+
# pnpm
|
|
68
|
+
pnpm dlx create-nx-workspace@23.3.0 <name> \
|
|
69
|
+
--template=nrwl/react-template \
|
|
70
|
+
--pm=pnpm --nxCloud=skip --interactive=false
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Step 2: install the plugin**
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# npm
|
|
77
|
+
npm install -D @clearlydev/nx-archweave@^<cli-version>
|
|
78
|
+
|
|
79
|
+
# pnpm
|
|
80
|
+
pnpm add -D -w @clearlydev/nx-archweave@^<cli-version>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Step 3: run `init`**
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# npm
|
|
87
|
+
npm exec nx -- g @clearlydev/nx-archweave:init \
|
|
88
|
+
--preset=… --frontend=… --backend=… --locale=… --allowDirty=true
|
|
89
|
+
|
|
90
|
+
# pnpm (same flags)
|
|
91
|
+
pnpm nx g @clearlydev/nx-archweave:init …
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
With `--backend=express|nest`, the CLI inserts two official steps before init:
|
|
95
|
+
|
|
96
|
+
1. `@nx/<backend>`, pinned to the workspace's exact nx version
|
|
97
|
+
2. `nx g @nx/<backend>:application apps/api --frontendProject=<detected app>`
|
|
98
|
+
|
|
99
|
+
init then wires `shared-types` and `scope:` tags, and writes the boundary constraints (`--applyEslint=true` on this path).
|
|
100
|
+
|
|
101
|
+
When something goes wrong:
|
|
102
|
+
|
|
103
|
+
- If a step fails, the CLI stops right away. It leaves the created directory in place (it never auto-deletes) and tells you how to recover.
|
|
104
|
+
- When stdin isn't a TTY and a required input is missing, the CLI fails fast instead of hanging.
|
|
105
|
+
|
|
106
|
+
## Options
|
|
107
|
+
|
|
108
|
+
| Flag | Values |
|
|
109
|
+
| --- | --- |
|
|
110
|
+
| `<name>` | positional: the workspace directory name |
|
|
111
|
+
| `--preset` | `quick-start` \| `solo` \| `team` |
|
|
112
|
+
| `--frontend` | `react-vite` \| `next` \| `none` |
|
|
113
|
+
| `--backend` | `express` \| `nest` \| `none` |
|
|
114
|
+
| `--locale` | `ko` \| `en` |
|
|
115
|
+
| `--review` / `--no-review` | — |
|
|
116
|
+
| `--review-provider` | `claude` \| `gemini` \| `gpt` \| `cursor` |
|
|
117
|
+
| `--plugin-source` | package spec, path, or tarball |
|
|
118
|
+
| `--ai-hosts` | `claude-code`, `codex`, `cursor`, `gemini-cli` |
|
|
119
|
+
| `--plugins` | catalog ids (`ponytail`), or `none` |
|
|
120
|
+
| `--package-manager` | `npm` \| `pnpm` \| `yarn` \| `bun` |
|
|
121
|
+
| `-h`, `--help` / `-v`, `--version` | — |
|
|
122
|
+
|
|
123
|
+
### `--preset`
|
|
124
|
+
|
|
125
|
+
Asked if omitted.
|
|
126
|
+
|
|
127
|
+
### `--frontend`
|
|
128
|
+
|
|
129
|
+
- Asked if omitted.
|
|
130
|
+
- `none` means a backend-only workspace. It needs `--backend`.
|
|
131
|
+
|
|
132
|
+
### `--backend`
|
|
133
|
+
|
|
134
|
+
- Asked if omitted.
|
|
135
|
+
- Adds `apps/api`, `shared-types` and enforced boundaries.
|
|
136
|
+
|
|
137
|
+
### `--locale`
|
|
138
|
+
|
|
139
|
+
- Sets the language of generated content.
|
|
140
|
+
- Asked if omitted. `quick-start` defaults to `en` without asking.
|
|
141
|
+
|
|
142
|
+
### `--review` / `--no-review`
|
|
143
|
+
|
|
144
|
+
If you pass neither flag:
|
|
145
|
+
|
|
146
|
+
- `quick-start` asks y/N. Without a terminal, it fails and asks you for the flag.
|
|
147
|
+
- `solo` / `team` turn review on.
|
|
148
|
+
|
|
149
|
+
### `--review-provider`
|
|
150
|
+
|
|
151
|
+
- Asked when review is on. Enter picks the first AI tool's provider (e.g. Codex → GPT).
|
|
152
|
+
- Without a terminal, the CLI uses that default.
|
|
153
|
+
- Refused when review ends up off.
|
|
154
|
+
|
|
155
|
+
### `--plugin-source`
|
|
156
|
+
|
|
157
|
+
- Overrides what step 2 installs. The default is the plugin release this CLI matches, `^<CLI version>`.
|
|
158
|
+
- Use it to pin a version or to point at a local build.
|
|
159
|
+
|
|
160
|
+
### `--ai-hosts`
|
|
161
|
+
|
|
162
|
+
- A comma-separated list.
|
|
163
|
+
- Asked if omitted. You pick by number, and Enter picks Claude Code. Without a terminal, the CLI uses Claude Code.
|
|
164
|
+
- Decides the agent-rules files, Nx's `--aiAgents` and the default review provider.
|
|
165
|
+
|
|
166
|
+
### `--plugins`
|
|
167
|
+
|
|
168
|
+
- Comma-separated catalog ids (`ponytail`), or `none`.
|
|
169
|
+
- Asked if omitted, for each picked host whose CLI is installed. You pick by number, and Enter picks none. Without a terminal, the CLI uses none.
|
|
170
|
+
- Each plugin becomes a last, optional `install-integration --scope=project --apply` step. If that step fails, the workspace is still complete, and the report gives you the retry command.
|
|
171
|
+
|
|
172
|
+
### `--package-manager`
|
|
173
|
+
|
|
174
|
+
- Asked if omitted. The CLI offers the installed package managers that can create the workspace, with the launcher preselected.
|
|
175
|
+
- Without a terminal, the CLI uses the launcher, else npm.
|
|
176
|
+
|
|
177
|
+
## After it finishes
|
|
178
|
+
|
|
179
|
+
The printed next steps cover the first commit. If review is enabled, they also cover registering the provider secret named in the init report.
|
|
180
|
+
|
|
181
|
+
- See [`@clearlydev/nx-archweave`](https://www.npmjs.com/package/@clearlydev/nx-archweave) for the generators the created workspace now has.
|
|
182
|
+
- See the [repository](https://github.com/clearlydev/nx-archweave) for full documentation.
|
|
183
|
+
|
|
184
|
+
## Contributing
|
|
185
|
+
|
|
186
|
+
- `nx build create-nx-archweave` runs tsc, for local dev and typecheck.
|
|
187
|
+
- `nx test` runs Jest.
|
|
188
|
+
- `nx bundle` (depends on `build`) uses esbuild to bundle `src/index.ts` and `src/bin.ts` into `dist/`. The `bin.js` shebang is preserved, and only `tslib` stays external.
|
|
189
|
+
- The CLI has no runtime import of the plugin. It only names the plugin as an install spec.
|
|
190
|
+
|
|
191
|
+
## License
|
|
192
|
+
|
|
193
|
+
MIT
|
package/dist/bin.d.ts
ADDED