Skip to content

Commit

Permalink
- fix for invisible declaration files, #95
Browse files Browse the repository at this point in the history
  • Loading branch information
ezolenko committed Jul 5, 2018
1 parent 707c6fc commit c86e07b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,11 @@ The way typescript handles type-only imports and ambient types effectively hides

Otherwise the plugin should work in watch mode. Make sure to run a normal build after watch session to catch any type errors.

### Version
### Requirements

This plugin currently requires TypeScript `2.4+`.

### Rollup version

This plugin currently requires rollup `0.50+`.
TypeScript `2.4+`
Rollup `0.50+`
Node `6.4.0+` (basic es6 support)

### Reporting bugs

Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rollup-plugin-typescript2",
"version": "0.15.2",
"version": "0.16.0",
"description": "Seamless integration between Rollup and TypeScript. Now with errors.",
"main": "dist/rollup-plugin-typescript2.cjs.js",
"module": "dist/rollup-plugin-typescript2.es.js",
Expand Down Expand Up @@ -40,7 +40,7 @@
"typescript": ">=2.4.0"
},
"devDependencies": {
"typescript": "^2.9.1",
"typescript": "^2.9.2",
"object-hash": "^1.3.0",
"colors": "^1.2.4",
"graphlib": "^2.1.5",
Expand All @@ -53,7 +53,7 @@
"@types/object-hash": "^1.2.0",
"@types/resolve": "^0.0.8",
"rimraf": "^2.6.2",
"rollup": "^0.59.4",
"rollup": "^0.62.0",
"rollup-plugin-typescript2": "github:ezolenko/rollup-plugin-typescript2#master",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-commonjs": "^9.1.3",
Expand Down
5 changes: 4 additions & 1 deletion src/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ export class LanguageServiceHost implements tsTypes.LanguageServiceHost
private snapshots: { [fileName: string]: tsTypes.IScriptSnapshot } = {};
private versions: { [fileName: string]: number } = {};
private service?: tsTypes.LanguageService;
private fileNames: Set<string>;

constructor(private parsedConfig: tsTypes.ParsedCommandLine, private transformers: TransformerFactoryCreator[])
{
this.fileNames = new Set(parsedConfig.fileNames);
}

public reset()
Expand All @@ -34,6 +36,7 @@ export class LanguageServiceHost implements tsTypes.LanguageServiceHost
const snapshot = tsModule.ScriptSnapshot.fromString(data);
this.snapshots[fileName] = snapshot;
this.versions[fileName] = (this.versions[fileName] || 0) + 1;
this.fileNames.add(fileName);
return snapshot;
}

Expand Down Expand Up @@ -68,7 +71,7 @@ export class LanguageServiceHost implements tsTypes.LanguageServiceHost

public getScriptFileNames()
{
return Object.keys(this.snapshots);
return Array.from(this.fileNames.values());
}

public getCompilationSettings(): tsTypes.CompilerOptions
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es6",
"noImplicitAny": true,
"sourceMap": true,
"noUnusedParameters": true,
Expand Down

0 comments on commit c86e07b

Please sign in to comment.