Skip to content

Commit 996b521

Browse files
author
jim
committed
fixed config + newline
1 parent f0a7195 commit 996b521

File tree

4 files changed

+45
-51
lines changed

4 files changed

+45
-51
lines changed

Diff for: README.md

+6-10
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,17 @@
1111
The default configuration exports all sibling `.ts` files and folders with a `index.ts` file.
1212

1313
```json
14-
"export-typescript": {
15-
"exportStar": true,
16-
"includes": ["*.{ts,tsx}", "*/index.{ts,tsx}"],
17-
"excludes": ["*.{spec.ts,spec.tsx}"]
18-
}
14+
"export-typescript.excludes":["*.{spec.ts,spec.tsx}"],
15+
"export-typescript.includes":["*.{ts,tsx}", "*/index.{ts,tsx}"],
16+
"export-typescript.exportStar": true
1917
```
2018

2119
In order to export declarations and look for files in subdirectories recursively, put the following in your `.vscode/settings.json`:
2220

2321
```json
24-
"export-typescript": {
25-
"exportStar": false,
26-
"includes": ["**/*.{ts,tsx}"],
27-
"excludes": ["**/*.{spec.ts,spec.tsx}"]
28-
}
22+
"export-typescript.excludes":["**/*.{spec.ts,spec.tsx}"],
23+
"export-typescript.includes":["**/*.{ts,tsx}"],
24+
"export-typescript.exportStar": false
2925
```
3026

3127
## Changelog

Diff for: export-typescript-0.3.1.vsix

1.61 MB
Binary file not shown.

Diff for: package.json

+35-35
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"out",
88
"images"
99
],
10-
"publisher": "mscolnick",
10+
"publisher": "dev-mscolnick",
1111
"engines": {
1212
"vscode": "^1.14.0"
1313
},
@@ -38,7 +38,40 @@
3838
"command": "export-typescript.replace-exports",
3939
"title": "Export Typescript: Write exports"
4040
}
41-
]
41+
],
42+
"configuration": {
43+
"type": "object",
44+
"title": "Configuration",
45+
"properties": {
46+
"export-typescript.exportStar": {
47+
"type": "boolean",
48+
"default": true,
49+
"description": "If true, 'export { * } ...' else 'export { Class } ...'"
50+
},
51+
"export-typescript.includes": {
52+
"type": [
53+
"string",
54+
"array"
55+
],
56+
"items": {
57+
"type": "string"
58+
},
59+
"description": "Files to include in the export search, e.g. '*.{ts,tsx}'",
60+
"default": ["*.{ts,tsx}', '*/index.{ts,tsx}"]
61+
},
62+
"export-typescript.excludes": {
63+
"type": [
64+
"string",
65+
"array"
66+
],
67+
"items": {
68+
"type": "string"
69+
},
70+
"description": "Files to exclude in the export search, e.g. '*.{spec.ts,spec.tsx}'",
71+
"default": ["*.{spec.ts,spec.tsx}"]
72+
}
73+
}
74+
}
4275
},
4376
"scripts": {
4477
"vscode:prepublish": "npm run build",
@@ -67,38 +100,5 @@
67100
"dependencies": {
68101
"globby": "^11.0.1",
69102
"typescript-parser": "^2.6.1"
70-
},
71-
"configuration": {
72-
"type": "object",
73-
"title": "Configuration",
74-
"properties": {
75-
"export-typescript.exportStar": {
76-
"type": "boolean",
77-
"default": true,
78-
"description": "If true, 'export { * } ...' else 'export { Class } ...'"
79-
},
80-
"export-typescript.includes": {
81-
"type": [
82-
"string",
83-
"array"
84-
],
85-
"items": {
86-
"type": "string"
87-
},
88-
"description": "Files to include in the export search, e.g. '*.{ts,tsx}'",
89-
"default": "['*.{ts,tsx}', '*/index.{ts,tsx}']"
90-
},
91-
"export-typescript.excludes": {
92-
"type": [
93-
"string",
94-
"array"
95-
],
96-
"items": {
97-
"type": "string"
98-
},
99-
"description": "Files to exclude in the export search, e.g. '*.{spec.ts,spec.tsx}'",
100-
"default": "['*.{spec.ts,spec.tsx}']"
101-
}
102-
}
103103
}
104104
}

Diff for: src/replace-exports.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import * as globby from "globby";
2-
import { dirname } from "path";
2+
33
import { Declaration, ExportableDeclaration, TypescriptParser } from "typescript-parser";
44
import { Range, TextEditor } from "vscode";
5+
56
import { ExtensionConfig } from "./config";
7+
import { dirname } from "path";
68

79
export async function replaceExports(
810
editor: TextEditor,
@@ -43,11 +45,7 @@ async function getExportStatements(docFilename: string, config: ExtensionConfig,
4345
}
4446
}
4547

46-
return [
47-
...directoryImports,
48-
...fileImports,
49-
"", // Add a new line at the end
50-
];
48+
return [...directoryImports, ...fileImports];
5149
}
5250
function getRelFilename(absPath: string, rootPath: string) {
5351
return absPath.slice(rootPath.length + 1);

0 commit comments

Comments
 (0)