Skip to content

Commit 77bc99e

Browse files
chriseppsteinstefanpenner
authored andcommitted
fix: Don't mix generated declaration files with ts source files.
TypeScript seems to get confused when a .d.ts and a .ts file of the same basename are in the same directory. This causes a consuming project to think it needs to compile the *.ts files that are imported from the index.d.ts file. Also did some other maintainance while I was here: * use yarn instead of npm for script execution. * enable sourcemaps so consuming projects will see the right source when navigating code and so debugging sessions can navigate the typescript code. * Update engine support to exlude node 11 now that 12 is released.
1 parent dfc8506 commit 77bc99e

10 files changed

+44
-23
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
node_modules
22
tmp
3+
lib
34
*.js
45
*.d.ts
5-
!types/
6+
!types/

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",
77
"files": [
8-
"lib"
8+
"lib",
9+
"src"
910
],
1011
"scripts": {
11-
"test": "npm run test:js",
12+
"test": "yarn run test:js",
1213
"test:js": "mocha --require ts-node/register tests/*-test.ts",
1314
"test:js:debug": "mocha debug --require ts-node/register tests/*-test.ts",
14-
"build": "tsc",
15-
"prepublish": "tsc"
15+
"build": "tsc --build tsconfig.publish.json",
16+
"prepublish": "tsc --build tsconfig.publish.json"
1617
},
1718
"keywords": [
1819
"broccoli"
1920
],
2021
"author": "Stefan Penner, David J. Hamilton, Chad Hietala",
2122
"license": "MIT",
2223
"dependencies": {
23-
"@types/symlink-or-copy": "^1.2.0",
2424
"heimdalljs-logger": "^0.1.7",
2525
"object-assign": "^4.1.0",
2626
"path-posix": "^1.0.0",
@@ -31,6 +31,7 @@
3131
"@types/fs-extra": "^5.0.4",
3232
"@types/mocha": "^5.2.5",
3333
"@types/node": "^10.12.21",
34+
"@types/symlink-or-copy": "^1.2.0",
3435
"chai": "^3.3.0",
3536
"fs-extra": "^1.0.0",
3637
"mocha": "^2.3.3",
File renamed without changes.
File renamed without changes.

lib/util.ts renamed to src/util.ts

File renamed without changes.

tests/entry-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fs = require('fs-extra');
22
import chai = require('chai');
3-
import Entry from '../lib/entry';
3+
import Entry from '../src/entry';
44

55
const { expect } = chai;
66
const FIXTURE_DIR = 'fixture';

tests/fs-tree-test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import fs = require('fs-extra');
22
import path = require('path');
33
import chai = require('chai');
44
import walkSync = require('walk-sync');
5-
import FSTree = require('../lib/index');
6-
import Entry from '../lib/entry';
5+
import FSTree = require('../src/index');
6+
import Entry from '../src/entry';
77

88
const { expect } = chai;
99
const context = describe;

tests/util-test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import {
44
basename,
55
computeImpliedEntries,
66
sortAndExpand
7-
} from '../lib/util';
8-
import Entry from '../lib/entry';
7+
} from '../src/util';
8+
import Entry from '../src/entry';
99

1010
const { expect } = chai;
1111

tsconfig.publish.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"rootDir": "src",
5+
"outDir": "lib",
6+
"declaration": true,
7+
"declarationMap": true,
8+
"sourceMap": true,
9+
"strict": true,
10+
"moduleResolution": "node",
11+
"module": "commonjs",
12+
"target": "es5",
13+
"paths": {
14+
"*": ["types/*"]
15+
},
16+
"baseUrl": "."
17+
},
18+
"include": ["src"]
19+
}

yarn.lock

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ sigmund@~1.0.0:
250250
resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590"
251251

252252
source-map-support@^0.5.6:
253-
version "0.5.10"
254-
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.10.tgz#2214080bc9d51832511ee2bab96e3c2f9353120c"
255-
integrity sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ==
253+
version "0.5.12"
254+
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599"
255+
integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==
256256
dependencies:
257257
buffer-from "^1.0.0"
258258
source-map "^0.6.0"
@@ -275,9 +275,9 @@ [email protected]:
275275
resolved "https://registry.yarnpkg.com/to-iso-string/-/to-iso-string-0.0.2.tgz#4dc19e664dfccbe25bd8db508b00c6da158255d1"
276276

277277
ts-node@^8.0.2:
278-
version "8.0.2"
279-
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.0.2.tgz#9ecdf8d782a0ca4c80d1d641cbb236af4ac1b756"
280-
integrity sha512-MosTrinKmaAcWgO8tqMjMJB22h+sp3Rd1i4fdoWY4mhBDekOwIAKI/bzmRi7IcbCmjquccYg2gcF6NBkLgr0Tw==
278+
version "8.1.0"
279+
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.1.0.tgz#8c4b37036abd448577db22a061fd7a67d47e658e"
280+
integrity sha512-34jpuOrxDuf+O6iW1JpgTRDFynUZ1iEqtYruBqh35gICNjN8x+LpVcPAcwzLPi9VU6mdA3ym+x233nZmZp445A==
281281
dependencies:
282282
arg "^4.1.0"
283283
diff "^3.1.0"
@@ -294,9 +294,9 @@ type-detect@^1.0.0:
294294
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2"
295295

296296
typescript@^3.3.3:
297-
version "3.3.3"
298-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.3.tgz#f1657fc7daa27e1a8930758ace9ae8da31403221"
299-
integrity sha512-Y21Xqe54TBVp+VDSNbuDYdGw0BpoR/Q6wo/+35M8PAU0vipahnyduJWirxxdxjsAkS7hue53x2zp8gz7F05u0A==
297+
version "3.4.5"
298+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.5.tgz#2d2618d10bb566572b8d7aad5180d84257d70a99"
299+
integrity sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==
300300

301301
walk-sync@^0.3.1:
302302
version "0.3.4"
@@ -306,6 +306,6 @@ walk-sync@^0.3.1:
306306
matcher-collection "^1.0.0"
307307

308308
yn@^3.0.0:
309-
version "3.0.0"
310-
resolved "https://registry.yarnpkg.com/yn/-/yn-3.0.0.tgz#0073c6b56e92aed652fbdfd62431f2d6b9a7a091"
311-
integrity sha512-+Wo/p5VRfxUgBUGy2j/6KX2mj9AYJWOHuhMjMcbBFc3y54o9/4buK1ksBvuiK01C3kby8DH9lSmJdSxw+4G/2Q==
309+
version "3.1.0"
310+
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.0.tgz#fcbe2db63610361afcc5eb9e0ac91e976d046114"
311+
integrity sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==

0 commit comments

Comments
 (0)