Skip to content

Commit

Permalink
Update dependencies (#202)
Browse files Browse the repository at this point in the history
Update npm dependencies and the GitHub Actions / Travis CI flow. Add a few type annotations to get things working with the newest TypeScript.
  • Loading branch information
nebrelbug authored Dec 18, 2022
1 parent 2eb2d9f commit 749b197
Show file tree
Hide file tree
Showing 17 changed files with 28,310 additions and 11,385 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
- uses: denolib/setup-deno@v2
with:
deno-version: v1.x
- uses: andresz1/size-limit-action@v1.4.0
- uses: andresz1/size-limit-action@v1.7.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
language: node_js
cache:
yarn: true
directories:
- ~/.npm
- '$HOME/.deno'
notifications:
email: false
node_js:
- '10'
- '12'
- '14'
- '16'
before_install: # Install Deno
- curl -fsSL https://deno.land/x/install/install.sh | sh
- export PATH="$HOME/.deno/bin:$PATH"
script:
- deno --version # Log the Deno version
- yarn build && yarn test:prod
- npm run build && npm run test:prod
after_success:
- yarn travis-deploy-once "yarn report-coverage"
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then yarn travis-deploy-once "yarn deploy-docs"; fi
- npm run travis-deploy-once "npm run report-coverage"
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then npm run travis-deploy-once "npm run deploy-docs"; fi
branches:
except:
- /^v\d+\.\d+\.\d+$/
187 changes: 66 additions & 121 deletions deno_dist/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deno_dist/err.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function setPrototypeOf(obj: any, proto: any) {
export default function EtaErr(message: string): Error {
const err = new Error(message);
setPrototypeOf(err, EtaErr.prototype);
return err;
return err as Error;
}

EtaErr.prototype = Object.create(Error.prototype, {
Expand Down
6 changes: 4 additions & 2 deletions deno_dist/file-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export function loadFile(
}
return compiledTemplate;
} catch (e) {
throw EtaErr("Loading file: " + filePath + " failed:\n\n" + e.message);
throw EtaErr(
"Loading file: " + filePath + " failed:\n\n" + (e as Error).message,
);
}
}

Expand Down Expand Up @@ -110,7 +112,7 @@ function tryHandleCache(
const templateFn = handleCache(options);
templateFn(data, options, cb);
} catch (err) {
return cb(err);
return cb(err as Error);
}
} else {
// No callback, try returning a promise
Expand Down
3 changes: 1 addition & 2 deletions deno_dist/file-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ function getPath(path: string, options: EtaConfig): string {

function readFile(filePath: string): string {
try {
return readFileSync(filePath).toString().replace(_BOM, "") // TODO: is replacing BOM's necessary?
;
return readFileSync(filePath).toString().replace(_BOM, ""); // TODO: is replacing BOM's necessary?
} catch {
throw EtaErr("Failed to read template at '" + filePath + "'");
}
Expand Down
3 changes: 1 addition & 2 deletions deno_dist/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ const doubleQuoteReg = /"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;

function escapeRegExp(string: string) {
// From MDN
return string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&") // $& means the whole matched string
;
return string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
}

export default function parse(
Expand Down
2 changes: 1 addition & 1 deletion deno_dist/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default function render(
const templateFn = handleCache(template, options);
templateFn(data, options, cb);
} catch (err) {
return cb(err);
return cb(err as Error);
}
} else {
// No callback, try returning a promise
Expand Down
3 changes: 1 addition & 2 deletions deno_dist/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ function trimWS(
str = trimRight(str);
} else if (rightTrim === "-" || rightTrim === "nl") {
// nl trim
str = str.replace(/(?:\r\n|\n|\r)$/, "") // TODO: make sure this gets \r\n
;
str = str.replace(/(?:\r\n|\n|\r)$/, ""); // TODO: make sure this gets \r\n
}

return str;
Expand Down
Loading

0 comments on commit 749b197

Please sign in to comment.