@01-edu/shared 1.0.4 → 1.0.5

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.
@@ -5,24 +5,30 @@ import { readFile, stat } from 'node:fs/promises'
5
5
  import { checkAndBuildDefinitions } from '../definitions-checker.js'
6
6
 
7
7
  const auditValidation = validation => validation.type.endsWith('_audit')
8
- const result = await checkAndBuildDefinitions(async key => {
9
- const referencePath = `content${key ? `/${key}` : ''}/def.json`
10
- const def = JSON.parse(await readFile(referencePath, 'utf8'))
11
- def.attrs || (def.attrs = {})
12
- def.referencePath = referencePath
13
- switch (def.type) {
14
- case 'project':
15
- // biome-ignore lint/suspicious/noFallthroughSwitchClause: We want to fallthrough
16
- case 'raid': {
17
- await stat(`content/${key}/audit/README.md`)
8
+ try {
9
+ const result = await checkAndBuildDefinitions(async key => {
10
+ const referencePath = `content${key ? `/${key}` : ''}/def.json`
11
+ const def = JSON.parse(await readFile(referencePath, 'utf8'))
12
+ def.attrs || (def.attrs = {})
13
+ def.referencePath = referencePath
14
+ switch (def.type) {
15
+ case 'project':
16
+ // biome-ignore lint/suspicious/noFallthroughSwitchClause: We want to fallthrough
17
+ case 'raid': {
18
+ await stat(`content/${key}/audit/README.md`)
19
+ }
20
+ case 'exercise': {
21
+ await stat(`content/${key}/README.md`)
22
+ }
18
23
  }
19
- case 'exercise': {
20
- await stat(`content/${key}/README.md`)
21
- }
22
- }
23
24
 
24
- return def
25
- })
25
+ return def
26
+ })
27
+ } catch ({ message, ...props }) {
28
+ console.error(message, props)
29
+ process.exit(1)
30
+ }
26
31
 
32
+ console.log('All checks passed, no errors')
27
33
  // Extra checks:
28
34
  // - Orphan files (defs files not referenced anywhere)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@01-edu/shared",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "scripts": {