@@ -10,7 +10,7 @@ import { testSelectedFiles } from "./allowList";
10
10
11
11
import { cheatsheetBodyClasses } from "@cursorless/cheatsheet" ;
12
12
13
- const fixturesDir = path . join ( "../" , "../" , "data" , "fixtures" , "recorded ") ;
13
+ const fixturesDir = path . join ( "../" , "../" , "data" , "example-files " ) ;
14
14
15
15
async function loadYamlFiles ( dir : string , selectedFiles ?: string [ ] ) {
16
16
const directoryPath = path . join ( process . cwd ( ) , dir ) ;
@@ -39,40 +39,22 @@ async function loadYamlFiles(dir: string, selectedFiles?: string[]) {
39
39
40
40
// See https://github.com/vercel/next.js/discussions/12325#discussioncomment-1116108
41
41
export async function getStaticProps ( ) {
42
- const itemsDirActions = path . join ( fixturesDir , "actions" ) ;
43
- const itemsDirDecorations = path . join ( fixturesDir , "decorations" ) ;
44
- const itemsDirInsertEmptyLines = path . join (
45
- fixturesDir ,
46
- "actions/insertEmptyLines" ,
47
- ) ;
48
-
49
- const dataActions = await loadYamlFiles ( itemsDirActions , testSelectedFiles ) ;
50
- const dataInsertEmptyLines = await loadYamlFiles (
51
- itemsDirInsertEmptyLines ,
52
- testSelectedFiles ,
53
- ) ;
54
-
55
- const dataDecorations = await loadYamlFiles (
56
- itemsDirDecorations ,
57
- testSelectedFiles ,
58
- ) ;
42
+ const dataActions = await loadYamlFiles ( fixturesDir , testSelectedFiles ) ;
59
43
60
44
const data_errors : any [ ] = [ ] ;
61
45
62
46
const data = (
63
47
await Promise . all (
64
- [ ...dataActions , ...dataDecorations , ...dataInsertEmptyLines ] . map (
65
- async ( val ) => {
66
- try {
67
- const fixture = await loadTestCaseFixture ( val ) ;
68
- return { ...fixture , raw : val } ;
69
- } catch ( err ) {
70
- console . error ( err ) ;
71
- data_errors . push ( val ) ;
72
- return null ;
73
- }
74
- } ,
75
- ) ,
48
+ [ ...dataActions ] . map ( async ( val ) => {
49
+ try {
50
+ const fixture = await loadTestCaseFixture ( val ) ;
51
+ return { ...fixture , raw : val } ;
52
+ } catch ( err ) {
53
+ console . error ( err ) ;
54
+ data_errors . push ( val ) ;
55
+ return null ;
56
+ }
57
+ } ) ,
76
58
)
77
59
) . filter ( ( test ) => test !== undefined ) ;
78
60
0 commit comments