Skip to content

Commit

Permalink
feat: add support for TypeScript v3.8. Add support for passing a spec…
Browse files Browse the repository at this point in the history
…ific TypeScript version to the evaluate function. Remove dependency on deasync. Return a Promise when evaluating an await-expression. Disallow evaluating async iterators with the synchronous variant of evaluate
  • Loading branch information
wessberg committed Feb 29, 2020
1 parent 3a0ba78 commit c19e1cc
Show file tree
Hide file tree
Showing 160 changed files with 8,086 additions and 1,376 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,8 @@
{
"env": {
"es2020": true,
"shared-node-browser": true,
"node": true
},
"extends": "./node_modules/@wessberg/ts-config/.eslintrc.json"
}
11 changes: 11 additions & 0 deletions README.md
Expand Up @@ -203,6 +203,17 @@ Here's an explainer of the individual policies:

- `process` _(default: `{exit: false, spawnChild: false}`)_ - If `process` permits `exit` operations, the evaluated code is permitted to exit the parent process. If `process` permits `spawnChild` operations, the evaluated code is permitted to spawn child processes.

### Custom TypeScript version

You can provide a specific version of TypeScript to use as an option to `evaluate`. This may come in handy if you're using
multiple TypeScript versions in your project or if you're receiving the TypeScript version to use as an argument from a third party.

```typescript
const result = evaluate({
// ...
typescript: someTypescriptModule
});

### Logging

You can get information about the evaluation process with various levels of logging. By default, nothing is logged, but you can override this behavior:
Expand Down
78 changes: 46 additions & 32 deletions package.json
Expand Up @@ -5,17 +5,19 @@
"scripts": {
"generate:scaffold": "scaffold all --yes",
"generate:changelog": "standard-changelog --first-release",
"generate:all": "npm run generate:scaffold && npm run generate:changelog",
"clean": "rm -rf dist",
"lint": "tsc --noEmit && tslint -c tslint.json --project tsconfig.json",
"generate:all": "pnpm run generate:scaffold && pnpm run generate:changelog",
"clean": "rimraf dist",
"lint": "tsc --noEmit && eslint \"src/**/*.ts\" --color",
"prettier": "prettier --write '{src,test,documentation}/**/*.{js,ts,json,html,xml,css,md}'",
"test": "ava",
"prebuild": "npm run clean",
"build": "npm run rollup",
"prebuild": "pnpm run clean",
"build": "pnpm run rollup",
"watch": "pnpm run rollup -- --watch",
"rollup": "rollup -c rollup.config.js",
"preversion": "npm run lint && NODE_ENV=production npm run build",
"version": "npm run generate:all && git add .",
"release": "np --no-cleanup --no-yarn"
"preversion": "npm run lint && NODE_ENV=production pnpm run build",
"version": "pnpm run generate:all && git add .",
"release": "np --no-cleanup --no-yarn",
"update": "npx npm-check-updates -u && pnpm update && pnpm install"
},
"keywords": [
"typescript",
Expand All @@ -41,43 +43,51 @@
],
"license": "MIT",
"devDependencies": {
"@wessberg/scaffold": "1.0.19",
"@wessberg/rollup-plugin-ts": "1.1.74",
"@wessberg/ts-config": "0.0.42",
"standard-changelog": "2.0.15",
"tslint": "5.20.1",
"ava": "2.4.0",
"@typescript-eslint/eslint-plugin": "^2.21.0",
"@typescript-eslint/parser": "^2.21.0",
"@wessberg/rollup-plugin-ts": "^1.2.18",
"@wessberg/scaffold": "^1.0.25",
"@wessberg/ts-config": "^1.0.8",
"ava": "^3.4.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsdoc": "^21.0.0",
"find-up": "^4.1.0",
"husky": "^4.2.3",
"np": "^6.2.0",
"pnpm": "^4.10.0",
"prettier": "^1.19.1",
"pretty-quick": "^2.0.1",
"husky": "^3.0.9",
"np": "^5.1.3",
"find-up": "^4.1.0",
"ts-node": "^8.4.1",
"rollup": "^1.26.4",
"typescript": "3.7.2"
"rollup": "^1.32.0",
"standard-changelog": "^2.0.21",
"ts-node": "^8.6.2",
"typescript": "^3.8.3"
},
"dependencies": {
"@types/deasync": "0.1.0",
"@types/node": "12.12.7",
"@types/object-path": "0.11.0",
"chalk": "3.0.0",
"object-path": "0.11.4",
"tslib": "1.10.0"
"@types/node": "^13.7.7",
"@types/object-path": "^0.11.0",
"chalk": "^3.0.0",
"object-path": "^0.11.4",
"tslib": "^1.11.1"
},
"peerDependencies": {
"typescript": "^3.x"
},
"optionalDependencies": {
"@types/jsdom": "12.2.4",
"jsdom": "15.2.1",
"deasync": "0.1.15"
"@types/jsdom": "^16.1.0",
"jsdom": "^16.2.0"
},
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"browser": "./dist/esm/index.js",
"types": "./dist/esm/index.d.ts",
"typings": "./dist/esm/index.d.ts",
"es2015": "./dist/esm/index.js",
"funding": {
"type": "github",
"url": "https://github.com/wessberg/ts-evaluator?sponsor=1"
},
"repository": {
"type": "git",
"url": "https://github.com/wessberg/ts-evaluator.git"
Expand All @@ -90,14 +100,18 @@
},
"ava": {
"files": [
"test/**/*.test.ts"
"test/**/**.test.ts"
],
"compileEnhancements": false,
"verbose": true,
"timeout": "40s",
"extensions": [
"ts"
],
"environmentVariables": {
"NODE_OPTIONS": "--max_old_space_size=4096"
},
"require": [
"ts-node/register"
"ts-node/register/transpile-only"
]
}
}

0 comments on commit c19e1cc

Please sign in to comment.