coralite-scripts 0.29.6 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/index.js CHANGED
@@ -7,7 +7,7 @@ import colours from 'kleur'
7
7
  import pkg from '../package.json' with { type: 'json' }
8
8
  import buildSass from '../libs/build-sass.js'
9
9
  import { join, relative } from 'node:path'
10
- import { deleteDirectoryRecursive, copyDirectory, toMS, toTime, displayError } from '../libs/build-utils.js'
10
+ import { deleteDirectoryRecursive, copyDirectory, toMS, toTime, displayError, displayWarning, displayInfo } from '../libs/build-utils.js'
11
11
  import buildCSS from '../libs/build-css.js'
12
12
  import { Coralite } from 'coralite'
13
13
  import { mkdir, writeFile } from 'node:fs/promises'
@@ -69,7 +69,16 @@ if (mode === 'dev') {
69
69
  assets: config.assets,
70
70
  baseURL: config.baseURL,
71
71
  output: config.output,
72
- mode: 'production'
72
+ mode: 'production',
73
+ onError: ({ level, message, error }) => {
74
+ if (level === 'ERR') {
75
+ displayError(message, error)
76
+ } else if (level === 'WARN') {
77
+ displayWarning(message)
78
+ } else {
79
+ displayInfo(message)
80
+ }
81
+ }
73
82
  })
74
83
  await coralite.initialise()
75
84
 
package/libs/server.js CHANGED
@@ -3,7 +3,7 @@ import colours from 'kleur'
3
3
  import localAccess from 'local-access'
4
4
  import chokidar from 'chokidar'
5
5
  import buildSass from './build-sass.js'
6
- import { displayError, displayInfo, displaySuccess, toCode, toMS, toTime, deleteDirectoryRecursive } from './build-utils.js'
6
+ import { displayError, displayInfo, displayWarning, displaySuccess, toCode, toMS, toTime, deleteDirectoryRecursive } from './build-utils.js'
7
7
  import { extname, join, normalize, relative, sep } from 'path'
8
8
  import { access, constants, mkdir, writeFile } from 'fs/promises'
9
9
  import Coralite from 'coralite'
@@ -42,7 +42,16 @@ async function server (config, options) {
42
42
  ignoreByAttribute: config.ignoreByAttribute,
43
43
  skipRenderByAttribute: config.skipRenderByAttribute,
44
44
  mode: 'development',
45
- output: config.output
45
+ output: config.output,
46
+ onError: ({ level, message, error }) => {
47
+ if (level === 'ERR') {
48
+ displayError(message, error)
49
+ } else if (level === 'WARN') {
50
+ displayWarning(message)
51
+ } else {
52
+ displayInfo(message)
53
+ }
54
+ }
46
55
  })
47
56
  await coralite.initialise()
48
57
  displaySuccess('Coralite initialized successfully')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coralite-scripts",
3
- "version": "0.29.6",
3
+ "version": "0.31.0",
4
4
  "description": "Configuration and scripts for Create Coralite.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -58,7 +58,7 @@
58
58
  "portfinder": "^1.0.38",
59
59
  "postcss": "^8.5.6",
60
60
  "sass": "^1.91.0",
61
- "coralite": "0.29.5"
61
+ "coralite": "0.31.0"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "premove dist && pnpm build-types",