Registry / devops / what-framework-cli

what-framework-cli

JSON →
library0.8.4jsnpmunverified

What Framework CLI (v0.8.4) is a zero-configuration command-line tool for What Framework projects, providing a development server with WebSocket-based HMR, production builds with content hashing and gzip, a preview server, and static site generation. It is actively maintained and supports commands like `what dev`, `what build`, `what preview`, and `what generate`. Key differentiators include file-based routing from `src/pages/`, bare import transforms, and a hybrid mode for flexible rendering. The CLI is designed to be used as a dev dependency and can be invoked directly via npx.

npm install what-framework-cli
INSTALL
IMPORT
SIG · WHAT-FRAMEWORK-CLI
W
what-framework-cli
devopsjavascriptv0.8.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

what
import { defineConfig } from 'what-framework-cli'
import what from 'what-framework-cli'
ESM-only; CLI commands run via npx, not imported in source code.
config
export default { mode: 'static' } in what.config.js
const config = require('what-framework-cli').config
Configuration is exported as a default object from a JS file, not imported from the package.
CLI
import { createServer } from 'what-framework-cli'
const { createServer } = require('what-framework-cli')
ESM-only; direct API import for programmatic use.

Initializes a new project with What Framework CLI, creates a basic config and page, then starts the dev server.

mkdir my-project && cd my-project npm init -y npm install what-framework-cli --save-dev echo 'export default { mode: "static" }' > what.config.js mkdir src/pages echo "<html><body>Hello</body></html>" > src/pages/index.html npx what dev --port 3000
Debug
Known issues
breakingv0.8.0 changed the configuration format from `module.exports` to `export default`. Existing configs will fail to load.
fix
Update your what.config.js to use `export default { ... }` instead of `module.exports = { ... }`.
affects: <0.8.0
gotchaThe `--host` flag defaults to `localhost`; binding to `0.0.0.0` requires explicit `--host 0.0.0.0` to be accessible on network.
fix
Use `what dev --host 0.0.0.0` to expose the dev server on all network interfaces.
affects: >=0.1.0
deprecatedThe `what init` command is deprecated in favor of `npx create-what`. It still works but may be removed in a future version.
fix
Use `npx create-what my-app` instead of `what init my-app`.
affects: >=0.7.0
gotchaFile-based routing expects pages in `src/pages/`; any other directory will not be automatically routed.
fix
Place page files in `src/pages/` or change `pagesDir` in config.
affects: >=0.1.0
gotchaHMR uses WebSocket; if you are behind a proxy that doesn't support WebSocket upgrade, HMR will fail silently.
fix
Ensure your proxy supports WebSocket upgrade headers.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'what-framework-cli'
Package is installed as a dev dependency but not installed globally.
fix
Run the CLI via `npx what-framework-cli dev` or install it globally with `npm install -g what-framework-cli`.
SyntaxError: Unexpected token 'export'
The config file uses `export default` but Node.js is not in ESM mode (e.g., `type: 'module'` missing in package.json).
fix
Add `"type": "module"` to your package.json or rename config file to `.mjs`.
Error: Config file what.config.js not found
The CLI looks for a config file in the current working directory; it is missing or misnamed.
fix
Create a `what.config.js` file in your project root with the appropriate configuration.
TypeError: config.mode is undefined
Config file exists but does not export an object with a `mode` property.
fix
Export an object with a valid `mode` field, e.g., `export default { mode: 'static' }`.
Upgrade
Version history
0.8.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
what-framework-cli — npm install what-framework-cli · libregistry