Skip to content

astryx init foolproof: @astryxdesign/cli postinstall nudge#4154

Merged
josephfarina merged 2 commits into
mainfrom
navi/vibe/cli-postinstall
Jul 22, 2026
Merged

astryx init foolproof: @astryxdesign/cli postinstall nudge#4154
josephfarina merged 2 commits into
mainfrom
navi/vibe/cli-postinstall

Conversation

@josephfarina

@josephfarina josephfarina commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Enforcement layer 2 of 3. When @astryxdesign/cli is installed as a project dependency and the project hasn't run init yet, its postinstall prints a one-line next-step so agents/humans discover it.

Stacked on #4153 — shares its isAstryxInitialized check. Merge #4153 first; base retargets to main after.

What

  • packages/cli/scripts/postinstall.mjs reuses the one setup check (dep-free import chain → safe at install time). Never fails the install.
  • Quiet in the monorepo/source build, during npx's transient fetch (_npx path or npm_command=exec — npx runs the bin right after, so nudging would double up), and once set up.
  • Message: the validated simple one-liner, identical to the other two layers (scoped npx @astryxdesign/cli init, footgun-free per 4/n astryx init foolproof: scope CLI invocation (no bare npx astryx footgun) #4151).

Tests

cli-postinstall.test.mjsshouldNudge() decision matrix (dependency install / monorepo / npx / already-set-up). 6/6 green.

@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Error Error Jul 22, 2026 4:47am

Request Review

When @astryxdesign/cli is installed as a project dependency and the project
hasn't run init yet, print a one-line next-step so agents/humans discover it.

- scripts/postinstall.mjs reuses the ONE setup check (isAstryxInitialized — a
  dep-free import chain, safe at install time). Never fails the install.
- Quiet in the monorepo/source build, during npx's transient fetch (path _npx
  or npm_command=exec — the bin/init runs right after, so nudging would double
  up), and once setup is already done.
- Message is the validated simple one-liner (message-format vibe test).
- shouldNudge() is a pure, unit-tested decision; guardrail test covers the matrix.

Stacks on the per-command nudge PR (shares isAstryxInitialized).
@josephfarina
josephfarina force-pushed the navi/vibe/cli-postinstall branch from 9628986 to 471af5d Compare July 22, 2026 04:01
@josephfarina
josephfarina changed the base branch from navi/vibe/cli-setup-nudge to main July 22, 2026 04:01
@josephfarina
josephfarina enabled auto-merge (squash) July 22, 2026 04:01
@josephfarina
josephfarina merged commit 4494847 into main Jul 22, 2026
19 checks passed
github-actions Bot added a commit that referenced this pull request Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.7KB 0B

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@github-actions
github-actions Bot deleted the navi/vibe/cli-postinstall branch July 22, 2026 06:56
cixzhang added a commit that referenced this pull request Jul 22, 2026
Seven published-behavior PRs merged since v0.1.7 without a changeset, which
would leave their contributors uncredited in the CHANGELOG. Add changesets so
the v0.1.8 bump credits them:

- core docs.mjs redirect to the CLI (#4207)
- Table tree-data plugin: useTableTreeState / useTableTreeData (#3789)
- Table tree expander aria-label localization (#4149)
- foolproof init: postinstall nudges + non-interactive init (#4147, #4153, #4154, #4155)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant