Skip to content

Commit

Permalink
chore: Add common config & npm scripts for typedoc
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed Jul 28, 2021
1 parent 3221fcb commit 27c9165
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 6 deletions.
6 changes: 1 addition & 5 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) \
Expand Down
1 change: 1 addition & 0 deletions fluent-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions fluent-dedent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions fluent-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
3 changes: 2 additions & 1 deletion fluent-gecko/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"l10n"
],
"scripts": {
"build": "make build"
"build": "make build",
"docs": "true"
},
"devDependencies": {
"rollup-plugin-node-resolve": "^4.2.2"
Expand Down
1 change: 1 addition & 0 deletions fluent-langneg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions fluent-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions fluent-sequence/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions fluent-syntax/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
11 changes: 11 additions & 0 deletions typedoc.config.cjs
Original file line number Diff line number Diff line change
@@ -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"),
};

0 comments on commit 27c9165

Please sign in to comment.