Skip to content

Commit 880c2e2

Browse files
authored
Add typedocs build step and fix the map.ts type inference issue. (jspm#12)
1 parent 5592c2e commit 880c2e2

File tree

5 files changed

+25
-3
lines changed

5 files changed

+25
-3
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ node_modules
22
package-lock.json
33
lib
44
dist
5-
5+
docs

chompfile.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ default-task = 'build'
33

44
extensions = ['chomp@0.1:swc', 'chomp@0.1:rollup']
55

6+
[[task]]
7+
target = 'docs'
8+
deps = ['src/*.ts']
9+
run = 'typedoc src/*.ts'
10+
611
[[task]]
712
dep = 'src/##.ts'
813
target = 'lib/##.js'

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"devDependencies": {
3434
"@swc/cli": "^0.1.57",
3535
"@swc/core": "^1.2.215",
36-
"rollup": "^2.53.3"
36+
"rollup": "^2.53.3",
37+
"typedoc": "^0.23.24"
3738
}
3839
}

src/map.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class ImportMap implements IImportMap {
3232
* @param opts import map options, can be an optional bag of { map?, mapUrl?, rootUrl? } or just a direct mapUrl
3333
*/
3434
constructor (opts: { map?: IImportMap, mapUrl?: string | URL, rootUrl?: string | URL | null } | string | URL) {
35-
let { map, mapUrl = baseUrl, rootUrl } = opts instanceof URL || typeof opts === 'string' || opts === undefined
35+
let { map, mapUrl = baseUrl, rootUrl } = (opts instanceof URL || typeof opts === 'string' || typeof opts === 'undefined')
3636
? { mapUrl: opts, map: undefined, rootUrl: undefined }
3737
: opts;
3838
if (typeof mapUrl === 'string')

tsconfig.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compilerOptions": {
3+
"typeRoots": ["node_modules/@types"],
4+
"allowSyntheticDefaultImports": true,
5+
"moduleResolution": "node",
6+
"module": "esnext",
7+
"target": "es2019",
8+
"sourceMap": true,
9+
"outDir": "lib",
10+
"declaration": true,
11+
"removeComments": false
12+
},
13+
"include": [
14+
"src/*.ts"
15+
]
16+
}

0 commit comments

Comments
 (0)