From fd2c62c611105e98a9dfee750bdae5ed88da4b38 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 25 Nov 2024 16:31:02 +0000 Subject: [PATCH] Update GitHub template files --- .changeset/README.md | 8 ++ .changeset/config.json | 14 +++ .dockerignore | 8 ++ .github/workflows/deployment.yaml | 16 ++- .github/workflows/format.yaml | 43 +++++++ .github/workflows/publish.yaml | 17 ++- .gitignore | 155 +++++++++++++++++++----- .prettierignore | 37 ++++++ .prettierrc | 8 ++ LICENSE | 2 +- manifest/certificate.yaml | 2 +- manifest/deployment.yaml | 2 +- manifest/ingress.yaml | 6 +- package.json | 72 ++++++----- packages/starlight-view-modes/README.md | 2 +- pnpm-workspace.yaml | 4 +- 16 files changed, 323 insertions(+), 73 deletions(-) create mode 100644 .changeset/README.md create mode 100644 .changeset/config.json create mode 100644 .dockerignore create mode 100644 .github/workflows/format.yaml create mode 100644 .prettierignore create mode 100644 .prettierrc diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 0000000..e5b6d8d --- /dev/null +++ b/.changeset/README.md @@ -0,0 +1,8 @@ +# Changesets + +Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works +with multi-package repos, or single-package repos to help you version and publish your code. You can +find the full documentation for it [in our repository](https://github.com/changesets/changesets) + +We have a quick list of common questions to get you started engaging with this project in +[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 0000000..263ec5a --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@3.0.3/schema.json", + "changelog": [ + "@changesets/changelog-github", + { "repo": "trueberryless-org/starlight-view-modes" } + ], + "commit": false, + "fixed": [], + "linked": [], + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b9a2f55 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +**/node_modules/ +**/dist +**/.git +npm-debug.log +.coverage +.coverage.* +.env +.aws \ No newline at end of file diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index 6b39673..7ac10b7 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -179,10 +179,24 @@ jobs: tag: ${{ env.IMAGE_NAME }}-docs@${{ needs.image-tag.outputs.IMAGE_TAG }} makeLatest: true body: ${{ steps.extract-changelog.outputs.markdown }} + skipIfReleaseExists: true + + - name: Check if release was created + id: check_release + run: | + if [ -z "${{ steps.create_release.outputs.html_url }}" ]; then + echo "RELEASE_SKIPPED=true" >> $GITHUB_ENV + else + echo "RELEASE_SKIPPED=false" >> $GITHUB_ENV + fi - name: Discord notification + if: env.RELEASE_SKIPPED == 'false' env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }} uses: Ilshidur/action-discord@0.3.2 with: - args: "# ${{ env.IMAGE_NAME }}-docs@${{ needs.image-tag.outputs.IMAGE_TAG }}\n\n${{ steps.extract-changelog.outputs.markdown }}" + args: | + # ${{ env.IMAGE_NAME }}@${{ needs.image-tag.outputs.IMAGE_TAG }} + + ${{ steps.extract-changelog.outputs.markdown }} diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml new file mode 100644 index 0000000..7ade522 --- /dev/null +++ b/.github/workflows/format.yaml @@ -0,0 +1,43 @@ +name: Format + +on: + push: + branches: [main] + +jobs: + format: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + with: + run_install: | + - recursive: false + args: [--frozen-lockfile] + - args: [--global, prettier, sort-package-json] + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" + - name: Sort package.json + run: find . -name "package.json" -not -path "*/node_modules/*" -exec sort-package-json {} \; + - name: Format with Prettier + run: pnpm prettier --write . + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ secrets.PUBLIC_GITHUB_TOKEN }} + commit-message: "[ci] format" + committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> + author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> + signoff: false + branch: ci-format + delete-branch: true + title: "[ci] format" + body: "This PR was automatically created to sort package.json files in the repository using sort-package-json and to format the repository using prettier." + labels: 🤖 bot + assignees: trueberryless + draft: false diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 2364781..aba1914 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -136,14 +136,29 @@ jobs: pattern: ${{ needs.image-tag.outputs.IMAGE_TAG }} - uses: ncipollo/release-action@v1 + id: create_release with: tag: ${{ env.IMAGE_NAME }}@${{ needs.image-tag.outputs.IMAGE_TAG }} makeLatest: true body: ${{ steps.extract-changelog.outputs.markdown }} + skipIfReleaseExists: true + + - name: Check if release was created + id: check_release + run: | + if [ -z "${{ steps.create_release.outputs.html_url }}" ]; then + echo "RELEASE_SKIPPED=true" >> $GITHUB_ENV + else + echo "RELEASE_SKIPPED=false" >> $GITHUB_ENV + fi - name: Discord notification + if: env.RELEASE_SKIPPED == 'false' env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }} uses: Ilshidur/action-discord@0.3.2 with: - args: "# ${{ env.IMAGE_NAME }}@${{ needs.image-tag.outputs.IMAGE_TAG }}\n\n${{ steps.extract-changelog.outputs.markdown }}" + args: | + # ${{ env.IMAGE_NAME }}@${{ needs.image-tag.outputs.IMAGE_TAG }} + + ${{ steps.extract-changelog.outputs.markdown }} diff --git a/.gitignore b/.gitignore index f259722..6a7d6d8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,33 +1,130 @@ -.astro -.DS_Store -.eslintcache -.idea -.next -.turbo -.vercel -.vscode/* -!.vscode/extensions.json -!.vscode/launch.json -!.vscode/settings.json -!.vscode/tasks.json -.vscode-test -.vscode-test-web -*.local -*.log -*.pem -*.tsbuildinfo -build -coverage -dist -dist-ssr -lerna-debug.log* +# Logs logs -next-env.d.ts -node_modules +*.log npm-debug.log* -out -pnpm-debug.log* -releases -test-results yarn-debug.log* yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..89291c4 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,37 @@ +# Dependency directories +node_modules/ +dist/ +build/ +out/ + +# Lock files +pnpm-lock.yaml +package-lock.json +yarn.lock + +# Build and generated files +*.min.* +*.bundle.* +*.map + +# Git and version control +**/.git + +# Framework-specific files +next-env.d.ts +__generated__/ + +# Test and coverage files +coverage/ +*.spec.* +*.test.* + +# Editor-specific files +.vscode/ +.idea/ +*.sublime-project +*.sublime-workspace + +# OS generated files +.DS_Store +Thumbs.db \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..2bdf5f7 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "trailingComma": "es5", + "tabWidth": 2, + "semi": true, + "singleQuote": false, + "endOfLine": "lf", + "htmlWhitespaceSensitivity": "css" +} diff --git a/LICENSE b/LICENSE index e85d40a..380ce44 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 trueberryless +Copyright (c) 2024-present, trueberryless Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/manifest/certificate.yaml b/manifest/certificate.yaml index 7ab9b79..ce46be3 100644 --- a/manifest/certificate.yaml +++ b/manifest/certificate.yaml @@ -9,4 +9,4 @@ spec: name: acme-issuer kind: ClusterIssuer dnsNames: - - 'starlight-view-modes.trueberryless.org' + - "starlight-view-modes.trueberryless.org" diff --git a/manifest/deployment.yaml b/manifest/deployment.yaml index 95aeea2..10884cd 100644 --- a/manifest/deployment.yaml +++ b/manifest/deployment.yaml @@ -17,5 +17,5 @@ spec: spec: containers: - name: starlight-view-modes - image: 'trueberryless/starlight-view-modes:main-59fd3a1cf21fb7a227f700d021f7f78e582d21fb' + image: "trueberryless/starlight-view-modes" imagePullPolicy: Always diff --git a/manifest/ingress.yaml b/manifest/ingress.yaml index 4228096..f4fa4c5 100644 --- a/manifest/ingress.yaml +++ b/manifest/ingress.yaml @@ -17,6 +17,6 @@ spec: number: 80 tls: - - hosts: - - starlight-view-modes.trueberryless.org - secretName: starlight-view-modes + - hosts: + - starlight-view-modes.trueberryless.org + secretName: starlight-view-modes diff --git a/package.json b/package.json index 3a53a57..1166729 100644 --- a/package.json +++ b/package.json @@ -1,35 +1,41 @@ { - "name": "starlight-view-modes", - "author": "trueberryless (https://trueberryless.org)", - "version": "0.1.0", - "license": "MIT", - "description": "Starlight plugin adding view mode capabilities to your documentation website.", - "type": "module", - "scripts": {}, - "devDependencies": { - "typescript": "5.4.2" - }, - "engines": { - "node": ">=18" - }, - "packageManager": "pnpm@9.3.0", - "private": true, - "sideEffects": false, - "keywords": [ - "starlight", - "plugin", - "zen", - "view", - "mode", - "zen-mode", - "view-modes", - "documentation" - ], - "homepage": "https://starlight-view-modes.trueberryless.org", - "repository": { - "type": "git", - "url": "https://github.com/trueberryless/starlight-view-modes.git", - "directory": "packages/starlight-view-modes" - }, - "bugs": "https://github.com/trueberryless/starlight-view-modes/issues" + "name": "starlight-view-modes-monorepo", + "version": "0.1.0", + "private": true, + "description": "Starlight plugin adding view mode capabilities to your documentation website.", + "keywords": [ + "starlight", + "plugin", + "zen", + "view", + "mode", + "zen-mode", + "view-modes", + "documentation" + ], + "homepage": "https://github.com/trueberryless-org/starlight-view-modes", + "bugs": { + "url": "https://github.com/trueberryless-org/starlight-view-modes/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/trueberryless-org/starlight-view-modes.git", + "directory": "packages/starlight-view-modes" + }, + "license": "MIT", + "author": "trueberryless (https://trueberryless.org)", + "sideEffects": false, + "type": "module", + "scripts": { + "version": "pnpm changeset version && pnpm i --no-frozen-lockfile" + }, + "devDependencies": { + "@changesets/changelog-github": "^0.5.0", + "@changesets/cli": "^2.27.9", + "typescript": "5.4.2" + }, + "packageManager": "pnpm@9.6.0", + "engines": { + "node": ">=18" + } } diff --git a/packages/starlight-view-modes/README.md b/packages/starlight-view-modes/README.md index b3fc868..373f89d 100644 --- a/packages/starlight-view-modes/README.md +++ b/packages/starlight-view-modes/README.md @@ -31,6 +31,6 @@ A [Starlight](https://starlight.astro.build) plugin adding view mode capabilitie ## License -Licensed under the MIT license, Copyright © trueberryless-org. +Licensed under the MIT license, Copyright © trueberryless. See [LICENSE](/LICENSE) for more information. diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 05395de..df1d4eb 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,3 @@ packages: - - "docs" - - "packages/**/*" + - "docs/" + - "packages/*"