From 51407ada5320d63f30119df9fab4f86ab65e5b15 Mon Sep 17 00:00:00 2001 From: jojobii Date: Mon, 19 Dec 2022 22:47:07 -0800 Subject: [PATCH 1/3] Implement docs generation for GitHub Pages * add gitignore for node_modules * fix typo import * implement typedoc site generation * implement github action for pages deployment --- .github/workflows/pages.yml | 63 +++++++++++ .gitignore | 2 + lib/activitypub/types.d.ts | 4 +- package-lock.json | 211 ++++++++++++++++++++++++++++++++++++ package.json | 2 + tsconfig.json | 5 + typedoc.json | 13 +++ 7 files changed, 298 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pages.yml create mode 100644 .gitignore create mode 100644 package-lock.json create mode 100644 tsconfig.json create mode 100644 typedoc.json diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..620e95a --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,63 @@ +name: Generate and Deploy Documentation + +on: + # Runs on pushes targeting the default branch + push: + branches: ["omo"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +env: + BUILD_PATH: "." # default value when not using subfolders + # BUILD_PATH: subfolder + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: "16" + cache: npm + cache-dependency-path: ${{ env.BUILD_PATH }}/package-lock.json + - name: Setup Pages + id: pages + uses: actions/configure-pages@v2 + - name: Install dependencies + run: npm install + working-directory: ${{ env.BUILD_PATH }} + - name: Build with Astro + run: npm run docs:build + working-directory: ${{ env.BUILD_PATH }} + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ${{ env.BUILD_PATH }}/.docs + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: build + runs-on: ubuntu-latest + name: Deploy + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fdfe30f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +.docs \ No newline at end of file diff --git a/lib/activitypub/types.d.ts b/lib/activitypub/types.d.ts index 8572c48..3385c19 100644 --- a/lib/activitypub/types.d.ts +++ b/lib/activitypub/types.d.ts @@ -2,7 +2,7 @@ import type { BaseObject, ActorTypes, ObjectTypes, - ActivityTypes, + ActivtyTypes, Collection, OrderedCollection, } from '../activitystreams/types' @@ -17,7 +17,7 @@ export interface SecPublicKey { export type AnyCollection = OrderedCollection | Collection export type ActorCollection = AnyCollection -export type ActivityEndpoint = OrderedCollection +export type ActivityEndpoint = OrderedCollection /** @see https://www.w3.org/TR/activitypub/#actor-objects */ export interface Actor extends BaseObject { diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..22c8a11 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,211 @@ +{ + "name": "@musakui/fedi", + "version": "0.1.1", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "@musakui/fedi", + "version": "0.1.1", + "license": "MIT", + "devDependencies": { + "typedoc": "^0.23.23" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", + "dev": true + }, + "node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true + }, + "node_modules/marked": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.4.tgz", + "integrity": "sha512-Wcc9ikX7Q5E4BYDPvh1C6QNSxrjC9tBgz+A/vAhp59KXUgachw++uMvMKiSW8oA85nopmPZcEvBoex/YLMsiyA==", + "dev": true, + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/minimatch": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz", + "integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shiki": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.11.1.tgz", + "integrity": "sha512-EugY9VASFuDqOexOgXR18ZV+TbFrQHeCpEYaXamO+SZlsnT/2LxuLBX25GGtIrwaEVFXUAbUQ601SWE2rMwWHA==", + "dev": true, + "dependencies": { + "jsonc-parser": "^3.0.0", + "vscode-oniguruma": "^1.6.1", + "vscode-textmate": "^6.0.0" + } + }, + "node_modules/typedoc": { + "version": "0.23.23", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.23.tgz", + "integrity": "sha512-cg1YQWj+/BU6wq74iott513U16fbrPCbyYs04PHZgvoKJIc6EY4xNobyDZh4KMfRGW8Yjv6wwIzQyoqopKOUGw==", + "dev": true, + "dependencies": { + "lunr": "^2.3.9", + "marked": "^4.2.4", + "minimatch": "^5.1.1", + "shiki": "^0.11.1" + }, + "bin": { + "typedoc": "bin/typedoc" + }, + "engines": { + "node": ">= 14.14" + }, + "peerDependencies": { + "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x" + } + }, + "node_modules/typescript": { + "version": "4.9.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", + "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", + "dev": true, + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/vscode-oniguruma": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", + "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", + "dev": true + }, + "node_modules/vscode-textmate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-6.0.0.tgz", + "integrity": "sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ==", + "dev": true + } + }, + "dependencies": { + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", + "dev": true + }, + "lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true + }, + "marked": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.4.tgz", + "integrity": "sha512-Wcc9ikX7Q5E4BYDPvh1C6QNSxrjC9tBgz+A/vAhp59KXUgachw++uMvMKiSW8oA85nopmPZcEvBoex/YLMsiyA==", + "dev": true + }, + "minimatch": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz", + "integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "shiki": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.11.1.tgz", + "integrity": "sha512-EugY9VASFuDqOexOgXR18ZV+TbFrQHeCpEYaXamO+SZlsnT/2LxuLBX25GGtIrwaEVFXUAbUQ601SWE2rMwWHA==", + "dev": true, + "requires": { + "jsonc-parser": "^3.0.0", + "vscode-oniguruma": "^1.6.1", + "vscode-textmate": "^6.0.0" + } + }, + "typedoc": { + "version": "0.23.23", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.23.tgz", + "integrity": "sha512-cg1YQWj+/BU6wq74iott513U16fbrPCbyYs04PHZgvoKJIc6EY4xNobyDZh4KMfRGW8Yjv6wwIzQyoqopKOUGw==", + "dev": true, + "requires": { + "lunr": "^2.3.9", + "marked": "^4.2.4", + "minimatch": "^5.1.1", + "shiki": "^0.11.1" + } + }, + "typescript": { + "version": "4.9.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", + "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", + "dev": true, + "peer": true + }, + "vscode-oniguruma": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", + "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", + "dev": true + }, + "vscode-textmate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-6.0.0.tgz", + "integrity": "sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ==", + "dev": true + } + } +} diff --git a/package.json b/package.json index 8a2735d..981db14 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,9 @@ ".": "./lib/index.js" }, "scripts": { + "docs:build": "typedoc" }, "devDependencies": { + "typedoc": "^0.23.23" } } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..e1fa779 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,5 @@ +{ + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/typedoc.json b/typedoc.json new file mode 100644 index 0000000..f849094 --- /dev/null +++ b/typedoc.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "cleanOutputDir": true, + "out": ".docs", + "entryPointStrategy": "expand", + "entryPoints": ["."], + "exclude": ["node_modules/**/*"], + "name": "@musakui/fedi", + "readme": "./README.md", + "navigationLinks": { + "GitHub": "https://github.com/musakui/fedi" + } +} \ No newline at end of file From 6b95cc36c71ff961d450a6c49c11d60d19067aa2 Mon Sep 17 00:00:00 2001 From: Joseph Bravo Date: Mon, 19 Dec 2022 23:24:30 -0800 Subject: [PATCH 2/3] refine typedoc config --- tsconfig.json | 6 +++++- typedoc.json | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index e1fa779..0a1750a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,9 @@ { "exclude": [ "node_modules" - ] + ], + "compilerOptions": { + "allowJs": true, + "strict": false + } } \ No newline at end of file diff --git a/typedoc.json b/typedoc.json index f849094..e99f0e5 100644 --- a/typedoc.json +++ b/typedoc.json @@ -2,7 +2,8 @@ "$schema": "https://typedoc.org/schema.json", "cleanOutputDir": true, "out": ".docs", - "entryPointStrategy": "expand", + "tsconfig": "tsconfig.json", + "entryPointStrategy": "packages", "entryPoints": ["."], "exclude": ["node_modules/**/*"], "name": "@musakui/fedi", @@ -10,4 +11,4 @@ "navigationLinks": { "GitHub": "https://github.com/musakui/fedi" } -} \ No newline at end of file +} From 9b5d32a359d960891fa9d7cb169874cbc672e962 Mon Sep 17 00:00:00 2001 From: Joseph Bravo Date: Mon, 19 Dec 2022 23:56:53 -0800 Subject: [PATCH 3/3] include version in typedoc --- typedoc.json | 1 + 1 file changed, 1 insertion(+) diff --git a/typedoc.json b/typedoc.json index e99f0e5..541dee4 100644 --- a/typedoc.json +++ b/typedoc.json @@ -8,6 +8,7 @@ "exclude": ["node_modules/**/*"], "name": "@musakui/fedi", "readme": "./README.md", + "includeVersion": true, "navigationLinks": { "GitHub": "https://github.com/musakui/fedi" }