# @stack54/cli

> stack54 cli

Latest version **0.1.0** (published 2024-03-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install @stack54/cli
pnpm add @stack54/cli
yarn add @stack54/cli
bun add @stack54/cli
```

Provides the command `stack54`.

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2024-03-29 |
| First published | 2024-03-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 7 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Joshua Amaju |
| Maintainers | joshamaju |

## Links

- npm: https://www.npmjs.com/package/@stack54/cli
- Repository: https://github.com/joshamaju/stack54
- Homepage: https://github.com/joshamaju/stack54#readme
- Issues: https://github.com/joshamaju/stack54/issues
- npm.io page: https://npm.io/package/@stack54/cli

## Dependencies (7)

- [sade](https://npm.io/package/sade.md) ^1.8.1
- [giget](https://npm.io/package/giget.md) ^1.2.3
- [kleur](https://npm.io/package/kleur.md) ^4.1.5
- [enquirer](https://npm.io/package/enquirer.md) ^2.4.1
- [ts-dedent](https://npm.io/package/ts-dedent.md) ^2.2.0
- [inflection](https://npm.io/package/inflection.md) ^3.0.0
- [@clack/prompts](https://npm.io/package/@clack/prompts.md) ^0.7.0

## Recent versions

- 0.1.0 (latest) — 2024-03-29

## README

# MPA

🚧 [WIP]

## ✨ Features

- Hot reload
- HTML asset bundling
- Typed environment variables
- Templates with Svelte and Markdown

## Configuration

```ts
import { defineConfig } from "vite";
import mpa from "stack54/vite";

export default defineConfig({
  plugins: [
    mpa({
      /* ...config */
    }),
  ],
});
```

### API

- `publicEnvPrefix`: default `PUBLIC\_`
- `extensions`: default `.svelte`, `.svx`
- `serverEntry`: default src/entry.{js,ts,mjs,mts}
- `preprocess`: [documentation](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md#preprocess)
- `compilerOptions`: [documentation](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md#compileroptions)

## Routing

```ts
import { Hono } from "hono";

const router = new Hono();

router.get("/", (ctx) => ctx.html(view("about")));
```

### Nested router

```ts
import { Hono } from "hono";

const router = new Hono();

// nested
const nested = new Hono();
nested.get("/", (ctx) => ctx.html(view("about")));
// nested

router.route("*", nested);
```

## Rendering

To render a component/template, include `ssr` query in file import i.e

```ts
import { renderToString } from "stack54/render";
import About from "./views/about.svelte?ssr";

renderToString(
  About.render({
    /* props */
  })
);

// or

renderToString(About, {
  /* props */
});
```

Or

```ts
import { makeFactory, resolveComponent } from "stack54/render";

const templates = import.meta.glob("./views/**/*.page.svelte", {
  query: { ssr: true },
  eager: true,
});

export const view = makeFactory((name) => {
  return resolveComponent(`./views/${name}.svelte`, templates);
});

view("about", {
  /* props */
});
```

## Limitations

- Cannot use dynamic import types in templates i.e

```ts
export let prop: import("some-module").Type;
```

---
_Source: https://npm.io/package/@stack54/cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
