Skip to content

Commit ef74270

Browse files
committed
Drop source folder
1 parent 757d4c2 commit ef74270

File tree

9 files changed

+10
-7
lines changed

9 files changed

+10
-7
lines changed

collector.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// This needs to be in a separate file so it can bee tree-shaken before being published, while still being importable by tests
2+
export default new Map<string, string[] | 'combinedTestOnly'>();
File renamed without changes.
File renamed without changes.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
],
3636
"rules": {
3737
"camelcase": "off",
38+
"unicorn/import-index": "off",
39+
"import/no-useless-path-segments": "off",
3840
"@typescript-eslint/prefer-readonly-parameter-types": "off",
3941
"comma-dangle": [
4042
"error",

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if (pageDetect.isDiscussionList()) {
4040

4141
## API
4242

43-
In the source you can see the [full list of detections](https://www.unpkg.com/browse/github-url-detection@latest/esm/index.d.ts) and [their matching URLs.](https://github.com/fregante/github-url-detection/blob/master/source/index.ts)
43+
In the source you can see the [full list of detections](https://www.unpkg.com/browse/github-url-detection@latest/esm/index.d.ts) and [their matching URLs.](https://github.com/fregante/github-url-detection/blob/master/index.ts)
4444

4545
Most detections are URL-based while others need access to the current `document`. You can determine which ones are URL-based by looking at their signature: URL-based functions have a `url` parameter.
4646

rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {terser} from 'rollup-plugin-terser';
33
import json from '@rollup/plugin-json';
44

55
export default ['cjs', 'esm'].map(format => ({
6-
input: 'source/index.ts',
6+
input: 'index.ts',
77
output: {
88
format,
99
dir: format,

source/collector.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import test from 'ava';
22
import {JSDOM} from 'jsdom';
33
import stripIndent from 'strip-indent';
4-
import * as pageDetect from './source';
5-
import collector from './source/collector';
4+
import * as pageDetect from './index'; // `index` ensures that it loads the source, not what's specified in `package.json`
5+
import collector from './collector';
66

77
const {window} = new JSDOM('…');
88

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"extends": "@sindresorhus/tsconfig",
33
"compilerOptions": {
44
"outDir": "cjs",
5-
"rootDir": "source"
5+
"rootDir": "."
66
},
77
"include": [
8-
"source"
8+
"source", "index.ts", "globals.d.ts", "collector.ts"
99
]
1010
}

0 commit comments

Comments
 (0)