mirror of
https://github.com/wavetermdev/docusaurus-og.git
synced 2026-08-05 13:46:35 -07:00
Move to og only
Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
### Summary:
|
||||
|
||||
[Provide a brief summary of the issue.]
|
||||
|
||||
### Environment:
|
||||
|
||||
- Operating System:
|
||||
- Browser (If applicable):
|
||||
- Project Version:
|
||||
- Additional relevant information:
|
||||
|
||||
### Steps to Reproduce:
|
||||
|
||||
1. [First step]
|
||||
2. [Second step]
|
||||
3. [And so on…]
|
||||
|
||||
### Expected Behavior:
|
||||
|
||||
[Provide a detailed description of the expected behavior.]
|
||||
|
||||
### Actual Behavior:
|
||||
|
||||
[Provide a detailed description of the actual behavior you are experiencing.]
|
||||
|
||||
### Screenshots (if applicable):
|
||||
|
||||
[Attach screenshots to help illustrate the issue.]
|
||||
|
||||
### Additional Information:
|
||||
|
||||
[Any additional information, configuration, or data that might be necessary to reproduce the issue.]
|
||||
|
||||
### Potential Solutions (if applicable):
|
||||
|
||||
[Optional: Provide any thoughts or ideas you might have on potential solutions to the issue.]
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
### Feature Request:
|
||||
|
||||
[Quick summary of the feature you would like to be added.]
|
||||
|
||||
### Why is this feature important?
|
||||
|
||||
[Explain why you think this feature would be beneficial.]
|
||||
|
||||
### How should it work?
|
||||
|
||||
[Briefly describe how you envision this feature working, or how you would like it to be implemented.]
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
name: Simple Template
|
||||
about: Create an issue to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
### Summary:
|
||||
|
||||
[Provide a brief summary of the issue]
|
||||
|
||||
### Environment:
|
||||
|
||||
- Operating System:
|
||||
- Browser (If applicable):
|
||||
- Additional relevant information (If applicable):
|
||||
|
||||
### Steps to Reproduce:
|
||||
|
||||
1. [First step]
|
||||
2. [And so on…]
|
||||
|
||||
### Expected Behavior:
|
||||
|
||||
[Description of the expected behavior]
|
||||
|
||||
### Actual Behavior:
|
||||
|
||||
[Description of the actual behavior you are experiencing]
|
||||
|
||||
### Screenshots (if applicable):
|
||||
|
||||
[Attach screenshots to help illustrate the issue]
|
||||
@@ -1,30 +0,0 @@
|
||||
### Description:
|
||||
|
||||
[Provide a brief description of the changes in the pull request.]
|
||||
|
||||
### Related Issue(s):
|
||||
|
||||
[Link to the related Issue(s), if any.]
|
||||
|
||||
### Changes Included:
|
||||
|
||||
- [ ] Bugfix (a change that fixes an issue)
|
||||
- [ ] New feature (a change that adds new functionality)
|
||||
- [ ] Refactoring (a change that improves code quality and/or architecture)
|
||||
- [ ] Other (explain below)
|
||||
|
||||
### Implementation Details:
|
||||
|
||||
[Explain any new decisions made during the implementation of the changes.]
|
||||
|
||||
### Testing:
|
||||
|
||||
[Describe how the changes have been tested.]
|
||||
|
||||
### Checklist:
|
||||
|
||||
- [ ] My code follows the style guidelines of this project
|
||||
- [ ] I have performed a self-review of my own code
|
||||
- [ ] I have commented my code, particularly in hard-to-understand areas
|
||||
- [ ] My changes generate no new warnings
|
||||
- [ ] Any dependent changes have been merged and published in downstream modules
|
||||
@@ -1,60 +0,0 @@
|
||||
name: Canary Release
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
publish-canary:
|
||||
if: startsWith(github.head_ref, 'topic-')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get branch name
|
||||
shell: bash
|
||||
run: echo "name=$(echo $GITHUB_HEAD_REF | sed 's/refs\/heads\///' | tr '/' '-')" >> $GITHUB_OUTPUT
|
||||
id: branch_name
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: 1
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
yarn install --frozen-lockfile
|
||||
yarn lerna link
|
||||
|
||||
- name: Build packages
|
||||
run: yarn build
|
||||
|
||||
- name: Publish
|
||||
id: publish
|
||||
run: |
|
||||
echo ".npmrc" >> .git/info/exclude
|
||||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
|
||||
mkdir ${{ runner.temp }}/${{ steps.branch_name.outputs.name }}
|
||||
yarn lerna publish prerelease --canary --no-private --no-verify-access --yes --exact --dist-tag=${{ steps.branch_name.outputs.name }} --preid=${{ steps.branch_name.outputs.name }} --summary-file=${{ runner.temp }}/${{ steps.branch_name.outputs.name }}
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const summary = JSON.parse(fs.readFileSync('${{ runner.temp }}/${{ steps.branch_name.outputs.name }}/lerna-publish-summary.json', 'utf8'));
|
||||
const packages = summary.map(pkg => `**${pkg.packageName}@${pkg.version}**\n\`\`\`bash\nyarn add ${pkg.packageName}@${{ steps.branch_name.outputs.name }}\n\`\`\``).join('\n');
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `🎉 Canary Release!\n\n${packages}`
|
||||
})
|
||||
@@ -1,131 +0,0 @@
|
||||
name: Prerelease
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
|
||||
jobs:
|
||||
prerelease:
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
if: github.actor_id != vars.CI_BOT_ID && !contains(github.event.head_commit.message, format('chore{0} release', ':'))
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: create_token
|
||||
uses: tibdex/github-app-token@v2
|
||||
with:
|
||||
app_id: ${{ secrets.CI_APP_ID }}
|
||||
private_key: ${{ secrets.CI_APP_PRIVATE_KEY }}
|
||||
permissions: >-
|
||||
{ "contents": "write", "statuses": "write" }
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: 1
|
||||
token: ${{ steps.create_token.outputs.token }}
|
||||
|
||||
- name: Extract version from lerna.json
|
||||
run: echo "value=$(jq .version lerna.json -r)" >> $GITHUB_OUTPUT
|
||||
id: current_version
|
||||
|
||||
- name: Determine Prerelease Preid
|
||||
shell: bash
|
||||
run: echo "value=$([[ ${{ steps.current_version.outputs.value }} =~ beta ]] && echo "beta" || echo "alpha")" >> $GITHUB_OUTPUT
|
||||
id: preid
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
yarn install --frozen-lockfile
|
||||
yarn lerna link
|
||||
|
||||
- name: Check for changed packages
|
||||
id: changes
|
||||
run: |
|
||||
error_filename="${{ runner.temp }}/changes_errors.log";
|
||||
changes=$(echo $(yarn -s lerna changed --json --loglevel 2>>$error_filename) 2>>$error_filename);
|
||||
cat $error_filename;
|
||||
count=$([[ -n $changes ]] && echo $(echo $changes | jq '. | map(select(.private == false)) | length')) || echo 0
|
||||
changed=$([[ $changes > 0 ]] && echo "true" || echo "false")
|
||||
echo "changes=$count" >> $GITHUB_OUTPUT
|
||||
echo "changed=$changed" >> $GITHUB_OUTPUT
|
||||
|
||||
echo "changes: $changes - changed: $changed"
|
||||
|
||||
- name: Build packages
|
||||
run: yarn build
|
||||
|
||||
- name: Publish
|
||||
id: publish
|
||||
if: ${{ steps.changes.outputs.changed == 'true' }}
|
||||
run: |
|
||||
git config --global user.name '${{ vars.CI_APP_NAME }}[bot]'
|
||||
git config --global user.email '${{ vars.CI_BOT_ID }}+${{ vars.CI_APP_NAME }}[bot]@users.noreply.github.com'
|
||||
echo ".npmrc" >> .git/info/exclude
|
||||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
|
||||
yarn lerna version prerelease --no-private --conventional-commits --conventional-prerelease --preid=${{ steps.preid.outputs.value }} --yes
|
||||
yarn lerna publish from-git --summary-file=${{ runner.temp }} --yes
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}
|
||||
|
||||
# - name: Run release-pr.yaml workflow
|
||||
# if: ${{ steps.changes.outputs.changed == 'true' }}
|
||||
# run: |
|
||||
# tag=$(git describe --tags $(git rev-list --tags --max-count=1))
|
||||
# echo "${{ runner.temp }}/lerna-publish-summary.json";
|
||||
# if [[ -f "${{ runner.temp }}/lerna-publish-summary.json" ]]; then
|
||||
# gh workflow run release-pr.yml --ref $tag;
|
||||
# fi;
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Get release commit
|
||||
if: ${{ steps.changes.outputs.changed == 'true' }}
|
||||
shell: bash
|
||||
run: echo "sha=$(git rev-parse --verify HEAD)" >> $GITHUB_OUTPUT
|
||||
id: release_commit
|
||||
|
||||
- uses: actions/github-script@v6
|
||||
if: ${{ steps.changes.outputs.changed == 'true' }}
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const fs = require("fs/promises");
|
||||
let summary = null;
|
||||
|
||||
try {
|
||||
summary = await fs.readFile(
|
||||
"${{ runner.temp }}/lerna-publish-summary.json",
|
||||
"utf8"
|
||||
);
|
||||
} catch {
|
||||
console.log("No new releases!");
|
||||
}
|
||||
|
||||
if (!summary) return;
|
||||
|
||||
summary = JSON.parse(summary);
|
||||
|
||||
const packages = summary
|
||||
.map(
|
||||
(pkg) =>
|
||||
`**${pkg.packageName}@${pkg.version}**\n\`\`\`bash\nyarn add ${pkg.packageName}@${pkg.version}\n\`\`\``
|
||||
)
|
||||
.join("\n");
|
||||
|
||||
const preid = "${{ steps.preid.outputs.value }}";
|
||||
|
||||
github.rest.repos.createCommitComment({
|
||||
commit_sha: "${{ steps.release_commit.outputs.sha }}",
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `🎉 ${preid === 'alpha' ? 'Alpha' : 'Beta'} Release!\n\n${packages}`,
|
||||
});
|
||||
@@ -1,83 +0,0 @@
|
||||
name: Publish
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- 'main'
|
||||
types:
|
||||
- closed
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
if: ${{ (github.head_ref == 'release-stable' || github.head_ref == 'release-beta') && github.event.pull_request.merged == true }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: 1
|
||||
|
||||
- name: Extract version from lerna.json
|
||||
run: echo "value=$(jq .version lerna.json -r)" >> $GITHUB_OUTPUT
|
||||
id: current_version
|
||||
|
||||
- name: Determine Release type
|
||||
shell: bash
|
||||
run: echo "value=$([[ ${{ steps.current_version.outputs.value }} =~ beta ]] && echo "beta" || echo "stable")" >> $GITHUB_OUTPUT
|
||||
id: release_type
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
yarn install --frozen-lockfile
|
||||
yarn lerna link
|
||||
|
||||
- name: Bump versions
|
||||
id: bump
|
||||
run: |
|
||||
git config --global user.name 'github-actions';
|
||||
git config --global user.email 'github-actions@users.noreply.github.com';
|
||||
echo ".npmrc" >> .git/info/exclude
|
||||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc;
|
||||
yarn lerna publish from-package --summary-file=${{ runner.temp }}/ --yes
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Get release commit
|
||||
shell: bash
|
||||
run: |
|
||||
COMMIT_HASH=$(git rev-parse --verify HEAD);
|
||||
echo "sha=$COMMIT_HASH" >> $GITHUB_OUTPUT
|
||||
id: release_commit
|
||||
|
||||
- uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const releaseType = "${{ steps.release_type.outputs.value }}";
|
||||
const summary = JSON.parse(fs.readFileSync('${{ runner.temp }}/lerna-publish-summary.json', 'utf8'));
|
||||
const packages = summary.map(pkg => `**${pkg.packageName}@${pkg.version}**\n\`\`\`bash\nyarn add ${pkg.packageName}@${{ steps.branch_name.outputs.name }}\n\`\`\``).join('\n');
|
||||
|
||||
const body = `🎉 ${releaseType === 'stable' ? "Stable" : "Beta"} Release!\n\n${packages}`
|
||||
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: body
|
||||
});
|
||||
|
||||
github.rest.repos.createCommitComment({
|
||||
commit_sha: "${{ steps.release_commit.outputs.sha }}",
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body,
|
||||
});
|
||||
@@ -1,144 +0,0 @@
|
||||
name: Release PR
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
delete-release-prs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const { data: pullRequests } = await github.rest.pulls.list({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: "open",
|
||||
});
|
||||
for (const pr of pullRequests) {
|
||||
if (
|
||||
(pr.head.ref === "release-beta" || pr.head.ref === "release-stable") &&
|
||||
pr.user.login.includes("github-actions")
|
||||
) {
|
||||
await github.rest.pulls.update({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: pr.number,
|
||||
state: "closed",
|
||||
});
|
||||
console.log(`Closed PR #${pr.number}`);
|
||||
}
|
||||
}
|
||||
|
||||
create-release-pr:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: 1
|
||||
ref: main
|
||||
|
||||
- name: Extract version from lerna.json
|
||||
run: echo "value=$(jq .version lerna.json -r)" >> $GITHUB_OUTPUT
|
||||
id: current_version
|
||||
|
||||
- name: Determine Release type
|
||||
run: echo "value=$([[ ${{ steps.current_version.outputs.value }} =~ alpha ]] && echo "beta" || echo "stable")" >> $GITHUB_OUTPUT
|
||||
id: release_type
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
yarn install --frozen-lockfile
|
||||
yarn lerna link
|
||||
|
||||
- name: Bump versions
|
||||
id: bump
|
||||
run: |
|
||||
git config --global user.name 'github-actions';
|
||||
git config --global user.email 'github-actions@users.noreply.github.com';
|
||||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc;
|
||||
mkdir ${{ runner.temp }}/main;
|
||||
export type='${{ steps.release_type.outputs.value }}';
|
||||
export branch=release-$type;
|
||||
echo "RELEASE_BRANCH=$branch" >> $GITHUB_ENV;
|
||||
git switch -C $branch;
|
||||
|
||||
if [[ $type == 'beta' ]]; then
|
||||
out=$(yarn -s lerna version prerelease --no-private --conventional-commits --conventional-prerelease --preid=beta --no-git-tag-version --force-publish --yes);
|
||||
else
|
||||
out=$(yarn -s lerna version --conventional-commits --conventional-graduate --no-git-tag-version --yes);
|
||||
fi;
|
||||
|
||||
changes=$(echo "$out" | sed -n '/Changes:/,$p' | sed -n '/^ - .* => .*$/p');
|
||||
echo "changes<<EOF" >> $GITHUB_OUTPUT;
|
||||
echo "$changes" >> $GITHUB_OUTPUT;
|
||||
echo "EOF" >> $GITHUB_OUTPUT;
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Extract version from lerna.json
|
||||
run: echo "value=$(jq .version lerna.json -r)" >> $GITHUB_OUTPUT
|
||||
id: next_version
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git add .;
|
||||
git restore --staged .npmrc;
|
||||
git commit -m "chore: release v${{ steps.next_version.outputs.value }}";
|
||||
git push origin $RELEASE_BRANCH --force;
|
||||
|
||||
- name: Get release commit
|
||||
run: |
|
||||
COMMIT_HASH=$(git rev-parse --verify HEAD);
|
||||
COMMIT_MESSAGE=$(git log --format=%B -n 1 $COMMIT_HASH);
|
||||
echo "sha=$COMMIT_HASH" >> $GITHUB_OUTPUT
|
||||
echo "head=$RELEASE_BRANCH" >> $GITHUB_OUTPUT
|
||||
echo "message=$COMMIT_MESSAGE" >> $GITHUB_OUTPUT
|
||||
id: release_commit
|
||||
|
||||
- name: Find latest stable release
|
||||
id: latest_stable_release
|
||||
run: |
|
||||
echo "tag=$(git tag | grep -v -- "-alpha" | grep -v -- "-beta" | sort -V | tail -2 | head -1)" > $GITHUB_OUTPUT;
|
||||
|
||||
- name: Generate changelog
|
||||
id: changelog
|
||||
run: |
|
||||
# TODO
|
||||
env:
|
||||
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/github-script@v6
|
||||
id: pr
|
||||
env:
|
||||
CHANGES: ${{ steps.bump.outputs.changes }}
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const type = "${{ steps.release_type.outputs.value }}";
|
||||
const head = "${{ steps.release_commit.outputs.head }}";
|
||||
const title = "${{ steps.release_commit.outputs.message }}";
|
||||
const body = `This PR will bump the following packages:\n\`\`\`\n${process.env.CHANGES}\n\`\`\`\n\nPlease review and test the code, before merging this PR. You can also check the changelog for more details on what has changed.\n\n**Warning**: Once you merge this PR, the changes will be published to the npm registry and cannot be undone. Please make sure you are confident about the quality and stability of the code before publishing.`;
|
||||
|
||||
const res = await github.rest.pulls.create({
|
||||
body,
|
||||
head,
|
||||
title,
|
||||
base: "main",
|
||||
repo: context.repo.repo,
|
||||
owner: context.repo.owner,
|
||||
});
|
||||
@@ -1,73 +0,0 @@
|
||||
name: Remove Canary Releases
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
remove-canary-releases:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Authenticate with NPM
|
||||
run: |
|
||||
echo ".npmrc" >> .git/info/exclude
|
||||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Get package names
|
||||
id: packages
|
||||
run: |
|
||||
packages=$(yarn -s lerna list --json --loglevel error | jq '.[]["name"]')
|
||||
echo "name<<EOF" >> $GITHUB_OUTPUT
|
||||
echo $packages >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
cat $GITHUB_OUTPUT
|
||||
|
||||
- name: List merged pull requests
|
||||
id: merged_branches
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const response = await github.rest.pulls.list({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: "closed",
|
||||
base: "main",
|
||||
head: "topic-*",
|
||||
});
|
||||
|
||||
console.log(response.data.map(pr => pr.head.ref))
|
||||
|
||||
const prs = response.data
|
||||
.filter((pr) => !!pr.merged_at)
|
||||
.filter((pr) => +new Date() - new Date(pr.merged_at) > 24 * 60 * 60 * 1000);
|
||||
|
||||
const branches = prs.map((pr) => pr.head.ref);
|
||||
core.setOutput('branches', branches.join("\n"));
|
||||
|
||||
- name: Remove canary releases
|
||||
run: |
|
||||
packages=$(echo "${{ steps.packages.outputs.name }}" | tr -d '"')
|
||||
branches=$(echo "${{ steps.merged_branches.outputs.branches }}")
|
||||
for package in $packages; do
|
||||
for branch in $branches; do
|
||||
npm view $package dist-tags.$branch | xargs -i -d '\n' sh -c "npm unpublish $package@{} --force 2>&1 || true"
|
||||
npm dist-tag rm $package $branch 2>&1 || true
|
||||
done
|
||||
done
|
||||
+3
-1
@@ -24,4 +24,6 @@ packages/logos-docusaurus-preset/static/common/data/team.json
|
||||
|
||||
lerna-debug.log
|
||||
|
||||
packages/docusaurus-playground/static/generated/*
|
||||
packages/docusaurus-playground/static/generated/*
|
||||
|
||||
lib/
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
yarn prettier:staged
|
||||
@@ -1,9 +0,0 @@
|
||||
dist
|
||||
node_modules
|
||||
.yarn
|
||||
build
|
||||
coverage
|
||||
.docusaurus
|
||||
__fixtures__
|
||||
|
||||
packages/logos-*/lib/*
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"tabWidth": 2,
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all"
|
||||
}
|
||||
-1040
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
TODO
|
||||
@@ -1,133 +1,142 @@
|
||||
- [Overview](#overview)
|
||||
- [Quick start](#quick-start)
|
||||
- [Use a template](#use-a-template)
|
||||
- [Use with an existing Docusaurus website:](#use-with-an-existing-docusaurus-website)
|
||||
- [Use the playground](#use-the-playground)
|
||||
- [Next steps](#next-steps)
|
||||
- [Working on content](#working-on-content)
|
||||
- [Configuration](#configuration)
|
||||
- [Become a contributor](#become-a-contributor)
|
||||
- [Packages](#packages)
|
||||
- [License](#license)
|
||||
# Docusaurus OG
|
||||
|
||||
## Overview
|
||||
Docusaurus OG enables you to automate the generation of custom OpenGraph (OG) images for your Docusaurus website, enhancing the visual representation of your content when shared on social media and other platforms.
|
||||
|
||||
This repository contains a set of Docusaurus 2 plugins and themes, initially crafted for Logos websites but versatile enough for use with any Docusaurus website. The collection includes a headless local search, OG image generation, and Fathom Analytics plugins.
|
||||
This plugin leverages [Vercel's Satori](https://github.com/vercel/satori) to convert your HTML and CSS into images. It lets you define image renderers tailored to each Docusaurus content plugin, allowing you to create unique OG images for your website's content.
|
||||
|
||||
## Quick start
|
||||
## Installation
|
||||
|
||||
### Use a template
|
||||
To get started, simply follow these steps:
|
||||
|
||||
Kickstart your website creation with our ready-to-use templates. Choose a template that fits your needs, whether it's a documentation, a blog, or a complete website.
|
||||
|
||||
1. Choose a template:
|
||||
|
||||
- [Website Template](https://github.com/acid-info/logos-website-template)
|
||||
- [Documentation Website Template](https://github.com/acid-info/logos-documentation-website-template)
|
||||
- [Blog Template](https://github.com/acid-info/logos-blog-template)
|
||||
|
||||
2. Clone your selected template:
|
||||
1. Install the plugin:
|
||||
|
||||
```bash
|
||||
# Example: Create a website with a landing page
|
||||
git clone https://github.com/acid-info/logos-homepage-template.git my-website && cd my-website
|
||||
yarn add @acid-info/docusaurus-og
|
||||
|
||||
# Example: Create a documentation website
|
||||
git clone https://github.com/acid-info/logos-documentation-website-template.git my-website && cd my-website
|
||||
# or
|
||||
|
||||
# Example: create a blog
|
||||
git clone https://github.com/acid-info/logos-blog-template.git my-website && cd my-website
|
||||
npm install @acid-info/docusaurus-og
|
||||
```
|
||||
|
||||
3. Install the dependencies:
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
4. Run your new website locally:
|
||||
|
||||
```bash
|
||||
yarn start
|
||||
```
|
||||
|
||||
### Use with an existing Docusaurus website:
|
||||
|
||||
1. Install the [Logos Docusaurus preset](./packages/logos-docusaurus-preset/):
|
||||
|
||||
```bash
|
||||
yarn add @acid-info/logos-docusaurus-preset
|
||||
```
|
||||
|
||||
2. Add the preset to your `docusaurus.config.js`:
|
||||
2. Integrate the plugin into your `docusaurus.config.js`:
|
||||
|
||||
```js
|
||||
presets: [
|
||||
[
|
||||
'@acid-info/logos-docusaurus-preset',
|
||||
/** @type {import('@acid-info/logos-docusaurus-preset').PluginOptions} */
|
||||
({
|
||||
businessUnit: 'Logos',
|
||||
}),
|
||||
],
|
||||
plugins: [
|
||||
[
|
||||
'@acid-info/docusaurus-og',
|
||||
{
|
||||
path: './preview-images', // relative to the build directory
|
||||
imageRenderers: {},
|
||||
},
|
||||
],
|
||||
|
||||
]
|
||||
```
|
||||
|
||||
### Use the playground
|
||||
3. Define your image renderers for the content plugins of your choice. Here's an example:
|
||||
|
||||
A playground located in the `packages/docusaurus-playground` of this repository can be used to test the plugins and themes locally.
|
||||
```js
|
||||
imageRenderers: {
|
||||
'docusaurus-plugin-content-docs': require('./lib/ImageRenderers').docs,
|
||||
'docusaurus-plugin-content-pages': require('./lib/ImageRenderers').pages,
|
||||
'docusaurus-plugin-content-blog': require('./lib/ImageRenderers').blog,
|
||||
}
|
||||
```
|
||||
|
||||
1. Clone the repository:
|
||||
## Create an Image Renderer
|
||||
|
||||
An image renderer is a function that receives a `data` object representing page data and a `context` object representing the Docusaurus context. This function returns HTML or JSX content, which serves as input for Satori, the image generation tool. Satori processes this content to produce the corresponding OpenGraph image.
|
||||
|
||||
For example, here's an image renderer for the `@docusaurus/plugin-content-docs` plugin:
|
||||
|
||||
```tsx
|
||||
// src/ImageRenderers.tsx
|
||||
import type { DocsPageData, ImageRenderer } from '@acid-info/docusaurus-og'
|
||||
import { readFileSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import React from 'react'
|
||||
|
||||
export const docs: ImageRenderer<DocsPageData> = (data, context) => [
|
||||
<div style={{ display: 'flex', background: 'black', color: 'white' }}>
|
||||
{data.metadata.title}
|
||||
</div>,
|
||||
{
|
||||
width: 1200,
|
||||
height: 630,
|
||||
fonts: [
|
||||
{
|
||||
name: 'Inter',
|
||||
data: readFileSync(
|
||||
join(__dirname, '../../static/Inter/Inter-Regular.ttf'),
|
||||
),
|
||||
weight: 400,
|
||||
style: 'normal',
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
```
|
||||
|
||||
### JSX Support
|
||||
|
||||
If you wish to use JSX within your image renderer, you'll need to compile your code to JavaScript. Here's a TypeScript example:
|
||||
|
||||
1. Create a `tsconfig.client.json` file in your project root to compile your `src` directory:
|
||||
|
||||
```json
|
||||
// tsconfig.client.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noEmit": false,
|
||||
"composite": true,
|
||||
"incremental": true,
|
||||
"esModuleInterop": true,
|
||||
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
||||
"rootDir": "src",
|
||||
"outDir": "lib",
|
||||
"module": "CommonJS",
|
||||
"target": "esnext",
|
||||
"jsx": "react",
|
||||
"types": ["node"],
|
||||
"baseUrl": "./",
|
||||
"lib": ["DOM"]
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
```
|
||||
|
||||
2. Add `prestart` and `prebuild` scripts to your `package.json`:
|
||||
|
||||
```json
|
||||
// package.json
|
||||
{
|
||||
"scripts": {
|
||||
"prestart": "tsc --project tsconfig.client.json",
|
||||
"prebuild": "tsc --project tsconfig.client.json"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
3. Exclude the `lib` directory from your version control by adding it to your `.gitignore` file:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/acid-info/logos-docusaurus-plugins.git
|
||||
echo "lib" >> .gitignore
|
||||
```
|
||||
|
||||
2. Install the dependencies:
|
||||
4. Import your image renderer from the `lib` directory:
|
||||
|
||||
```bash
|
||||
yarn install && yarn link
|
||||
```js
|
||||
plugins: [
|
||||
[
|
||||
'@acid-info/docusaurus-og',
|
||||
{
|
||||
path: './preview-images', // relative to the build directory
|
||||
imageRenderers: {
|
||||
'docusaurus-plugin-content-docs': require('./lib/ImageRenderers').docs,
|
||||
'docusaurus-plugin-content-pages': require('./lib/ImageRenderers')
|
||||
.pages,
|
||||
'docusaurus-plugin-content-blog': require('./lib/ImageRenderers').blog,
|
||||
},
|
||||
},
|
||||
],
|
||||
]
|
||||
```
|
||||
|
||||
3. Run the playground:
|
||||
|
||||
```bash
|
||||
yarn start
|
||||
```
|
||||
|
||||
## Next steps
|
||||
|
||||
### Working on content
|
||||
|
||||
Our plugins work smoothly with standard Docusaurus features, which you can use to manage and organize content. Learn more on the [Docusaurus website](https://docusaurus.io/docs). For practical guidance on dealing with common use cases, visit our dedicated [Wiki pages](https://github.com/acid-info/logos-docusaurus-plugins/wiki).
|
||||
|
||||
### Configuration
|
||||
|
||||
While it's possible to install and configure our plugins and themes individually, we highly recommend using the [Logos Docusaurus preset](./packages/logos-docusaurus-preset/) for a simplified installation. This preset establishes a default configuration for the plugins and theme and automatically incorporates essential website metadata, logos, and favicons for the selected business unit. For detailed configuration information, please refer to the README file of each package.
|
||||
|
||||
### Become a contributor
|
||||
|
||||
We welcome any kind of contribution, such as reporting issues, suggesting features, writing documentation or fixing bugs. Please read our [contributing guidelines](./CONTRIBUTING.md) on how to get started.
|
||||
|
||||
## Packages
|
||||
|
||||
- **Presets**
|
||||
|
||||
- [Logos Preset](./packages/logos-docusaurus-preset) - A Docusaurus preset for Logos websites.
|
||||
[](https://www.npmjs.com/package/@acid-info/logos-docusaurus-preset)
|
||||
|
||||
- **Plugins**
|
||||
|
||||
- [Logos Search Local](./packages/logos-docusaurus-search-local) - Headless local search engine for Docusaurus.
|
||||
[](https://www.npmjs.com/package/@acid-info/logos-docusaurus-search-local)
|
||||
|
||||
- [Docusaurus OG](./packages/docusaurus-og) - OpenGraph image generator for Docusaurus.
|
||||
[](https://www.npmjs.com/package/@acid-info/docusaurus-og)
|
||||
|
||||
- [Docusaurus Fathom](./packages/docusaurus-fathom) - Fathom Analytics plugin for Docusaurus.
|
||||
[](https://www.npmjs.com/package/@acid-info/docusaurus-fathom)
|
||||
|
||||
- **Themes**
|
||||
- [Logos Theme](./packages/logos-docusaurus-theme) - A customized version of Docusaurus classic theme built with [LSD](https://github.com/acid-info/lsd).
|
||||
[](https://www.npmjs.com/package/@acid-info/logos-docusaurus-theme)
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"version": "1.0.0-alpha.149",
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
|
||||
}
|
||||
+34
-39
@@ -1,46 +1,41 @@
|
||||
{
|
||||
"name": "root",
|
||||
"version": "0.0.0",
|
||||
"name": "@kas-tle/docusaurus-og",
|
||||
"version": "1.0.0-alpha.132",
|
||||
"description": "Docusaurus OpenGraph image plugin",
|
||||
"main": "lib/index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/acid-info/logos-docusaurus-plugins.git",
|
||||
"directory": "packages/docusaurus-og"
|
||||
},
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"bootstrap": "lerna bootstrap",
|
||||
"watch": "lerna --ignore docusaurus-playground run watch",
|
||||
"build": "lerna --ignore docusaurus-playground run build",
|
||||
"start": "lerna --scope docusaurus-playground run start",
|
||||
"serve": "lerna --scope docusaurus-playground run serve",
|
||||
"prepare": "husky install",
|
||||
"prettier": "pretty-quick",
|
||||
"prettier:staged": "pretty-quick --staged"
|
||||
"build": "tsc --build",
|
||||
"watch": "tsc --build --watch",
|
||||
"prepublishOnly": "yarn build",
|
||||
"postinstall": "tsc --outDir"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "^2.4.1",
|
||||
"@docusaurus/module-type-aliases": "^2.4.1",
|
||||
"@docusaurus/types": "^2.4.1",
|
||||
"@docusaurus/utils": "^2.4.1",
|
||||
"@docusaurus/utils-common": "^2.4.1",
|
||||
"@docusaurus/utils-validation": "^2.4.1",
|
||||
"lodash": "^4.17.21",
|
||||
"node-html-parser": "^6.1.5",
|
||||
"object-hash": "^3.0.0",
|
||||
"satori": "^0.10.13",
|
||||
"sharp": "^0.32.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.0.3",
|
||||
"@types/react": "^18.0.15",
|
||||
"cross-env": "^7.0.3",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-cli": "^2.3.0",
|
||||
"gulp-replace": "^1.1.3",
|
||||
"gulp-sass": "^5.1.0",
|
||||
"gulp-sourcemaps": "^3.0.0",
|
||||
"gulp-typescript": "^6.0.0-alpha.1",
|
||||
"husky": "^8.0.1",
|
||||
"lerna": "^6.0.1",
|
||||
"merge2": "^1.4.1",
|
||||
"minimist": "^1.2.7",
|
||||
"prettier": "^2.7.1",
|
||||
"pretty-quick": "^3.1.3",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"rimraf": "^3.0.2",
|
||||
"sync-directory": "^5.1.9",
|
||||
"typescript": "~4.7.4",
|
||||
"typescript-transform-paths": "^3.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.4 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.4 || ^17.0.0 || ^18.0.0"
|
||||
"@docusaurus/plugin-content-blog": "^3.1.1",
|
||||
"@docusaurus/plugin-content-docs": "^3.1.1",
|
||||
"@docusaurus/plugin-content-pages": "^3.1.1",
|
||||
"@types/lodash": "^4.14.186",
|
||||
"typescript": "^5.4.3"
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user