Skip to content

Commit

Permalink
chore(deps): replace jest with vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanshatford committed Mar 20, 2024
1 parent 69506ac commit dfb098e
Show file tree
Hide file tree
Showing 70 changed files with 10,203 additions and 13,498 deletions.
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
],
"env": {
"es6": true,
"jest": true,
"node": true
},
"plugins": ["simple-import-sort"],
Expand Down
18 changes: 0 additions & 18 deletions babel.config.json

This file was deleted.

59 changes: 59 additions & 0 deletions handlebars.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { readFileSync } from 'node:fs';
import path from 'node:path';

import handlebars from 'handlebars';
import type { Plugin } from 'rollup';

/**
* Custom plugin to parse handlebar imports and precompile
* the template on the fly. This reduces runtime by about
* half on large projects.
*/
export function handlebarsPlugin(): Plugin {
return {
name: 'handlebars',
resolveId: (file: any, importer: any) => {
if (path.extname(file) === '.hbs') {
return path.resolve(path.dirname(importer), file);
}
return null;
},
load: (file: any) => {
if (path.extname(file) === '.hbs') {
const template = readFileSync(file, 'utf8').toString().trim();
const templateSpec = handlebars.precompile(template, {
knownHelpers: {
camelCase: true,
dataParameters: true,
debugThis: true,
enumKey: true,
enumName: true,
enumUnionType: true,
enumValue: true,
equals: true,
escapeComment: true,
escapeDescription: true,
escapeNewline: true,
exactArray: true,
ifdef: true,
ifOperationDataOptional: true,
intersection: true,
modelImports: true,
modelsExports: true,
modelUnionType: true,
nameOperationDataType: true,
notEquals: true,
operationDataType: true,
useDateType: true,
},
knownHelpersOnly: true,
noEscape: true,
preventIndent: true,
strict: true,
});
return `export default ${templateSpec};`;
}
return null;
},
};
}
43 changes: 0 additions & 43 deletions jest.config.ts

This file was deleted.

Loading

0 comments on commit dfb098e

Please sign in to comment.