From 94a68e1fe24fe357b48f008e6a51f2b3ae578f25 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 16 Aug 2017 09:46:38 +0200 Subject: [PATCH 1/5] chore(package): update semantic-release to version 7.0.1 (#15) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 591c656..66b3459 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "del-cli": "^1.1.0", "jest": "^20.0.4", "mock-fs": "^4.4.1", - "semantic-release": "^6.3.6", + "semantic-release": "^7.0.1", "ts-jest": "^20.0.7", "tslint": "^5.5.0", "tslint-config-airbnb": "^5.2.1", From c3b3cbef642b27f43d5f0d9604f136733ae2b60d Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Fri, 8 Sep 2017 10:13:25 +0200 Subject: [PATCH 2/5] chore(package): update ts-jest to version 21.0.0 (#18) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 66b3459..4737fde 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "jest": "^20.0.4", "mock-fs": "^4.4.1", "semantic-release": "^7.0.1", - "ts-jest": "^20.0.7", + "ts-jest": "^21.0.0", "tslint": "^5.5.0", "tslint-config-airbnb": "^5.2.1", "tsutils": "^2.7.1", From 32470ff86b9afc536baf9da98024fe52daa5b64f Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Fri, 8 Sep 2017 10:19:40 +0200 Subject: [PATCH 3/5] chore(package): update jest to version 21.0.0 (#17) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4737fde..2b7baf9 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@types/mock-fs": "^3.6.30", "@types/node": "^8.0.13", "del-cli": "^1.1.0", - "jest": "^20.0.4", + "jest": "^21.0.0", "mock-fs": "^4.4.1", "semantic-release": "^7.0.1", "ts-jest": "^21.0.0", From 5c9437a4db1f2e44d30815d1409e43e30f767a02 Mon Sep 17 00:00:00 2001 From: Sven Flickinger Date: Sat, 16 Sep 2017 13:14:03 +0200 Subject: [PATCH 4/5] fix(index): Imports for non-barrel files ending with index (#19) --- src/DeclarationIndex.ts | 2 +- test/_workspace/declaration-index/_index.ts | 1 + test/_workspace/declaration-index/index.ts | 1 + .../DeclarationIndex.spec.ts | 16 +++++++-- .../DeclarationIndex.spec.ts.snap | 34 +++++++++++++++++++ 5 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 test/_workspace/declaration-index/_index.ts create mode 100644 test/_workspace/declaration-index/index.ts diff --git a/src/DeclarationIndex.ts b/src/DeclarationIndex.ts index ca16a03..9a94afa 100644 --- a/src/DeclarationIndex.ts +++ b/src/DeclarationIndex.ts @@ -383,7 +383,7 @@ export class DeclarationIndex { if (!index[declaration.name]) { index[declaration.name] = []; } - const from = key.replace(/[/]?index$/, '') || '/'; + const from = key.replace(/\/index$/, '') || '/'; if (!index[declaration.name].some( o => o.declaration.constructor === declaration.constructor && o.from === from, )) { diff --git a/test/_workspace/declaration-index/_index.ts b/test/_workspace/declaration-index/_index.ts new file mode 100644 index 0000000..c5eec96 --- /dev/null +++ b/test/_workspace/declaration-index/_index.ts @@ -0,0 +1 @@ +export let _index; diff --git a/test/_workspace/declaration-index/index.ts b/test/_workspace/declaration-index/index.ts new file mode 100644 index 0000000..4d8b863 --- /dev/null +++ b/test/_workspace/declaration-index/index.ts @@ -0,0 +1 @@ +export let barrelExport; diff --git a/test/declaration-index/DeclarationIndex.spec.ts b/test/declaration-index/DeclarationIndex.spec.ts index 069665e..eafa7dc 100644 --- a/test/declaration-index/DeclarationIndex.spec.ts +++ b/test/declaration-index/DeclarationIndex.spec.ts @@ -40,6 +40,8 @@ describe('DeclarationIndex', () => { join(rootPath, 'helper-functions.ts'), join(rootPath, 'myReactTemplate.tsx'), join(rootPath, 'prototype-funcs.ts'), + join(rootPath, 'index.ts'), + join(rootPath, '_index.ts'), ]; beforeEach(async () => { @@ -84,6 +86,14 @@ describe('DeclarationIndex', () => { expect(resource).toMatchSnapshot(); }); + it('should properly index non-barrel files ending in `index`', () => { + const barrelExport = declarationIndex.index!['barrelExport']; + expect(barrelExport).toMatchSnapshot(); + + const _index = declarationIndex.index!['_index']; + expect(_index).toMatchSnapshot(); + }); + }); describe('reindexForChanges()', () => { @@ -183,7 +193,7 @@ describe('DeclarationIndex', () => { export class FancierLibraryClass { public doSomethingAwesome(): void { } } - + export * from './foobar'`, }); @@ -265,7 +275,7 @@ describe('DeclarationIndex', () => { export class FancierLibraryClass { public doSomethingAwesome(): void { } } - + export * from './foobar'`, }); @@ -290,7 +300,7 @@ describe('DeclarationIndex', () => { export class FancierLibraryClass { public doSomethingAwesome(): void { } } - + export * from './foobar'`, }); diff --git a/test/declaration-index/__snapshots__/DeclarationIndex.spec.ts.snap b/test/declaration-index/__snapshots__/DeclarationIndex.spec.ts.snap index a2c99fe..d3ba399 100644 --- a/test/declaration-index/__snapshots__/DeclarationIndex.spec.ts.snap +++ b/test/declaration-index/__snapshots__/DeclarationIndex.spec.ts.snap @@ -66,6 +66,8 @@ Array [ "/helper-functions", "/myReactTemplate", "/prototype-funcs", + "/index", + "/_index", ] `; @@ -127,6 +129,38 @@ Array [ ] `; +exports[`DeclarationIndex buildIndex() should properly index non-barrel files ending in \`index\` 1`] = ` +Array [ + DeclarationInfo { + "declaration": VariableDeclaration { + "end": 24, + "isConst": false, + "isExported": true, + "name": "barrelExport", + "start": 0, + "type": undefined, + }, + "from": "/", + }, +] +`; + +exports[`DeclarationIndex buildIndex() should properly index non-barrel files ending in \`index\` 2`] = ` +Array [ + DeclarationInfo { + "declaration": VariableDeclaration { + "end": 18, + "isConst": false, + "isExported": true, + "name": "_index", + "start": 0, + "type": undefined, + }, + "from": "/_index", + }, +] +`; + exports[`DeclarationIndex calculateIndexDelta() should calculate a newly added declaration 1`] = ` Object { "added": Object { From d804b1efb9b5a5c165bab0c68f5c9c648a4796c3 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sun, 17 Sep 2017 19:18:02 +0200 Subject: [PATCH 5/5] chore(package): update semantic-release to version 8.0.0 (#20) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2b7baf9..537312b 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "del-cli": "^1.1.0", "jest": "^21.0.0", "mock-fs": "^4.4.1", - "semantic-release": "^7.0.1", + "semantic-release": "^8.0.0", "ts-jest": "^21.0.0", "tslint": "^5.5.0", "tslint-config-airbnb": "^5.2.1",