coralite-scripts 0.25.0 → 0.26.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.
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../libs/config.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,sCArBW,oBAAoB,GAClB,oBAAoB,CAuEhC;0CAjFsC,mBAAmB"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../libs/config.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,sCArBW,oBAAoB,GAClB,oBAAoB,CA6GhC;0CAvHsC,mBAAmB"}
package/libs/config.js CHANGED
@@ -79,5 +79,43 @@ export function defineConfig (options) {
79
79
  throw new Error('Configuration must contain a valid "public" property')
80
80
  }
81
81
 
82
+ if (options.ignoreByAttribute) {
83
+ if (!Array.isArray(options.ignoreByAttribute)) {
84
+ throw new Error('Configuration "ignoreByAttribute" must be an array')
85
+ }
86
+
87
+ for (let i = 0; i < options.ignoreByAttribute.length; i++) {
88
+ const item = options.ignoreByAttribute[i]
89
+ if (!item || typeof item !== 'object') {
90
+ throw new Error('Configuration "ignoreByAttribute" items must be objects')
91
+ }
92
+ if (typeof item.name !== 'string') {
93
+ throw new Error('Configuration "ignoreByAttribute" items must have a string "name" property')
94
+ }
95
+ if (typeof item.value !== 'string') {
96
+ throw new Error('Configuration "ignoreByAttribute" items must have a string "value" property')
97
+ }
98
+ }
99
+ }
100
+
101
+ if (options.skipRenderByAttribute) {
102
+ if (!Array.isArray(options.skipRenderByAttribute)) {
103
+ throw new Error('Configuration "skipRenderByAttribute" must be an array')
104
+ }
105
+
106
+ for (let i = 0; i < options.skipRenderByAttribute.length; i++) {
107
+ const item = options.skipRenderByAttribute[i]
108
+ if (!item || typeof item !== 'object') {
109
+ throw new Error('Configuration "skipRenderByAttribute" items must be objects')
110
+ }
111
+ if (typeof item.name !== 'string') {
112
+ throw new Error('Configuration "skipRenderByAttribute" items must have a string "name" property')
113
+ }
114
+ if (typeof item.value !== 'string') {
115
+ throw new Error('Configuration "skipRenderByAttribute" items must have a string "value" property')
116
+ }
117
+ }
118
+ }
119
+
82
120
  return options
83
121
  }
package/libs/server.js CHANGED
@@ -37,6 +37,8 @@ async function server (config, options) {
37
37
  templates: config.templates,
38
38
  pages: config.pages,
39
39
  plugins: config.plugins,
40
+ ignoreByAttribute: config.ignoreByAttribute,
41
+ skipRenderByAttribute: config.skipRenderByAttribute,
40
42
  mode: 'development'
41
43
  })
42
44
  await coralite.initialise()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coralite-scripts",
3
- "version": "0.25.0",
3
+ "version": "0.26.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.25.0"
61
+ "coralite": "0.26.0"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "premove dist && pnpm build-types",