-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): replace jest with vitest
- Loading branch information
1 parent
69506ac
commit dfb098e
Showing
70 changed files
with
10,203 additions
and
13,498 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
], | ||
"env": { | ||
"es6": true, | ||
"jest": true, | ||
"node": true | ||
}, | ||
"plugins": ["simple-import-sort"], | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}, | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.