Out-of-scope finding from objectui#3853 (which fixed the same defect in the other two generators, in app-generator.ts). Filed rather than fixed there: commands/init.ts is a third generator with its own tsconfig object and was outside that card's surface.
Unlike #3853's temp app, this one is live today — the scaffold's own build script runs tsc.
Measured on origin/main @ 877385a76
Generated buildInitFiles('sample-app', 'simple') to disk and ran the workspace's tsc -p with the scaffold's own tsconfig.json. One error is unrelated to module resolution:
src/main.tsx(4,8): error TS2882: Cannot find module or type declarations for
side-effect import of './index.css'.
(The other two are @object-ui/react / @object-ui/components not being installed in the probe, which is expected and not a defect.)
Why this one bites, where #3853's did not
#3853's temp app is only ever consumed by Vite, so its tsconfig was decorative. This scaffold's generated package.json declares:
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
}
tsc runs first, and the scaffold's tsconfig has strict + noUnusedLocals + noUnusedParameters. So a user who runs objectui init and then the npm run build the README tells them to run gets a type error in a file the tool generated, before Vite is ever reached. That is the follow-the-docs-and-fail shape, on the first command an external user runs.
Cause
buildInitFiles writes src/App.tsx, src/main.tsx and src/index.css, but no ambient declaration for CSS modules. TypeScript has no built-in notion of a .css module; the declarations live in vite/client.
Suggested fix (same shape as #3853's)
Add src/vite-env.d.ts containing the triple-slash reference to vite/client — the file create-vite's own React+TS template writes for exactly this reason. vite is already in the scaffold's devDependencies (SCAFFOLD_DEV_DEPENDENCIES), so nothing new is declared.
Worth pairing it with the tsc gate #3853 added for the other two generators: app-generator.test.ts already builds initFiles() and runs the structural gates over it, so extending the new generated app type-checks under its own tsconfig block to the init scaffold is a small addition, and its .d.ts would need the same reachability exemption that PR already introduced.
Out-of-scope finding from objectui#3853 (which fixed the same defect in the other two generators, in
app-generator.ts). Filed rather than fixed there:commands/init.tsis a third generator with its owntsconfigobject and was outside that card's surface.Unlike #3853's temp app, this one is live today — the scaffold's own build script runs
tsc.Measured on
origin/main@877385a76Generated
buildInitFiles('sample-app', 'simple')to disk and ran the workspace'stsc -pwith the scaffold's owntsconfig.json. One error is unrelated to module resolution:(The other two are
@object-ui/react/@object-ui/componentsnot being installed in the probe, which is expected and not a defect.)Why this one bites, where #3853's did not
#3853's temp app is only ever consumed by Vite, so its tsconfig was decorative. This scaffold's generated
package.jsondeclares:tscruns first, and the scaffold'stsconfighasstrict+noUnusedLocals+noUnusedParameters. So a user who runsobjectui initand then thenpm run buildthe README tells them to run gets a type error in a file the tool generated, before Vite is ever reached. That is the follow-the-docs-and-fail shape, on the first command an external user runs.Cause
buildInitFileswritessrc/App.tsx,src/main.tsxandsrc/index.css, but no ambient declaration for CSS modules. TypeScript has no built-in notion of a.cssmodule; the declarations live invite/client.Suggested fix (same shape as #3853's)
Add
src/vite-env.d.tscontaining the triple-slash reference tovite/client— the filecreate-vite's own React+TS template writes for exactly this reason.viteis already in the scaffold'sdevDependencies(SCAFFOLD_DEV_DEPENDENCIES), so nothing new is declared.Worth pairing it with the
tscgate #3853 added for the other two generators:app-generator.test.tsalready buildsinitFiles()and runs the structural gates over it, so extending the newgenerated app type-checks under its own tsconfigblock to the init scaffold is a small addition, and its.d.tswould need the same reachability exemption that PR already introduced.