You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cli): name the standalone os create plugin scaffold plugin-NAME and mark it private (#17096)
* fix(cli): name the standalone `os create plugin` scaffold `plugin-<name>` and mark it private
The default (standalone) emission wrote `"name": "@objectstack/plugin-<name>"`
into a project scaffolded for a developer outside this monorepo -- a scope they
cannot publish to -- and did not mark the manifest `private`. Nothing here could
see it: the name is never resolved from a registry inside the emitted project,
so the unit pins, the type-check and `scripts/create-scaffold-smoke.sh` were all
green on it, and the cost landed later at `npm publish`, in someone else's
terminal. The emitted README compounded it by instructing `pnpm add
@objectstack/plugin-<name>` -- a second copy of the same name, which a manifest
rename alone would leave pointing at a package that exists under no name at all.
Standalone now emits `plugin-<name>` -- unscoped, COMPOSED from the directory
name the scaffolder prints, so a template that renames its directory cannot
leave a stale package name behind -- plus `"private": true`, which is the half
that actually prevents the defect: `npm publish` refuses a private manifest
loudly whatever the name says. The README's install instruction becomes a local
reference and its import specifier follows the emitted name.
`--in-repo` is unchanged and stays publishable as `@objectstack/plugin-<name>`:
that placement lands under `packages/plugins/`, where every sibling genuinely
carries that scope.
The pin renders BOTH placements in one run and closes with an inequality, so a
scaffolder that stopped discriminating -- or stopped emitting -- cannot pass it.
Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8
Co-authored-by: Claude <noreply@anthropic.com>
* fix(cli): spell the scaffold's local install as `pnpm link --global`, not a relative path
`test/init-template-comments-self-contained.test.ts` refuses a rendered scaffold
file that cites a path climbing out of the project, and it was right to: the
scaffolder knows where THIS project landed and knows nothing about where the
reader's app is, so `pnpm add link:../plugin-<name>` was a guess about a
directory layout it never created -- an unfollowable reference in the same class
as the `../../content/docs` link that pin was written for.
`pnpm link --global` names no location at all: both halves run where the reader
already is. The pin asserts it from both sides -- the registry verb `pnpm add`
is absent from the standalone README, the local one is present and names this
package -- plus an explicit refusal of any `../`, so the path spelling cannot
come back without reddening here first.
Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8
Co-authored-by: Claude <noreply@anthropic.com>
* refactor(cli): keep `pluginPackageName` module-private -- nothing imports it
Every other exported symbol in this file is exported because a test in this
package imports it (`emittedPackageName`, `validateEmittedPackageName`,
`objectstackDependencySpec`, `rootTsconfigExtends`, `sanitizeIdentifier`,
`DEFAULT_PLACEMENT` -- measured, each has one). This one had no importer and
must not get one: `test/create.test.ts` pins the two composed names as LITERALS
precisely so the pin cannot move together with the function it is pinning.
Behaviour is byte-identical; this narrows the module's surface to its readers.
Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8
Co-authored-by: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments