Browse Source

generate unified monorepo api docs using typedoc library mode

- see TypeStrong/typedoc#1184
telamonian 5 years ago
parent
commit
ecd1b5fa47
4 changed files with 442 additions and 4 deletions
  1. 3 1
      package.json
  2. 254 0
      tsconfigdoc.json
  3. 130 0
      typedoc.js
  4. 55 3
      yarn.lock

+ 3 - 1
package.json

@@ -50,7 +50,7 @@
     "create:test": "node buildutils/lib/create-test-package.js",
     "create:theme": "node buildutils/lib/create-theme.js",
     "deduplicate": "jlpm yarn-deduplicate -s fewer --fail",
-    "docs": "lerna run docs",
+    "docs": "typedoc --options typedoc.js packages/*/src/index.ts* packages/*/src/*.d.ts",
     "docs:init": "lerna run docs:init",
     "eslint": "eslint --ext .js,.jsx,.ts,.tsx --fix .",
     "eslint:check": "eslint --ext .js,.jsx,.ts,.tsx .",
@@ -100,7 +100,9 @@
     "lerna": "^3.19.0",
     "lint-staged": "^9.5.0",
     "prettier": "^1.19.1",
+    "react-docgen-typescript-loader": "^3.7.2",
     "shell-quote": "^1.7.2",
+    "typedoc": "next",
     "yarn": "1.21.1"
   }
 }

+ 254 - 0
tsconfigdoc.json

@@ -0,0 +1,254 @@
+{
+  "$schema": "http://json.schemastore.org/tsconfig",
+  "extends": "./tsconfigbase",
+  "compilerOptions": {
+    "composite": false,
+    "baseUrl": ".",
+    "paths": { "@jupyterlab/*": ["packages/*/src"] }
+  },
+  "references": [
+    {
+      "path": "./packages/application"
+    },
+    {
+      "path": "./packages/application-extension"
+    },
+    {
+      "path": "./packages/apputils"
+    },
+    {
+      "path": "./packages/apputils-extension"
+    },
+    {
+      "path": "./packages/attachments"
+    },
+    {
+      "path": "./packages/cells"
+    },
+    {
+      "path": "./packages/celltags"
+    },
+    {
+      "path": "./packages/celltags-extension"
+    },
+    {
+      "path": "./packages/codeeditor"
+    },
+    {
+      "path": "./packages/codemirror"
+    },
+    {
+      "path": "./packages/codemirror-extension"
+    },
+    {
+      "path": "./packages/completer"
+    },
+    {
+      "path": "./packages/completer-extension"
+    },
+    {
+      "path": "./packages/console"
+    },
+    {
+      "path": "./packages/console-extension"
+    },
+    {
+      "path": "./packages/coreutils"
+    },
+    {
+      "path": "./packages/csvviewer"
+    },
+    {
+      "path": "./packages/csvviewer-extension"
+    },
+    {
+      "path": "./packages/docmanager"
+    },
+    {
+      "path": "./packages/docmanager-extension"
+    },
+    {
+      "path": "./packages/docregistry"
+    },
+    {
+      "path": "./packages/documentsearch"
+    },
+    {
+      "path": "./packages/documentsearch-extension"
+    },
+    {
+      "path": "./packages/extensionmanager"
+    },
+    {
+      "path": "./packages/extensionmanager-extension"
+    },
+    {
+      "path": "./packages/filebrowser"
+    },
+    {
+      "path": "./packages/filebrowser-extension"
+    },
+    {
+      "path": "./packages/fileeditor"
+    },
+    {
+      "path": "./packages/fileeditor-extension"
+    },
+    {
+      "path": "./packages/help-extension"
+    },
+    {
+      "path": "./packages/htmlviewer"
+    },
+    {
+      "path": "./packages/htmlviewer-extension"
+    },
+    {
+      "path": "./packages/hub-extension"
+    },
+    {
+      "path": "./packages/imageviewer"
+    },
+    {
+      "path": "./packages/imageviewer-extension"
+    },
+    {
+      "path": "./packages/inspector"
+    },
+    {
+      "path": "./packages/inspector-extension"
+    },
+    {
+      "path": "./packages/javascript-extension"
+    },
+    {
+      "path": "./packages/json-extension"
+    },
+    {
+      "path": "./packages/launcher"
+    },
+    {
+      "path": "./packages/launcher-extension"
+    },
+    {
+      "path": "./packages/logconsole"
+    },
+    {
+      "path": "./packages/logconsole-extension"
+    },
+    {
+      "path": "./packages/mainmenu"
+    },
+    {
+      "path": "./packages/mainmenu-extension"
+    },
+    {
+      "path": "./packages/markdownviewer"
+    },
+    {
+      "path": "./packages/markdownviewer-extension"
+    },
+    {
+      "path": "./packages/mathjax2"
+    },
+    {
+      "path": "./packages/mathjax2-extension"
+    },
+    {
+      "path": "./packages/nbformat"
+    },
+    {
+      "path": "./packages/notebook"
+    },
+    {
+      "path": "./packages/notebook-extension"
+    },
+    {
+      "path": "./packages/observables"
+    },
+    {
+      "path": "./packages/outputarea"
+    },
+    {
+      "path": "./packages/pdf-extension"
+    },
+    {
+      "path": "./packages/property-inspector"
+    },
+    {
+      "path": "./packages/rendermime"
+    },
+    {
+      "path": "./packages/rendermime-extension"
+    },
+    {
+      "path": "./packages/rendermime-interfaces"
+    },
+    {
+      "path": "./packages/running"
+    },
+    {
+      "path": "./packages/running-extension"
+    },
+    {
+      "path": "./packages/services"
+    },
+    {
+      "path": "./packages/settingeditor"
+    },
+    {
+      "path": "./packages/settingeditor-extension"
+    },
+    {
+      "path": "./packages/settingregistry"
+    },
+    {
+      "path": "./packages/shortcuts-extension"
+    },
+    {
+      "path": "./packages/statedb"
+    },
+    {
+      "path": "./packages/statusbar"
+    },
+    {
+      "path": "./packages/statusbar-extension"
+    },
+    {
+      "path": "./packages/tabmanager-extension"
+    },
+    {
+      "path": "./packages/terminal"
+    },
+    {
+      "path": "./packages/terminal-extension"
+    },
+    {
+      "path": "./packages/theme-dark-extension"
+    },
+    {
+      "path": "./packages/theme-light-extension"
+    },
+    {
+      "path": "./packages/tooltip"
+    },
+    {
+      "path": "./packages/tooltip-extension"
+    },
+    {
+      "path": "./packages/ui-components"
+    },
+    {
+      "path": "./packages/ui-components-extension"
+    },
+    {
+      "path": "./packages/vdom"
+    },
+    {
+      "path": "./packages/vdom-extension"
+    },
+    {
+      "path": "./packages/vega5-extension"
+    }
+  ]
+}

+ 130 - 0
typedoc.js

@@ -0,0 +1,130 @@
+// const git = require('git-rev-sync');
+
+const packages = [
+  'application-extension',
+  'application',
+  'apputils-extension',
+  'apputils',
+  'attachments',
+  'cells',
+  'celltags-extension',
+  'celltags',
+  'codeeditor',
+  'codemirror-extension',
+  'codemirror',
+  'completer-extension',
+  'completer',
+  'console-extension',
+  'console',
+  'coreutils',
+  'csvviewer-extension',
+  'csvviewer',
+  'docmanager-extension',
+  'docmanager',
+  'docregistry',
+  'documentsearch-extension',
+  'documentsearch',
+  'extensionmanager-extension',
+  'extensionmanager',
+  'filebrowser-extension',
+  'filebrowser',
+  'fileeditor-extension',
+  'fileeditor',
+  'help-extension',
+  'htmlviewer-extension',
+  'htmlviewer',
+  'hub-extension',
+  'imageviewer-extension',
+  'imageviewer',
+  'inspector-extension',
+  'inspector',
+  'javascript-extension',
+  'json-extension',
+  'launcher-extension',
+  'launcher',
+  'logconsole-extension',
+  'logconsole',
+  'mainmenu-extension',
+  'mainmenu',
+  'markdownviewer-extension',
+  'markdownviewer',
+  'mathjax2-extension',
+  'mathjax2',
+  'metapackage',
+  'nbconvert-css',
+  'nbformat',
+  'notebook-extension',
+  'notebook',
+  'observables',
+  'outputarea',
+  'pdf-extension',
+  'property-inspector',
+  'rendermime-extension',
+  'rendermime-interfaces',
+  'rendermime',
+  'running-extension',
+  'running',
+  'services',
+  'settingeditor-extension',
+  'settingeditor',
+  'settingregistry',
+  'shortcuts-extension',
+  'statedb',
+  'statusbar-extension',
+  'statusbar',
+  'tabmanager-extension',
+  'terminal-extension',
+  'terminal',
+  'theme-dark-extension',
+  'theme-light-extension',
+  'tooltip-extension',
+  'tooltip',
+  'ui-components-extension',
+  'ui-components',
+  'vdom-extension',
+  'vdom',
+  'vega5-extension'
+];
+
+const inputFiles = packages.map(p => `${__dirname}/packages/${p}/src`);
+
+module.exports = {
+  inputFiles,
+  exclude: [
+    // '^((?!index\.ts).)*$',
+    // '^((?!index\.tsx).)*$',
+    // '**/*+(__tests__|internal|lib|node_modules|demos)/**/*',
+
+    '.history',
+    '**/.storybook',
+    '**/babel.config.js',
+    '**/*.spec.ts*',
+    '**/*.stories.ts*',
+    '**/buildutils/**',
+    '**/docs/source/**',
+    '**/examples/**',
+    // '**/lib/**',
+    '**/node_modules/**',
+    '**/test/**',
+    '**/tests/**',
+    '**/testutils/**',
+
+    '**/packages/celltags/**',
+    '**/packages/logconsole/**'
+    // '**/packages/settingregistry/**'
+
+    // '**/packages/celltags*/**',
+    // '**/packages/logconsole*/**',
+  ],
+  excludeNotExported: true,
+  ignoreCompilerErrors: false,
+  mode: 'library',
+  name: '@jupyterlab',
+  out: 'docs/api',
+  readme: 'README.md',
+  theme: 'typedoc-theme',
+  tsconfig: 'tsconfigdoc.json'
+
+  // gitRevision: 'master',
+  // 'sourcefile-url-prefix': `https://github.com/sinnerschrader/feature-hub/tree/${git.short()}/packages/`,
+};

+ 55 - 3
yarn.lock

@@ -2946,7 +2946,7 @@
   dependencies:
     "@types/webpack" "*"
 
-"@types/minimatch@*":
+"@types/minimatch@*", "@types/minimatch@3.0.3":
   version "3.0.3"
   resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
   integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==
@@ -4277,6 +4277,13 @@ babel-runtime@^6.18.0, babel-runtime@^6.26.0, babel-runtime@^6.6.1:
     core-js "^2.4.0"
     regenerator-runtime "^0.11.0"
 
+backbone@^1.4.0:
+  version "1.4.0"
+  resolved "https://registry.yarnpkg.com/backbone/-/backbone-1.4.0.tgz#54db4de9df7c3811c3f032f34749a4cd27f3bd12"
+  integrity sha512-RLmDrRXkVdouTg38jcgHhyQ/2zjg7a8E6sz2zxfz21Hh17xDJYUHBZimVIt5fUyS8vbfpeSmTL3gUjTEvUV3qQ==
+  dependencies:
+    underscore ">=1.8.3"
+
 balanced-match@^1.0.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
@@ -7916,7 +7923,7 @@ handlebars@^4.4.0, handlebars@^4.5.3:
   optionalDependencies:
     uglify-js "^3.1.4"
 
-handlebars@^4.7.6:
+handlebars@^4.7.2, handlebars@^4.7.6:
   version "4.7.6"
   resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.6.tgz#d4c05c1baf90e9945f77aa68a7a219aa4a7df74e"
   integrity sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==
@@ -8052,6 +8059,11 @@ highlight.js@^10.0.0:
   resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.0.3.tgz#5effcc58420f113f279a0badb8ac50c4be06e63b"
   integrity sha512-9FG7SSzv9yOY5CGGxfI6NDm7xLYtMOjKtPBxw7Zff3t5UcRcUNTGEeS8lNjhceL34KeetLMoGMFTGoaa83HwyQ==
 
+highlight.js@^9.18.0:
+  version "9.18.1"
+  resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.18.1.tgz#ed21aa001fe6252bb10a3d76d47573c6539fe13c"
+  integrity sha512-OrVKYz70LHsnCgmbXctv/bfuvntIKDz177h0Co37DQ5jamGZLVmoCVMtjMtNZY3X9DrCcKfklHPNeA0uPZhSJg==
+
 highlight.js@~9.12.0:
   version "9.12.0"
   resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.12.0.tgz#e6d9dbe57cbefe60751f02af336195870c90c01e"
@@ -9502,6 +9514,11 @@ jpeg-js@0.1.2, jpeg-js@^0.1.2:
   resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.1.2.tgz#135b992c0575c985cfa0f494a3227ed238583ece"
   integrity sha1-E1uZLAV1yYXPoPSUoyJ+0jhYPs4=
 
+jquery@^3.4.1:
+  version "3.5.1"
+  resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.5.1.tgz#d7b4d08e1bfdb86ad2f1a3d039ea17304717abb5"
+  integrity sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==
+
 js-levenshtein@^1.1.3:
   version "1.1.6"
   resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d"
@@ -12474,6 +12491,15 @@ react-docgen-typescript-loader@^3.3.0:
     loader-utils "^1.2.3"
     react-docgen-typescript "^1.15.0"
 
+react-docgen-typescript-loader@^3.7.2:
+  version "3.7.2"
+  resolved "https://registry.yarnpkg.com/react-docgen-typescript-loader/-/react-docgen-typescript-loader-3.7.2.tgz#45cb2305652c0602767242a8700ad1ebd66bbbbd"
+  integrity sha512-fNzUayyUGzSyoOl7E89VaPKJk9dpvdSgyXg81cUkwy0u+NBvkzQG3FC5WBIlXda0k/iaxS+PWi+OC+tUiGxzPA==
+  dependencies:
+    "@webpack-contrib/schema-utils" "^1.0.0-beta.0"
+    loader-utils "^1.2.3"
+    react-docgen-typescript "^1.15.0"
+
 react-docgen-typescript@^1.15.0:
   version "1.16.1"
   resolved "https://registry.yarnpkg.com/react-docgen-typescript/-/react-docgen-typescript-1.16.1.tgz#3c4570601b2e765280adf570a0f344b35111604d"
@@ -14779,6 +14805,16 @@ typedarray@^0.0.6:
   resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
   integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
 
+typedoc-default-themes@0.8.0-0:
+  version "0.8.0-0"
+  resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.8.0-0.tgz#80b7080837b2c9eba36c2fe06601ebe01973a0cd"
+  integrity sha512-blFWppm5aKnaPOa1tpGO9MLu+njxq7P3rtkXK4QxJBNszA+Jg7x0b+Qx0liXU1acErur6r/iZdrwxp5DUFdSXw==
+  dependencies:
+    backbone "^1.4.0"
+    jquery "^3.4.1"
+    lunr "^2.3.8"
+    underscore "^1.9.1"
+
 typedoc-default-themes@^0.10.1:
   version "0.10.1"
   resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.10.1.tgz#eb27b7d689457c7ec843e47ec0d3e500581296a7"
@@ -14802,6 +14838,22 @@ typedoc@^0.17.7:
     shelljs "^0.8.4"
     typedoc-default-themes "^0.10.1"
 
+typedoc@next:
+  version "0.17.0-3"
+  resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.17.0-3.tgz#91996e77427ff3a208ab76595a927ee11b75e9e8"
+  integrity sha512-DO2djkR4NHgzAWfNbJb2eQKsFMs+gOuYBXlQ8dOSCjkAK5DRI7ZywDufBGPUw7Ue9Qwi2Cw1DxLd3reDq8wFuQ==
+  dependencies:
+    "@types/minimatch" "3.0.3"
+    fs-extra "^8.1.0"
+    handlebars "^4.7.2"
+    highlight.js "^9.18.0"
+    lodash "^4.17.15"
+    marked "^0.8.0"
+    minimatch "^3.0.0"
+    progress "^2.0.3"
+    shelljs "^0.8.3"
+    typedoc-default-themes "0.8.0-0"
+
 typescript@~3.9.2:
   version "3.9.2"
   resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.2.tgz#64e9c8e9be6ea583c54607677dd4680a1cf35db9"
@@ -14843,7 +14895,7 @@ umask@^1.1.0:
   resolved "https://registry.yarnpkg.com/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d"
   integrity sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0=
 
-underscore@>=1.3.1:
+underscore@>=1.3.1, underscore@>=1.8.3:
   version "1.10.2"
   resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.10.2.tgz#73d6aa3668f3188e4adb0f1943bd12cfd7efaaaf"
   integrity sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==