diff --git a/common.mk b/common.mk index 6d770a83..539f95e1 100644 --- a/common.mk +++ b/common.mk @@ -4,7 +4,6 @@ ROOT := $(dir $(lastword $(MAKEFILE_LIST))) SOURCES := $(wildcard src/*) VERSION := $(shell node -pe "require('./package.json').version") -DOC_DESTINATION := $(subst @fluent, ../html, $(PACKAGE)) export SHELL := /bin/bash ESLINT ?= $(ROOT)node_modules/.bin/eslint @@ -22,10 +21,7 @@ ROLLUP_CMD = $(ROLLUP) $(CURDIR)/esm/index.js \ $(NULL) TYPEDOC_CMD = $(TYPEDOC) src/index.?s \ - --out $(DOC_DESTINATION) \ - --logger none \ - --hideGenerator \ - --includeVersion \ + --options ../typedoc.config.cjs \ $(NULL) MOCHA_CMD = npx c8 $(MOCHA) \ diff --git a/fluent-bundle/package.json b/fluent-bundle/package.json index 7ada6b7d..0ab4e2a1 100644 --- a/fluent-bundle/package.json +++ b/fluent-bundle/package.json @@ -41,6 +41,7 @@ "scripts": { "build": "tsc", "postbuild": "rollup -c ../rollup.config.mjs", + "docs": "typedoc --options ../typedoc.config.cjs", "test": "mocha 'test/*_test.js'" }, "engines": { diff --git a/fluent-dedent/package.json b/fluent-dedent/package.json index f4da14d2..ae2d5249 100644 --- a/fluent-dedent/package.json +++ b/fluent-dedent/package.json @@ -26,6 +26,7 @@ "scripts": { "build": "tsc", "postbuild": "rollup -c ../rollup.config.mjs", + "docs": "typedoc --options ../typedoc.config.cjs", "test": "mocha 'test/*_test.js'" }, "engines": { diff --git a/fluent-dom/package.json b/fluent-dom/package.json index 446bd189..7aaffef2 100644 --- a/fluent-dom/package.json +++ b/fluent-dom/package.json @@ -36,6 +36,7 @@ "scripts": { "build": "tsc", "postbuild": "rollup -c ../rollup.config.mjs --globals cached-iterable:CachedIterable", + "docs": "typedoc --options ../typedoc.config.cjs src/index.js", "test": "c8 mocha -ui tdd --require ./test/index.js 'test/*_test.js'" }, "engines": { diff --git a/fluent-gecko/package.json b/fluent-gecko/package.json index 407c72ad..c4ffd209 100644 --- a/fluent-gecko/package.json +++ b/fluent-gecko/package.json @@ -28,7 +28,8 @@ "l10n" ], "scripts": { - "build": "make build" + "build": "make build", + "docs": "true" }, "devDependencies": { "rollup-plugin-node-resolve": "^4.2.2" diff --git a/fluent-langneg/package.json b/fluent-langneg/package.json index d1a0d1d1..ecf76cd9 100644 --- a/fluent-langneg/package.json +++ b/fluent-langneg/package.json @@ -34,6 +34,7 @@ "scripts": { "build": "tsc", "postbuild": "rollup -c ../rollup.config.mjs", + "docs": "typedoc --options ../typedoc.config.cjs", "test": "mocha 'test/*_test.js'" }, "engines": { diff --git a/fluent-react/package.json b/fluent-react/package.json index 6b76ec32..6b5c119a 100644 --- a/fluent-react/package.json +++ b/fluent-react/package.json @@ -43,6 +43,7 @@ "scripts": { "build": "tsc", "postbuild": "rollup -c ../rollup.config.mjs --globals @fluent/sequence:FluentSequence,cached-iterable:CachedIterable,react:React,prop-types:PropTypes", + "docs": "typedoc --options ../typedoc.config.cjs", "test": "jest --collect-coverage" }, "engines": { diff --git a/fluent-sequence/package.json b/fluent-sequence/package.json index 8d1cd90d..69557e9c 100644 --- a/fluent-sequence/package.json +++ b/fluent-sequence/package.json @@ -29,6 +29,7 @@ "scripts": { "build": "tsc", "postbuild": "rollup -c ../rollup.config.mjs", + "docs": "typedoc --options ../typedoc.config.cjs", "test": "mocha 'test/*_test.js'" }, "engines": { diff --git a/fluent-syntax/package.json b/fluent-syntax/package.json index 0285aa21..c76253af 100644 --- a/fluent-syntax/package.json +++ b/fluent-syntax/package.json @@ -43,6 +43,7 @@ "scripts": { "build": "tsc", "postbuild": "rollup -c ../rollup.config.mjs", + "docs": "typedoc --options ../typedoc.config.cjs", "test": "mocha 'test/*_test.js'" }, "engines": { diff --git a/typedoc.config.cjs b/typedoc.config.cjs new file mode 100644 index 00000000..d0641530 --- /dev/null +++ b/typedoc.config.cjs @@ -0,0 +1,11 @@ +const { resolve } = require("path"); + +const { name } = require(resolve("package.json")); + +module.exports = { + entryPoints: ["src/index.ts"], + hideGenerator: true, + includeVersion: true, + //logger: "none", + out: name.replace("@fluent", "../html"), +};