diff --git a/docs/setup/file-system.md b/docs/setup/file-system.md index eba9b5fcf..61bf30b5e 100644 --- a/docs/setup/file-system.md +++ b/docs/setup/file-system.md @@ -53,7 +53,7 @@ console.log(mySetDecl.getType().getText()); // any This is because, the `lib` compiler option must be specified, similar to when you use `tsc`: -```ts +```ts setup: let mySetDecl: Node; const project = new Project({ useInMemoryFileSystem: true, compilerOptions: { @@ -66,7 +66,7 @@ console.log(mySetDecl.getType().getText()); // Set, good Or you may specify a target that will implicitly load in the lib files that you need: -```ts +```ts setup: let mySetDecl: Node; import { Project, ts } from "ts-morph"; const project = new Project({ diff --git a/packages/bootstrap/package.json b/packages/bootstrap/package.json index e43fa869d..73b1c144d 100644 --- a/packages/bootstrap/package.json +++ b/packages/bootstrap/package.json @@ -1,6 +1,6 @@ { "name": "@ts-morph/bootstrap", - "version": "0.9.0", + "version": "0.9.1", "description": "API for getting quickly set up with the TypeScript Compiler API.", "keywords": ["typescript", "compiler", "bootstrap"], "main": "dist/ts-morph-bootstrap.js", @@ -20,7 +20,7 @@ "rollup": "rollup -c" }, "dependencies": { - "@ts-morph/common": "~0.8.1" + "@ts-morph/common": "~0.9.0" }, "devDependencies": { "@types/chai": "^4.2.14", diff --git a/packages/common/package.json b/packages/common/package.json index 58924fdab..6838b3451 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@ts-morph/common", - "version": "0.8.1", + "version": "0.9.0", "description": "Common functionality for ts-morph packages.", "main": "dist/ts-morph-common.js", "author": "David Sherret", diff --git a/packages/common/src/runtimes/NodeRuntime.ts b/packages/common/src/runtimes/NodeRuntime.ts index 06d8cff62..8976a0c21 100644 --- a/packages/common/src/runtimes/NodeRuntime.ts +++ b/packages/common/src/runtimes/NodeRuntime.ts @@ -2,16 +2,17 @@ import { Runtime, RuntimeFileSystem, RuntimePath } from "./Runtime"; export class NodeRuntime implements Runtime { private readonly minimatch: typeof import("minimatch") = require("minimatch"); + private readonly os: typeof import("os") = require("os"); fs = new NodeRuntimeFileSystem(); path = new NodeRuntimePath(); getEnvVar(name: string) { - return process.env[name]; + return process?.env[name]; } getEndOfLine() { - return require("os").EOL; + return this.os.EOL; } getPathMatchesPattern(path: string, pattern: string) { @@ -192,7 +193,7 @@ class NodeRuntimeFileSystem implements RuntimeFileSystem { } isCaseSensitive() { - const platform = process.platform; + const platform = process?.platform; return platform !== "win32" && platform !== "darwin"; } } diff --git a/packages/ts-morph/CHANGELOG.md b/packages/ts-morph/CHANGELOG.md index 4b8001b64..e05199b17 100644 --- a/packages/ts-morph/CHANGELOG.md +++ b/packages/ts-morph/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [10.0.2](https://github.com/dsherret/ts-morph/compare/10.0.1...10.0.2) (2021-03-22) + +* Reduce dependencies. + + + ## [10.0.1](https://github.com/dsherret/ts-morph/compare/10.0.0...10.0.1) (2021-02-24) diff --git a/packages/ts-morph/package.json b/packages/ts-morph/package.json index 563024c47..aed4f268d 100644 --- a/packages/ts-morph/package.json +++ b/packages/ts-morph/package.json @@ -1,6 +1,6 @@ { "name": "ts-morph", - "version": "10.0.1", + "version": "10.0.2", "description": "TypeScript compiler wrapper for static analysis and code manipulation.", "main": "dist/ts-morph.js", "typings": "lib/ts-morph.d.ts", @@ -64,7 +64,7 @@ "all": true }, "dependencies": { - "@ts-morph/common": "~0.8.1", + "@ts-morph/common": "~0.9.0", "code-block-writer": "^10.1.1" }, "devDependencies": {