11# 🪢 DOMStack
2- [ ![ npm version] ( https://img.shields.io/npm/v/@domstack/cli .svg )] ( https://npmjs.org/package/@domstack/cli )
2+ [ ![ npm version] ( https://img.shields.io/npm/v/@domstack/static .svg )] ( https://npmjs.org/package/@domstack/static )
33[ ![ Actions Status] ( https://github.com/bcomnes/domstack/workflows/tests/badge.svg )] ( https://github.com/bcomnes/domstack/actions )
44[ ![ Coverage Status] ( https://coveralls.io/repos/github/bcomnes/domstack/badge.svg?branch=master )] ( https://coveralls.io/github/bcomnes/domstack?branch=master )
55[ ![ Types in JS] ( https://img.shields.io/badge/types_in_js-yes-brightgreen )] ( https://github.com/voxpelli/types-in-js )
@@ -12,7 +12,7 @@ DOMStack provides a few project conventions around esbuild ande Node.js that let
1212It's fast to learn, quick to build with, and performs better than you are used to.
1313
1414``` console
15- npm install @domstack/cli
15+ npm install @domstack/static
1616```
1717
1818- 🌎 [ domstack docs website] ( https://domstack.net )
@@ -237,7 +237,7 @@ src/page-name/page.js
237237An example TypeScript page:
238238
239239``` typescript
240- import type { PageFunction } from ' @domstack/cli '
240+ import type { PageFunction } from ' @domstack/static '
241241
242242export const vars = {
243243 favoriteCookie: ' Chocolate Chip with Sea Salt'
@@ -260,7 +260,7 @@ It is recommended to use some level of template processing over raw string templ
260260``` typescript
261261import { html } from ' htm/preact'
262262import { dirname , basename } from ' node:path'
263- import type { PageFunction } from ' @domstack/cli '
263+ import type { PageFunction } from ' @domstack/static '
264264
265265type BlogVars = {
266266 favoriteCake: string
@@ -465,7 +465,7 @@ The default `root.layout.ts` is featured below, and is implemented with [`preact
465465``` typescript
466466import { html } from ' htm/preact'
467467import { render } from ' preact-render-to-string'
468- import type { LayoutFunction } from ' @domstack/cli '
468+ import type { LayoutFunction } from ' @domstack/static '
469469
470470type RootLayoutVars = {
471471 title: string ,
@@ -528,7 +528,7 @@ For example, you could define a `blog.layout.ts` that re-uses the `root.layout.t
528528import defaultRootLayout from ' ./root.layout.js'
529529import { html } from ' htm/preact'
530530import { render } from ' preact-render-to-string'
531- import type { LayoutFunction } from ' @domstack/cli '
531+ import type { LayoutFunction } from ' @domstack/static '
532532
533533// Import the type from root layout
534534import type { RootLayoutVars } from ' ./root.layout'
@@ -727,7 +727,7 @@ A function that returns a string. The `name-of-template.txt` portion of the temp
727727
728728``` typescript
729729// name-of-template.txt.template.ts
730- import type { TemplateFunction } from ' @domstack/cli '
730+ import type { TemplateFunction } from ' @domstack/static '
731731
732732interface TemplateVars {
733733 foo: string ;
@@ -751,7 +751,7 @@ This is just a file with access to global vars: ${foo}`
751751A function that returns a single object with a ` content ` and ` outputName ` entries. The ` outputName ` overrides the name portion of the template file name.
752752
753753``` typescript
754- import type { TemplateFunction } from ' @domstack/cli '
754+ import type { TemplateFunction } from ' @domstack/static '
755755
756756interface TemplateVars {
757757 foo: string ;
@@ -771,7 +771,7 @@ This is just a file with access to global vars: ${foo}`,
771771A function that returns an array of objects with a ` content ` and ` outputName ` entries. This template file generates more than one file from a single template file.
772772
773773``` typescript
774- import type { TemplateFunction } from ' @domstack/cli '
774+ import type { TemplateFunction } from ' @domstack/static '
775775
776776interface TemplateVars {
777777 foo: string ;
@@ -806,7 +806,7 @@ This is just a file with access to global vars: ${testVar}`,
806806An [ AsyncIterator] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncIterator ) that ` yields ` objects with ` content ` and ` outputName ` entries.
807807
808808``` typescript
809- import type { TemplateAsyncIterator } from ' @domstack/cli '
809+ import type { TemplateAsyncIterator } from ' @domstack/static '
810810
811811interface TemplateVars {
812812 foo: string ;
@@ -846,7 +846,7 @@ The following example shows how to generate an [RSS](https://www.rssboard.org) a
846846``` typescript
847847import pMap from ' p-map'
848848import jsonfeedToAtom from ' jsonfeed-to-atom'
849- import type { TemplateAsyncIterator } from ' @domstack/cli '
849+ import type { TemplateAsyncIterator } from ' @domstack/static '
850850
851851interface TemplateVars {
852852 title: string ;
@@ -965,7 +965,7 @@ Here is an example of using this file to polyfill node builtins in the browser b
965965``` typescript
966966import { polyfillNode } from ' esbuild-plugin-polyfill-node'
967967// BuildOptions re-exported from esbuild
968- import type { BuildOptions } from ' @domstack/cli '
968+ import type { BuildOptions } from ' @domstack/static '
969969
970970export default const esbuildSettingsOverride = async (esbuildSettings : BuildOptions ): Promise <BuildOptions > => {
971971 esbuildSettings .plugins = [polyfillNode ()]
@@ -1082,7 +1082,7 @@ For example:
10821082``` typescript
10831083import { html } from ' htm/preact'
10841084import { render } from ' preact-render-to-string'
1085- import type { PostVarsFunction } from ' @domstack/cli '
1085+ import type { PostVarsFunction } from ' @domstack/static '
10861086
10871087export const postVars: PostVarsFunction = async ({
10881088 pages
@@ -1178,7 +1178,7 @@ import type {
11781178 PageFunction ,
11791179 TemplateFunction ,
11801180 TemplateAsyncIterator
1181- } from ' @domstack/cli '
1181+ } from ' @domstack/static '
11821182```
11831183
11841184They are all generic and accept a variable template that you can develop and share between files.
0 commit comments