Skip to content

Commit

Permalink
add releases to JSR (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-hemphill authored Jul 2, 2024
1 parent 507a844 commit b0e2c30
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
12 changes: 12 additions & 0 deletions jsr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@eta-dev/eta",
"version": "3.4.0",
"exports": "./src/index.ts",
"publish": {
"include": [
"LICENSE",
"README.md",
"src/**/*.ts"
]
}
}
4 changes: 4 additions & 0 deletions jsr.release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require('node:fs').writeFileSync('jsr.json', JSON.stringify({
...require('./jsr.json'),
"version": require('./package.json').version,
}, null, 2) + '\n');
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"format": "prettier --write '{src,test}/**/**.ts'",
"lint": "eslint src/*.ts test/*.spec.ts --ext .js,.ts",
"prebuild": "rimraf dist",
"release": "npm run build && np",
"release": "npm run build && np && npx jsr publish",
"postversion": "node ./jsr.release.js",
"size": "size-limit",
"start": "microbundle watch",
"test": "jest --coverage && npm run size",
Expand Down
2 changes: 1 addition & 1 deletion src/compile-string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ return __eta.res;
* ```
*/

export function compileBody(this: Eta, buff: Array<AstObject>) {
export function compileBody(this: Eta, buff: Array<AstObject>): string {
const config = this.config;

let i = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export class Eta {
renderStringAsync = renderStringAsync;

filepathCache: Record<string, string> = {};
templatesSync = new Cacher<TemplateFunction>({});
templatesAsync = new Cacher<TemplateFunction>({});
templatesSync: Cacher<TemplateFunction> = new Cacher<TemplateFunction>({});
templatesAsync: Cacher<TemplateFunction> = new Cacher<TemplateFunction>({});

// resolvePath takes a relative path from the "views" directory
resolvePath: null | ((this: Eta, template: string, options?: Partial<Options>) => string) = null;
Expand All @@ -47,7 +47,7 @@ export class Eta {
this.config = { ...this.config, ...customConfig };
}

withConfig(customConfig: Partial<EtaConfig>) {
withConfig(customConfig: Partial<EtaConfig>): this & { config: EtaConfig }{
return { ...this, config: { ...this.config, ...customConfig } };
}

Expand Down

0 comments on commit b0e2c30

Please sign in to comment.