Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Runners

Index

Variables

Const CLIENT_SOCKET_SNIPPET_FOR_WATCH

CLIENT_SOCKET_SNIPPET_FOR_WATCH: "<script>const ws = new WebSocket('ws://localhost:3001');ws.onmessage = event => {const data = JSON.parse(event.data);console.log(data.msg);if (data.type === 'end')location.reload();};</script></body>" = `<script>const ws = new WebSocket('ws://localhost:3001');ws.onmessage = event => {const data = JSON.parse(event.data);console.log(data.msg);if (data.type === 'end')location.reload();};</script></body>`

Code fragment use to make the client listen for changes to the code in watch mode. Formatted as a string and not code for easier injection in HTML.

Functions

buildAll

  • buildAll(__namedParameters?: { isWatching: boolean; runScripts: boolean; runStyles: boolean; skipTexts: boolean }): Promise<Array<void>>
  • Builds the whole website

    Parameters

    • Default value __namedParameters: { isWatching: boolean; runScripts: boolean; runStyles: boolean; skipTexts: boolean } = {}
      • isWatching: boolean
      • runScripts: boolean
      • runStyles: boolean
      • skipTexts: boolean

    Returns Promise<Array<void>>

devServer

  • Dev server for watch mode. Do not use as it is in production!

    Parameters

    • config: YassbConfig

      used to determine the out folder.

    • Optional watcher: {}

      the fucntion that actually watches for changes and invokes the build process.

    Returns void

doCopyAssets

  • doCopyAssets(): void

doHtml

  • Processes all files in the out dir.

    Parameters

    • config: YassbConfig

      the full YASSB configuration Object.

    • Optional lang: string

    Returns void

doScripts

  • doScripts(): Promise<void>
  • Processes the TS/JS assets to generate the minified JS file of the website (if any).

    Returns Promise<void>

    scripts

doStyles

doTextsSources

  • Generates pages from texts sources for any template of the project.

    Parameters

    • config: YassbConfig

      the full YASSB configuration Object.

    Returns Promise<void>

postProcessing

  • postProcessing(config: YassbConfig, isWatching: boolean): Promise<void>
  • Posts processing. Awaits all the promises returned for each file processed.

    Parameters

    • config: YassbConfig

      the full YASSB configuration Object

    • isWatching: boolean

      whether or not we are in watch mode, to avoid unnecessary steps during development.

    Returns Promise<void>

watch

  • watch(): void
  • Wrapper for the watch function. First starts the server and passes the listener as a callback function.

    Returns void

Object literals

Const socketConnectionStore

socketConnectionStore: object

Constant to store the connection to the browser in watch mode to exchange messages. The connection is stored on a Object static contant of this module so that it can be easily accessed by the watch function without passing arguments.

conn

conn: undefined = undefined