diff --git a/.gitignore b/.gitignore index 50493454f4..e61fb7603d 100644 --- a/.gitignore +++ b/.gitignore @@ -128,3 +128,5 @@ integration-tests/**/.lock # Generated docs /packages/realm/docs/ +/packages/realm-react/docs/ +/packages/realm-web/docs/ diff --git a/packages/realm-react/logo.svg b/media/realm-react-logo.svg similarity index 100% rename from packages/realm-react/logo.svg rename to media/realm-react-logo.svg diff --git a/packages/realm-react/README.md b/packages/realm-react/README.md index 7a1b1ee68c..1ec4763626 100644 --- a/packages/realm-react/README.md +++ b/packages/realm-react/README.md @@ -1,5 +1,5 @@

- Realm React Logo + Realm React Logo

diff --git a/packages/realm-react/media b/packages/realm-react/media new file mode 120000 index 0000000000..85298d6e44 --- /dev/null +++ b/packages/realm-react/media @@ -0,0 +1 @@ +../../media \ No newline at end of file diff --git a/packages/realm-react/package.json b/packages/realm-react/package.json index 899e924115..dcc4a46bb8 100644 --- a/packages/realm-react/package.json +++ b/packages/realm-react/package.json @@ -9,9 +9,9 @@ "scripts": { "bundle": "wireit", "start": "npm run build -- --watch", - "test": "jest --forceExit", "test": "wireit", - "lint": "eslint --ext .tsx ." + "lint": "eslint --ext .tsx .", + "docs": "wireit" }, "wireit": { "bundle": { @@ -30,6 +30,12 @@ "../realm:build:node", "../realm-common:bundle" ] + }, + "docs": { + "command": "typedoc", + "dependencies": [ + "bundle" + ] } }, "dependencies": { diff --git a/packages/realm-react/typedoc.json b/packages/realm-react/typedoc.json new file mode 100644 index 0000000000..9e132fce05 --- /dev/null +++ b/packages/realm-react/typedoc.json @@ -0,0 +1,11 @@ +{ + "entryPoints": ["src/index.tsx"], + "tsconfig": "./tsconfig.json", + "excludeInternal": true, + "customCss": "../../typedoc/style.css", + "media": "./media", + "name": "Realm React", + "includeVersion": true, + "sourceLinkTemplate": "https://github.com/realm/realm-js/blob/{gitRevision}/{path}#L{line}", + "favicon": "../../media/favicon.ico" +} diff --git a/packages/realm-web/package.json b/packages/realm-web/package.json index 3ce7d464fa..c3672ad47f 100644 --- a/packages/realm-web/package.json +++ b/packages/realm-web/package.json @@ -16,7 +16,8 @@ "start": "npm run build -- --watch", "lint": "eslint --ext .js,.ts .", "test": "mocha 'src/tests/**/*.test.ts'", - "postversion": "ts-node --project scripts/tsconfig.json scripts/postversion.ts" + "postversion": "ts-node --project scripts/tsconfig.json scripts/postversion.ts", + "docs": "wireit" }, "wireit": { "bundle": { @@ -35,6 +36,10 @@ "command": "ts-node --project scripts/tsconfig.json scripts/update-types.ts", "files": ["../../types"], "output": ["types/realm"] + }, + "docs": { + "command": "typedoc", + "dependencies": ["bundle"] } }, "files": [ diff --git a/packages/realm-web/typedoc.json b/packages/realm-web/typedoc.json new file mode 100644 index 0000000000..6b07517c0d --- /dev/null +++ b/packages/realm-web/typedoc.json @@ -0,0 +1,11 @@ +{ + "entryPoints": ["src/index.ts"], + "tsconfig": "./tsconfig.json", + "excludeInternal": true, + "customCss": "../../typedoc/style.css", + "media": "../../media", + "name": "Realm Web", + "includeVersion": true, + "sourceLinkTemplate": "https://github.com/realm/realm-js/blob/{gitRevision}/{path}#L{line}", + "favicon": "../../media/favicon.ico" +} diff --git a/packages/realm/typedoc.json b/packages/realm/typedoc.json index 872afc8ece..c38eabfc8f 100644 --- a/packages/realm/typedoc.json +++ b/packages/realm/typedoc.json @@ -2,7 +2,7 @@ "entryPoints": ["src/index.ts"], "tsconfig": "./tsconfig.json", "excludeInternal": true, - "customCss": "./typedoc/styles.css", + "customCss": "../../typedoc/style.css", "media": "../../media", "name": "Realm JavaScript", "includeVersion": true, diff --git a/packages/realm/typedoc/styles.css b/typedoc/style.css similarity index 100% rename from packages/realm/typedoc/styles.css rename to typedoc/style.css