@auis/cli 0.4.1 → 0.5.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 -6
- package/package.json +1 -1
- package/src/create.mjs +5 -0
- package/src/detect.mjs +10 -1
- package/src/install.mjs +21 -4
- package/src/modules.mjs +3 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ npx @auis/cli@latest my-product
|
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
```
|
|
11
|
-
auis 0.
|
|
11
|
+
auis 0.5.0
|
|
12
12
|
code-native design builder
|
|
13
13
|
|
|
14
14
|
✓ Template main · tarball
|
|
@@ -37,7 +37,7 @@ codebase, and AI agents build against them under enforced rules:
|
|
|
37
37
|
- **Edit Mode** — non-destructive visual edits that agents materialize into code.
|
|
38
38
|
- **UX Flows as code** (`/auis/ux-flow`) — navigable flow diagrams that are React pages.
|
|
39
39
|
- **State Mode** (`/auis/states`) — every registered screen in every state, side by side.
|
|
40
|
-
- **
|
|
40
|
+
- **32 agent skills** — execution contracts for Claude Code, Codex and Cursor.
|
|
41
41
|
|
|
42
42
|
## Existing repository?
|
|
43
43
|
|
|
@@ -125,7 +125,7 @@ planned; it does not exist yet.
|
|
|
125
125
|
```
|
|
126
126
|
npx @auis/cli@latest [directory] [options] scaffold a new project
|
|
127
127
|
npx @auis/cli@latest doctor [directory] read an existing repo, write nothing
|
|
128
|
-
npx @auis/cli@latest init [directory] install
|
|
128
|
+
npx @auis/cli@latest init [directory] pick what to install into an existing Next.js app
|
|
129
129
|
npx @auis/cli@latest uninstall [directory] take it back out, exactly
|
|
130
130
|
|
|
131
131
|
--json doctor only: the full report as JSON
|
|
@@ -153,7 +153,8 @@ npx @auis/cli@latest . # current directory
|
|
|
153
153
|
npx @auis/cli@latest my-product --pm pnpm --no-git
|
|
154
154
|
npx @auis/cli@latest my-product --ref v1.0.0
|
|
155
155
|
npx @auis/cli@latest doctor # what Auis can do in the current repo, writes nothing
|
|
156
|
-
npx @auis/cli@latest init # install
|
|
156
|
+
npx @auis/cli@latest init # pick what to install into the current Next.js app
|
|
157
|
+
npx @auis/cli@latest init --only review --yes # same, no menu (CI, scripts)
|
|
157
158
|
npx @auis/cli@latest uninstall # and take it back out
|
|
158
159
|
```
|
|
159
160
|
|
|
@@ -170,8 +171,8 @@ falling back to `git clone --depth 1`. The CLI itself has zero dependencies;
|
|
|
170
171
|
|
|
171
172
|
Everything in the repository, minus the parts that only concern contributing to
|
|
172
173
|
Auis (`.github/ISSUE_TEMPLATE`, `PULL_REQUEST_TEMPLATE.md`, `CONTRIBUTING.md`,
|
|
173
|
-
`CODE_OF_CONDUCT.md`, the extraction/cleanup notes,
|
|
174
|
-
directory), plus:
|
|
174
|
+
`CODE_OF_CONDUCT.md`, the extraction/cleanup notes, the images of the Auis
|
|
175
|
+
README, and this `packages/` directory), plus:
|
|
175
176
|
|
|
176
177
|
- `package.json` renamed to your project, `0.1.0`, `private: true`, with an
|
|
177
178
|
`auis` field recording the template ref it came from;
|
package/package.json
CHANGED
package/src/create.mjs
CHANGED
|
@@ -18,6 +18,11 @@ export const PRUNE = [
|
|
|
18
18
|
".git",
|
|
19
19
|
".github/ISSUE_TEMPLATE",
|
|
20
20
|
".github/PULL_REQUEST_TEMPLATE.md",
|
|
21
|
+
// The images of the Auis README, and the attributes file whose only job is
|
|
22
|
+
// to keep them out of the tarball. The tarball already leaves both behind;
|
|
23
|
+
// this covers the `git clone` fallback, which does not read export-ignore.
|
|
24
|
+
".github/readme",
|
|
25
|
+
".gitattributes",
|
|
21
26
|
"CONTRIBUTING.md",
|
|
22
27
|
"CODE_OF_CONDUCT.md",
|
|
23
28
|
"docs/EXTRACTION-AUDIT.md",
|
package/src/detect.mjs
CHANGED
|
@@ -19,6 +19,14 @@ const SKIP_DIRS = new Set([
|
|
|
19
19
|
"dist", "build", "out", "coverage", "vendor", "__pycache__",
|
|
20
20
|
]);
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Paths below the root that hold copies of the repository rather than its
|
|
24
|
+
* source. Claude Code keeps each worktree as a full checkout under
|
|
25
|
+
* `.claude/worktrees/`: reading them would count every file twice, eat the scan
|
|
26
|
+
* cap, and report what a stale copy does as what the app does.
|
|
27
|
+
*/
|
|
28
|
+
const SKIP_PATHS = new Set([".claude/worktrees"]);
|
|
29
|
+
|
|
22
30
|
const SOURCE_EXT = new Set([".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".vue", ".svelte", ".astro"]);
|
|
23
31
|
|
|
24
32
|
function read(root, rel) {
|
|
@@ -58,7 +66,8 @@ export function sourceFiles(root, limit = 4000) {
|
|
|
58
66
|
if (entry.name.startsWith(".") && entry.name !== ".claude") continue;
|
|
59
67
|
const p = path.join(dir, entry.name);
|
|
60
68
|
if (entry.isDirectory()) {
|
|
61
|
-
|
|
69
|
+
const rel = path.relative(root, p).split(path.sep).join("/");
|
|
70
|
+
if (!SKIP_DIRS.has(entry.name) && !SKIP_PATHS.has(rel)) walk(p);
|
|
62
71
|
} else if (SOURCE_EXT.has(path.extname(entry.name))) {
|
|
63
72
|
out.push(p);
|
|
64
73
|
}
|
package/src/install.mjs
CHANGED
|
@@ -209,14 +209,31 @@ export function removeGitignoreBlock(source) {
|
|
|
209
209
|
* with a reason when it cannot install there; otherwise the steps, each with
|
|
210
210
|
* enough detail for doctor to print and for init to carry out.
|
|
211
211
|
*/
|
|
212
|
+
const FRAMEWORK_LABEL = {
|
|
213
|
+
nuxt: "Nuxt", remix: "Remix", astro: "Astro", sveltekit: "SvelteKit",
|
|
214
|
+
angular: "Angular", vite: "Vite", cra: "Create React App",
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
/** Why this folder is not a place init can install into, said plainly. */
|
|
218
|
+
function whatIsHere(d, root) {
|
|
219
|
+
if (d.framework.name === "unknown") {
|
|
220
|
+
return fs.existsSync(abs(root, "package.json"))
|
|
221
|
+
? "the package.json here declares no framework. Run it from your app's root"
|
|
222
|
+
: "there is no package.json here. Run it from your app's root";
|
|
223
|
+
}
|
|
224
|
+
if (d.framework.name === "next") {
|
|
225
|
+
return d.router.name === "pages-router"
|
|
226
|
+
? "this Next.js app is on the Pages Router"
|
|
227
|
+
: "this Next.js app has no app/layout";
|
|
228
|
+
}
|
|
229
|
+
return `this is ${FRAMEWORK_LABEL[d.framework.name] ?? d.framework.name}`;
|
|
230
|
+
}
|
|
231
|
+
|
|
212
232
|
export function planInstall(d, root, { packageManager } = {}) {
|
|
213
233
|
if (d.framework.name !== "next" || d.router.name !== "app-router") {
|
|
214
|
-
const found = d.framework.name === "unknown"
|
|
215
|
-
? "no JavaScript framework"
|
|
216
|
-
: `${d.framework.name}${d.router.name === "pages-router" ? " on the Pages Router" : ""}`;
|
|
217
234
|
return {
|
|
218
235
|
ok: false,
|
|
219
|
-
reason: `auis init installs into a Next.js App Router app today
|
|
236
|
+
reason: `auis init installs into a Next.js App Router app today, and ${whatIsHere(d, root)}.`,
|
|
220
237
|
steps: [],
|
|
221
238
|
};
|
|
222
239
|
}
|
package/src/modules.mjs
CHANGED
|
@@ -82,7 +82,9 @@ export function resolveOnly(value, choices) {
|
|
|
82
82
|
}
|
|
83
83
|
for (const id of asked) {
|
|
84
84
|
const row = choices.find((c) => c.id === id);
|
|
85
|
-
if (!row.selectable)
|
|
85
|
+
if (!row.selectable) {
|
|
86
|
+
return { ok: false, message: `${row.label} cannot be installed here: ${String(row.note).replace(/\.$/, "")}.` };
|
|
87
|
+
}
|
|
86
88
|
}
|
|
87
89
|
return { ok: true, ids: MODULE_IDS.filter((id) => asked.includes(id)) };
|
|
88
90
|
}
|