Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs dev #8

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

docs dev #8

wants to merge 2 commits into from

Conversation

FortiShield
Copy link
Contributor

@FortiShield FortiShield commented Oct 14, 2024

User description

Notes for Reviewers

This PR fixes #

Signed commits

  • [*] Yes, I signed my commits.

PR Type

Enhancement, Documentation, Configuration changes, Dependencies


Description

  • Added a script to validate internal links in markdown files, integrating with GitHub API for comments and status updates.
  • Introduced comprehensive documentation for various Titanrepo functionalities, including commands, configurations, and guides.
  • Added new React components and TypeScript module declarations for enhanced documentation support.
  • Implemented package.json and package-lock.json for project configuration and dependency management.

Changes walkthrough 📝

Relevant files
Enhancement
3 files
validate-docs-links.ts
Add script for validating internal markdown links in documentation

docs/src/validate-docs-links.ts

  • Added a script to validate internal links in markdown files.
  • Collects and processes all .mdx files to check for broken links.
  • Generates comments on PRs for any discovered broken links.
  • Utilizes GitHub API for commenting and status updates.
  • +333/-0 
    github.ts
    Integrate GitHub API for comment and status management     

    docs/src/github.ts

  • Added GitHub API integration for managing comments and status checks.
  • Handles creation, updating, and finding of bot comments on PRs.
  • Manages GitHub check status updates based on link validation results.
  • +126/-0 
    create-turbo-callout.tsx
    Add CreateTitanCallout component for documentation guides

    docs/repo-docs/guides/tools/create-turbo-callout.tsx

  • Added a new React component CreateTitanCallout.
  • Utilizes Callout and Link components for rendering information.
  • +15/-0   
    Configuration changes
    3 files
    types.d.ts
    Add TypeScript module declarations for remark-rehype and rehype-raw

    docs/types.d.ts

    • Declared modules for remark-rehype and rehype-raw.
    +2/-0     
    meta.json
    Add metadata for getting started documentation section     

    docs/repo-docs/getting-started/meta.json

  • Added metadata for the getting started section.
  • Listed pages included in the section.
  • +10/-0   
    package.json
    Add package.json for project configuration and dependencies

    docs/package.json

  • Added a new package.json file with project configuration.
  • Defines scripts, dependencies, and devDependencies for the project.
  • Specifies the module type and export path for the package.
  • +29/-0   
    Documentation
    21 files
    run.mdx
    Document `titan run` command with options and examples     

    docs/repo-docs/reference/run.mdx

  • Added comprehensive documentation for the titan run command.
  • Detailed explanation of command options and usage examples.
  • Included callouts for important notes and warnings.
  • +540/-0 
    configuration.mdx
    Document configuration options for `titan.json`                   

    docs/repo-docs/reference/configuration.mdx

  • Added documentation on configuring titan.json.
  • Explained global options and task-specific configurations.
  • Included examples and callouts for best practices.
  • +535/-0 
    configuring-tasks.mdx
    Guide on configuring tasks in a repository                             

    docs/repo-docs/crafting-your-repository/configuring-tasks.mdx

  • Added guide on configuring tasks in a repository.
  • Explained task dependencies and outputs.
  • Provided examples for advanced task configurations.
  • +384/-0 
    structuring-a-repository.mdx
    Guide on structuring a repository for Titanrepo                   

    docs/repo-docs/crafting-your-repository/structuring-a-repository.mdx

  • Added guide on structuring a repository for Titanrepo.
  • Explained workspace setup and package management.
  • Included common pitfalls and best practices.
  • +336/-0 
    typescript.mdx
    Guide on using TypeScript in a monorepo                                   

    docs/repo-docs/guides/tools/typescript.mdx

  • Added guide on using TypeScript in a monorepo.
  • Explained sharing configurations and building packages.
  • Included best practices and limitations.
  • +343/-0 
    using-environment-variables.mdx
    Guide on using environment variables in Titanrepo               

    docs/repo-docs/crafting-your-repository/using-environment-variables.mdx

  • Added guide on handling environment variables in Titanrepo.
  • Explained environment modes and variable hashing.
  • Provided examples and best practices.
  • +296/-0 
    package-configurations.mdx
    Document package configurations for task flexibility         

    docs/repo-docs/reference/package-configurations.mdx

  • Added documentation on using package configurations.
  • Explained how to extend root configuration in packages.
  • Included examples and limitations.
  • +245/-0 
    managing-dependencies.mdx
    Add documentation on managing dependencies in monorepos   

    docs/repo-docs/crafting-your-repository/managing-dependencies.mdx

  • Added a new documentation file on managing dependencies in a monorepo.
  • Provides best practices for dependency installation and management.
  • Includes examples and links to external documentation for npm, Yarn,
    and pnpm.
  • Discusses tools and strategies for keeping dependencies in sync across
    packages.
  • +189/-0 
    creating-an-internal-package.mdx
    Guide for Creating Internal Packages in a Monorepo             

    docs/repo-docs/crafting-your-repository/creating-an-internal-package.mdx

  • Added a comprehensive guide on creating an internal package in a
    monorepo.
  • Included steps for setting up package.json, tsconfig.json, and source
    code.
  • Provided best practices for internal packages and application
    packages.
  • Added visual aids and code examples for clarity.
  • +319/-0 
    turbo-codemod.mdx
    Documentation for Codemods and Version Migrations in Titanrepo

    docs/repo-docs/reference/turbo-codemod.mdx

  • Introduced documentation for using codemods with Titanrepo.
  • Detailed usage instructions and examples for various codemods.
  • Provided migration paths for different Titanrepo versions.
  • Included code examples and terminal commands.
  • +384/-0 
    generating-code.mdx
    Guide on Code Generation with Titanrepo                                   

    docs/repo-docs/guides/generating-code.mdx

  • Added a guide on generating code using Titanrepo.
  • Explained how to add and copy packages, and create custom generators.
  • Included examples of generator configurations and usage.
  • Provided tips for writing and running generators.
  • +295/-0 
    storybook.mdx
    Integrating Storybook with Titanrepo: A Step-by-Step Guide

    docs/repo-docs/guides/tools/storybook.mdx

  • Introduced a guide for integrating Storybook with Titanrepo.
  • Provided steps for setting up Storybook in a monorepo.
  • Included configuration tips for co-locating stories and caching.
  • Offered additional tips for adding CSS and verifying setup.
  • +389/-0 
    caching.mdx
    Comprehensive Guide to Caching in Titanrepo                           

    docs/repo-docs/crafting-your-repository/caching.mdx

  • Added documentation on caching mechanisms in Titanrepo.
  • Explained task inputs, outputs, and troubleshooting caching issues.
  • Provided steps for enabling and using remote caching.
  • Included tips for optimizing caching and task execution.
  • +206/-0 
    constructing-ci.mdx
    Constructing Efficient CI Pipelines with Titanrepo             

    docs/repo-docs/crafting-your-repository/constructing-ci.mdx

  • Added a guide on constructing CI pipelines with Titanrepo.
  • Explained enabling remote caching and running tasks in CI.
  • Provided best practices for optimizing CI workflows.
  • Included troubleshooting tips for common CI issues.
  • +188/-0 
    github-actions.mdx
    Using GitHub Actions with Titanrepo: A Practical Guide     

    docs/repo-docs/guides/ci-vendors/github-actions.mdx

  • Introduced a guide for using GitHub Actions with Titanrepo.
  • Provided example workflows and steps for enabling remote caching.
  • Included instructions for caching with GitHub actions/cache.
  • Offered tips for optimizing CI with GitHub Actions.
  • +311/-0 
    running-tasks.mdx
    Running and Managing Tasks with Titan CLI                               

    docs/repo-docs/crafting-your-repository/running-tasks.mdx

  • Added documentation on running tasks with the Titan CLI.
  • Explained using scripts, global titan, and filters.
  • Provided examples for running multiple tasks and using filters.
  • Included tips for customizing task execution behavior.
  • +172/-0 
    docker.mdx
    Deploying Applications with Docker in a Monorepo                 

    docs/repo-docs/guides/tools/docker.mdx

  • Added a guide for using Docker in a monorepo with Titanrepo.
  • Explained challenges and solutions for Docker deployments.
  • Provided example Dockerfile and instructions for pruning.
  • Included tips for enabling remote caching in Docker builds.
  • +205/-0 
    publishing-libraries.mdx
    Publishing Libraries from a Monorepo with Titanrepo           

    docs/repo-docs/guides/publishing-libraries.mdx

  • Added a guide for publishing libraries from a monorepo.
  • Explained bundling, versioning, and publishing with Changesets.
  • Provided steps for setting up build scripts and dependencies.
  • Included tips for integrating publishing workflows with Titanrepo.
  • +176/-0 
    prisma.mdx
    Integrating Prisma with Titanrepo: A Comprehensive Guide 

    docs/repo-docs/guides/tools/prisma.mdx

  • Added a guide for integrating Prisma with Titanrepo.
  • Provided steps for setting up Prisma in a monorepo.
  • Explained creating scripts and exporting Prisma client.
  • Included tips for optimizing Prisma tasks and going to production.
  • +241/-0 
    add-to-existing-repository.mdx
    Integrating Titanrepo into Existing Repositories                 

    docs/repo-docs/getting-started/add-to-existing-repository.mdx

  • Added a guide for integrating Titanrepo into existing repositories.
  • Provided steps for setting up Titanrepo in single and multi-package
    workspaces.
  • Explained configuring tasks and running them with Titan CLI.
  • Included tips for optimizing workflows and enabling caching.
  • +245/-0 
    why-titanpack.mdx
    Why Titanpack: Exploring the Future of Web Bundling           

    docs/pack-docs/why-titanpack.mdx

  • Added an article explaining the rationale behind Titanpack.
  • Discussed unified graph, bundling vs native ESM, and incremental
    computation.
  • Explained lazy bundling and its benefits for development.
  • Provided a summary of Titanpack's advantages.
  • +53/-0   
    Dependencies
    1 files
    package-lock.json
    Introduce package-lock.json for dependency management       

    docs/package-lock.json

  • Added a new package-lock.json file with detailed dependency
    information.
  • Includes both dependencies and devDependencies with specific versions.
  • Lists various modules and their respective metadata such as version,
    integrity, and license.
  • +1748/-0
    Additional files (token-limit)
    84 files
    internal-packages.mdx
    ...                                                                                                           

    docs/repo-docs/core-concepts/internal-packages.mdx

    ...

    +137/-0 
    remote-caching.mdx
    ...                                                                                                           

    docs/repo-docs/core-concepts/remote-caching.mdx

    ...

    +193/-0 
    eslint.mdx
    ...                                                                                                           

    docs/repo-docs/guides/tools/eslint.mdx

    ...

    +236/-0 
    prune.mdx
    ...                                                                                                           

    docs/repo-docs/reference/prune.mdx

    ...

    +201/-0 
    developing-applications.mdx
    ...                                                                                                           

    docs/repo-docs/crafting-your-repository/developing-applications.mdx

    ...

    +160/-0 
    single-package-workspaces.mdx
    ...                                                                                                           

    docs/repo-docs/guides/single-package-workspaces.mdx

    ...

    +154/-0 
    circleci.mdx
    ...                                                                                                           

    docs/repo-docs/guides/ci-vendors/circleci.mdx

    ...

    +171/-0 
    installation.mdx
    ...                                                                                                           

    docs/repo-docs/getting-started/installation.mdx

    ...

    +154/-0 
    jest.mdx
    ...                                                                                                           

    docs/repo-docs/guides/tools/jest.mdx

    ...

    +185/-0 
    package-and-task-graph.mdx
    ...                                                                                                           

    docs/repo-docs/core-concepts/package-and-task-graph.mdx

    ...

    +117/-0 
    system-environment-variables.mdx
    ...                                                                                                           

    docs/repo-docs/reference/system-environment-variables.mdx

    ...

    +47/-0   
    upgrading.mdx
    ...                                                                                                           

    docs/repo-docs/crafting-your-repository/upgrading.mdx

    ...

    +118/-0 
    gitlab-ci.mdx
    ...                                                                                                           

    docs/repo-docs/guides/ci-vendors/gitlab-ci.mdx

    ...

    +131/-0 
    travis-ci.mdx
    ...                                                                                                           

    docs/repo-docs/guides/ci-vendors/travis-ci.mdx

    ...

    +127/-0 
    multi-language.mdx
    ...                                                                                                           

    docs/repo-docs/guides/multi-language.mdx

    ...

    +134/-0 
    skipping-tasks.mdx
    ...                                                                                                           

    docs/repo-docs/guides/skipping-tasks.mdx

    ...

    +72/-0   
    index.mdx
    ...                                                                                                           

    docs/repo-docs/reference/index.mdx

    ...

    +155/-0 
    vitest.mdx
    ...                                                                                                           

    docs/repo-docs/guides/tools/vitest.mdx

    ...

    +113/-0 
    community.mdx
    ...                                                                                                           

    docs/repo-docs/community.mdx

    ...

    +58/-0   
    index.mdx
    ...                                                                                                           

    docs/repo-docs/crafting-your-repository/index.mdx

    ...

    +87/-0   
    css.mdx
    ...                                                                                                           

    docs/pack-docs/features/css.mdx

    ...

    +91/-0   
    nuxt.mdx
    ...                                                                                                           

    docs/repo-docs/guides/frameworks/nuxt.mdx

    ...

    +120/-0 
    sveltekit.mdx
    ...                                                                                                           

    docs/repo-docs/guides/frameworks/sveltekit.mdx

    ...

    +120/-0 
    vite.mdx
    ...                                                                                                           

    docs/repo-docs/guides/frameworks/vite.mdx

    ...

    +120/-0 
    nextjs.mdx
    ...                                                                                                           

    docs/repo-docs/guides/frameworks/nextjs.mdx

    ...

    +120/-0 
    index.mdx
    ...                                                                                                           

    docs/repo-docs/index.mdx

    ...

    +42/-0   
    support-policy.mdx
    ...                                                                                                           

    docs/repo-docs/getting-started/support-policy.mdx

    ...

    +66/-0   
    handling-platforms.mdx
    ...                                                                                                           

    docs/repo-docs/guides/handling-platforms.mdx

    ...

    +79/-0   
    index.mdx
    ...                                                                                                           

    docs/pack-docs/index.mdx

    ...

    +80/-0   
    core-concepts.mdx
    ...                                                                                                           

    docs/pack-docs/core-concepts.mdx

    ...

    +42/-0   
    generate.mdx
    ...                                                                                                           

    docs/repo-docs/reference/generate.mdx

    ...

    +90/-0   
    telemetry.mdx
    ...                                                                                                           

    docs/repo-docs/telemetry.mdx

    ...

    +64/-0   
    biome.mdx
    ...                                                                                                           

    docs/repo-docs/guides/tools/biome.mdx

    ...

    +61/-0   
    acknowledgments.mdx
    ...                                                                                                           

    docs/repo-docs/acknowledgments.mdx

    ...

    +43/-0   
    profiling.mdx
    ...                                                                                                           

    docs/pack-docs/advanced/profiling.mdx

    ...

    +72/-0   
    create-turbo.mdx
    ...                                                                                                           

    docs/repo-docs/reference/create-turbo.mdx

    ...

    +80/-0   
    globs.mdx
    ...                                                                                                           

    docs/repo-docs/reference/globs.mdx

    ...

    +33/-0   
    roadmap.mdx
    ...                                                                                                           

    docs/pack-docs/roadmap.mdx

    ...

    +36/-0   
    index.mdx
    ...                                                                                                           

    docs/pack-docs/features/index.mdx

    ...

    +62/-0   
    watch.mdx
    ...                                                                                                           

    docs/repo-docs/reference/watch.mdx

    ...

    +41/-0   
    index.mdx
    ...                                                                                                           

    docs/repo-docs/getting-started/index.mdx

    ...

    +69/-0   
    frameworks.mdx
    ...                                                                                                           

    docs/pack-docs/features/frameworks.mdx

    ...

    +42/-0   
    editor-integration.mdx
    ...                                                                                                           

    docs/repo-docs/getting-started/editor-integration.mdx

    ...

    +48/-0   
    javascript.mdx
    ...                                                                                                           

    docs/pack-docs/features/javascript.mdx

    ...

    +41/-0   
    index.mdx
    ...                                                                                                           

    docs/repo-docs/guides/index.mdx

    ...

    +65/-0   
    missing-root-task-in-turbo-json.mdx
    ...                                                                                                           

    docs/repo-docs/messages/missing-root-task-in-turbo-json.mdx

    ...

    +50/-0   
    typescript.mdx
    ...                                                                                                           

    docs/pack-docs/features/typescript.mdx

    ...

    +44/-0   
    migrating-from-webpack.mdx
    ...                                                                                                           

    docs/pack-docs/migrating-from-webpack.mdx

    ...

    +31/-0   
    package-types.mdx
    ...                                                                                                           

    docs/repo-docs/core-concepts/package-types.mdx

    ...

    +27/-0   
    index.mdx
    ...                                                                                                           

    docs/repo-docs/guides/ci-vendors/index.mdx

    ...

    +42/-0   
    scan.mdx
    ...                                                                                                           

    docs/repo-docs/reference/scan.mdx

    ...

    +15/-0   
    turbo-ignore.mdx
    ...                                                                                                           

    docs/repo-docs/reference/turbo-ignore.mdx

    ...

    +23/-0   
    ls.mdx
    ...                                                                                                           

    docs/repo-docs/reference/ls.mdx

    ...

    +49/-0   
    eslint-config-turbo.mdx
    ...                                                                                                           

    docs/repo-docs/reference/eslint-config-turbo.mdx

    ...

    +46/-0   
    static-assets.mdx
    ...                                                                                                           

    docs/pack-docs/features/static-assets.mdx

    ...

    +40/-0   
    unnecessary-package-task-syntax.mdx
    ...                                                                                                           

    docs/repo-docs/messages/unnecessary-package-task-syntax.mdx

    ...

    +40/-0   
    imports.mdx
    ...                                                                                                           

    docs/pack-docs/features/imports.mdx

    ...

    +42/-0   
    index.mdx
    ...                                                                                                           

    docs/repo-docs/guides/tools/index.mdx

    ...

    +19/-0   
    invalid-env-prefix.mdx
    ...                                                                                                           

    docs/repo-docs/messages/invalid-env-prefix.mdx

    ...

    +30/-0   
    dev-server.mdx
    ...                                                                                                           

    docs/pack-docs/features/dev-server.mdx

    ...

    +20/-0   
    package-task-in-single-package-workspace.mdx
    ...                                                                                                           

    docs/repo-docs/messages/package-task-in-single-package-workspace.mdx

    ...

    +35/-0   
    index.mdx
    ...                                                                                                           

    docs/repo-docs/core-concepts/index.mdx

    ...

    +35/-0   
    login.mdx
    ...                                                                                                           

    docs/repo-docs/reference/login.mdx

    ...

    +34/-0   
    turbo-gen.mdx
    ...                                                                                                           

    docs/repo-docs/reference/turbo-gen.mdx

    ...

    +28/-0   
    telemetry.mdx
    ...                                                                                                           

    docs/repo-docs/reference/telemetry.mdx

    ...

    +40/-0   
    vercel.mdx
    ...                                                                                                           

    docs/repo-docs/guides/ci-vendors/vercel.mdx

    ...

    +12/-0   
    index.mdx
    ...                                                                                                           

    docs/repo-docs/guides/frameworks/index.mdx

    ...

    +22/-0   
    meta.json
    ...                                                                                                           

    docs/repo-docs/reference/meta.json

    ...

    +29/-0   
    bin.mdx
    ...                                                                                                           

    docs/repo-docs/reference/bin.mdx

    ...

    +10/-0   
    link.mdx
    ...                                                                                                           

    docs/repo-docs/reference/link.mdx

    ...

    +18/-0   
    meta.json
    ...                                                                                                           

    docs/repo-docs/crafting-your-repository/meta.json

    ...

    +15/-0   
    meta.json
    ...                                                                                                           

    docs/repo-docs/meta.json

    ...

    +13/-0   
    tsconfig.json
    ...                                                                                                           

    docs/tsconfig.json

    ...

    +13/-0   
    meta.json
    ...                                                                                                           

    docs/repo-docs/guides/meta.json

    ...

    +15/-0   
    benchmarks.mdx
    ...                                                                                                           

    docs/pack-docs/benchmarks.mdx

    ...

    +11/-0   
    README.MD
    ...                                                                                                           

    docs/README.MD

    ...

    +9/-0     
    meta.json
    ...                                                                                                           

    docs/pack-docs/meta.json

    ...

    +12/-0   
    meta.json
    ...                                                                                                           

    docs/pack-docs/features/meta.json

    ...

    +11/-0   
    meta.json
    ...                                                                                                           

    docs/repo-docs/core-concepts/meta.json

    ...

    +8/-0     
    logout.mdx
    ...                                                                                                           

    docs/repo-docs/reference/logout.mdx

    ...

    +6/-0     
    unlink.mdx
    ...                                                                                                           

    docs/repo-docs/reference/unlink.mdx

    ...

    +6/-0     
    meta.json
    ...                                                                                                           

    docs/repo-docs/guides/frameworks/meta.json

    ...

    +3/-0     
    meta.json
    ...                                                                                                           

    docs/repo-docs/guides/ci-vendors/meta.json

    ...

    +1/-0     
    meta.json
    ...                                                                                                           

    docs/repo-docs/guides/tools/meta.json

    ...

    +3/-0     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Summary by Sourcery

    Introduce extensive documentation for Titanrepo, covering core concepts, features, integration with frameworks and CI/CD platforms, and best practices for managing a monorepo. Enhance user guidance with detailed API references and practical guides for using popular tools and frameworks.

    New Features:

    • Introduce comprehensive documentation for various aspects of the project, including configuration, commands, packages, and integration with different tools and frameworks.

    Enhancements:

    • Add detailed guides for integrating popular frameworks like Next.js, Nuxt, SvelteKit, and Vite into a Titanrepo.
    • Provide extensive documentation on using Titanrepo with various CI/CD platforms such as GitHub Actions, CircleCI, GitLab CI, and Travis CI.
    • Include guides for handling multi-language support and managing dependencies in a monorepo setup.
    • Enhance documentation with best practices for developing applications, managing environment variables, and constructing CI pipelines.

    Documentation:

    • Add a comprehensive set of documentation files covering core concepts, features, and advanced topics related to Titanrepo.
    • Include detailed API references for commands like run, prune, generate, and others.
    • Provide guides for using Titanrepo with specific tools like ESLint, Jest, Vitest, and Biome.
    • Introduce a section on community involvement and acknowledgments for contributors and inspirations.

    Copy link

    sourcery-ai bot commented Oct 14, 2024

    Reviewer's Guide by Sourcery

    This pull request adds a large number of documentation files for a project called Titanrepo. The changes include new documentation pages covering various aspects of Titanrepo, such as installation, configuration, usage guides, API references, and core concepts. The PR also adds some documentation for a related project called Titanpack.

    User journey diagram for Titanrepo documentation navigation

    journey
      title User journey for navigating Titanrepo documentation
      section Accessing Documentation
        User: Go to Titanrepo documentation page
        User: Search for specific topic
      section Reading Documentation
        User: Read installation guide
        User: Read configuration guide
        User: Read usage guides
        User: Read API references
        User: Read core concepts
      section Applying Knowledge
        User: Implement Titanrepo in project
        User: Configure Titanrepo based on guides
        User: Use Titanrepo features as per documentation
    
    Loading

    File-Level Changes

    Change Details Files
    Added extensive documentation for Titanrepo
    • Created installation guide
    • Added configuration reference
    • Created usage guides for various features
    • Added API references for Titanrepo commands
    • Documented core concepts of Titanrepo
    • Created guides for integrating with various tools and CI systems
    • Added documentation for managing dependencies and packages
    docs/repo-docs/getting-started/installation.mdx
    docs/repo-docs/reference/configuration.mdx
    docs/repo-docs/crafting-your-repository/configuring-tasks.mdx
    docs/repo-docs/reference/run.mdx
    docs/repo-docs/core-concepts/package-and-task-graph.mdx
    docs/repo-docs/guides/ci-vendors/github-actions.mdx
    docs/repo-docs/crafting-your-repository/managing-dependencies.mdx
    Added documentation for Titanpack
    • Created overview of Titanpack features
    • Added documentation for Titanpack core concepts
    • Created guides for using Titanpack with various frameworks
    docs/pack-docs/index.mdx
    docs/pack-docs/core-concepts.mdx
    docs/pack-docs/features/frameworks.mdx
    Added community and acknowledgments documentation
    • Created community guide
    • Added acknowledgments page
    docs/repo-docs/community.mdx
    docs/repo-docs/acknowledgments.mdx

    Tips and commands

    Interacting with Sourcery

    • Trigger a new review: Comment @sourcery-ai review on the pull request.
    • Continue discussions: Reply directly to Sourcery's review comments.
    • Generate a GitHub issue from a review comment: Ask Sourcery to create an
      issue from a review comment by replying to it.
    • Generate a pull request title: Write @sourcery-ai anywhere in the pull
      request title to generate a title at any time.
    • Generate a pull request summary: Write @sourcery-ai summary anywhere in
      the pull request body to generate a PR summary at any time. You can also use
      this command to specify where the summary should be inserted.

    Customizing Your Experience

    Access your dashboard to:

    • Enable or disable review features such as the Sourcery-generated pull request
      summary, the reviewer's guide, and others.
    • Change the review language.
    • Add, remove or edit custom review instructions.
    • Adjust other review settings.

    Getting Help

    @codiumai-pr-agent-free codiumai-pr-agent-free bot added documentation Improvements or additions to documentation enhancement New feature or request dependencies Pull requests that update a dependency file Configuration changes Review effort [1-5]: 4 labels Oct 14, 2024
    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
    🧪 No relevant tests
    🔒 Security concerns

    Sensitive information exposure:
    The script is using environment variables like GITHUB_TOKEN (line 12 in docs/src/github.ts) which could potentially expose sensitive information if not properly secured. Ensure that these tokens are properly managed and not exposed in logs or error messages.

    ⚡ Recommended focus areas for review

    Error Handling
    The error handling in the prepareDocumentMapEntry function could be improved. It currently logs the error and returns an empty document, which might lead to silent failures.

    Performance Concern
    The getAllMdxFilePaths function uses a recursive approach, which might not be efficient for large directory structures. Consider using an iterative approach or a more efficient file system traversal method.

    Error Handling
    The error handling in the GitHub API interaction functions (e.g., findBotComment, updateComment, createComment) could be improved. They currently log the error and return undefined or an empty string, which might lead to unexpected behavior in the calling code.

    Copy link

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Best practice
    Clarify potential limitations or differences in behavior of the --graph option in various environments

    Add a note explaining that the --graph option may not be available or may behave
    differently in certain environments, such as CI/CD pipelines or systems without
    Graphviz installed.

    docs/repo-docs/reference/run.mdx [304-305]

     titan run build --graph
     titan run build test lint --graph=my-graph.svg
     
    +<Callout type="info">
    +  The `--graph` option may not be available or may behave differently in certain environments, such as CI/CD pipelines or systems without Graphviz installed.
    +</Callout>
    +
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: This suggestion is valuable as it addresses potential issues users might face with the --graph option in different environments, such as CI/CD pipelines. It enhances the documentation by preemptively informing users of these limitations.

    8
    Use a more specific version range for dependencies to ensure consistent builds

    Consider using a more specific version range for the @types/node dependency instead
    of ^22.1.0. This can help ensure consistent builds across different environments.

    docs/package-lock.json [20]

    -"@types/node": "^22.1.0",
    +"@types/node": "~22.1.0",
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: Using a more specific version range can help ensure consistent builds across different environments, which is a good practice for maintaining stability in dependencies.

    7
    Improve code readability by using more descriptive variable names

    Consider using a more descriptive variable name instead of c in the find method.
    This will improve code readability.

    docs/src/validate-docs-links.ts [31]

    -return comments.find((c) => c.body?.includes(COMMENT_TAG));
    +return comments.find((comment) => comment.body?.includes(COMMENT_TAG));
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: The suggestion to use a more descriptive variable name improves code readability by making the purpose of the variable clearer, which is a good coding practice.

    6
    Enhancement
    Remove unnecessary empty string literal to improve code cleanliness

    Consider removing the empty string literal {" "} at the beginning of the Callout
    content. It's unnecessary and can be safely removed without affecting the rendering.

    docs/repo-docs/guides/tools/create-turbo-callout.tsx [6-13]

     <Callout type="good-to-know">
    -  {" "}
       This guide assumes you&apos;re using{" "}
       <Link href="/repo/docs/getting-started/installation">
         create-titan
       </Link>{" "}
       or a repository with a similar structure.
     </Callout>
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion to remove the unnecessary empty string literal improves code cleanliness and readability without affecting functionality, making it a useful enhancement.

    7
    Enhance the documentation by providing examples of combining the --affected flag with other flags

    Consider adding a brief explanation or example of how to use the --affected flag in
    combination with other flags, such as --filter, to provide a more comprehensive
    understanding of its usage.

    docs/repo-docs/reference/run.mdx [40]

     titan run build lint test --affected
     
    +# Example combining --affected with --filter
    +titan run build --affected --filter=./apps/*
    +
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion provides a useful enhancement by illustrating how to combine the --affected flag with other flags, which can help users understand more complex use cases. It adds value to the documentation by offering practical examples.

    7
    Provide an example of combining wildcards and negation patterns in environment variable configuration

    Add a brief explanation or example of how to use wildcards and negation patterns
    together in the env configuration to provide a more comprehensive understanding of
    their combined usage.

    docs/repo-docs/reference/configuration.mdx [309-319]

     #### Examples
     
     | Pattern    | Description                                                                    |
     | ---------- | ------------------------------------------------------------------------------ |
     | `"*"`      | Matches every environment variable.                                            |
     | `"!*"`     | Excludes every environment variable.                                           |
     | `"FOO*"`   | Matches `FOO`, `FOOD`, `FOO_FIGHTERS`, etc.                                    |
     | `"FOO\*"`  | Resolves to `"FOO*"` and matches `FOO`, `FOOD`, and `FOO_FIGHTERS`.            |
     | `"FOO\\*"` | Matches a single environment variable named `FOO*`.                            |
     | `"!FOO*"`  | Excludes all environment variables that start with `FOO`.                      |
     | `"\!FOO"`  | Resolves to `"!FOO"`, and excludes a single environment variable named `!FOO`. |
     | `"\\!FOO"` | Matches a single environment variable named `!FOO`.                            |
     | `"FOO!"`   | Matches a single environment variable named `FOO!`.                            |
     
    +#### Combined Usage Example
    +
    +```json
    +{
    +  "tasks": {
    +    "build": {
    +      "env": ["MY_*", "!MY_IGNORED_*", "MY_IGNORED_EXCEPTION"]
    +    }
    +  }
    +}
    +```
    +
    +This example includes all environment variables starting with `MY_`, excludes those starting with `MY_IGNORED_`, but makes an exception to include `MY_IGNORED_EXCEPTION`.
    +
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion offers a practical example of using wildcards and negation patterns together, which can help users better understand and apply these configurations. It enhances the documentation by providing a more comprehensive understanding of the feature.

    7
    Upgrade dependencies to their latest stable versions for improved functionality and security

    Consider upgrading the typescript version to the latest stable release for potential
    bug fixes and performance improvements.

    docs/package-lock.json [23]

    -"typescript": "5.1.6"
    +"typescript": "5.2.2"
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: Upgrading to the latest stable version of TypeScript can provide bug fixes and performance improvements, although it may require testing to ensure compatibility.

    6
    Use template literals for string interpolation to improve code readability

    Consider using template literals for string interpolation instead of concatenation.
    This can make the code more readable and less error-prone.

    docs/src/github.ts [33]

    -setFailed("Error finding bot comment: " + error);
    +setFailed(`Error finding bot comment: ${error}`);
    • Apply this suggestion
    Suggestion importance[1-10]: 5

    Why: The suggestion to use template literals enhances code readability and reduces the likelihood of errors in string concatenation, although the improvement is minor.

    5

    💡 Need additional feedback ? start a PR chat

    Copy link

    @sourcery-ai sourcery-ai bot left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Hey @FortiShield - I've reviewed your changes - here's some feedback:

    Overall Comments:

    • Consider breaking large documentation updates into smaller, more focused pull requests for easier review and management.
    • Think about separating Titanrepo and Titanpack documentation more clearly, possibly into different sections or PRs.
    • Develop a strategy for maintaining and updating this large set of documentation as the project evolves, possibly including automated checks to keep docs in sync with the codebase.
    Here's what I looked at during the review
    • 🟡 General issues: 5 issues found
    • 🟡 Security: 2 issues found
    • 🟢 Testing: all looks good
    • 🟡 Complexity: 1 issue found
    • 🟡 Documentation: 1 issue found

    Sourcery is free for open source - if you like our reviews please consider sharing them ✨
    Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

    @@ -0,0 +1,389 @@
    ---
    Copy link

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    suggestion (performance): Consider adding performance considerations for Storybook in monorepos

    While the Storybook guide is comprehensive, it would be beneficial to include a section on performance optimization when using Storybook in a monorepo context. Specifically, mention how to leverage Titanrepo's caching capabilities to speed up Storybook builds.

    ---
    title: Storybook
    description: Learn how to use Storybook in Titanrepo
    performance:
      - Leverage Titanrepo's caching for faster builds
      - Optimize for monorepo context
    ---
    

    @@ -0,0 +1,296 @@
    ---
    Copy link

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    🚨 suggestion (security): Include security considerations for environment variables in monorepos

    Add a section discussing security best practices when using environment variables in a monorepo context, especially when multiple teams are working on different packages. This could include tips on variable scoping and access control.

    @@ -0,0 +1,384 @@
    ---
    Copy link

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    suggestion (performance): Explain the efficiency of different glob patterns

    In the 'clean-globs' codemod section, consider adding a brief explanation of the algorithmic complexity and performance implications of different glob patterns. This information can be crucial for optimizing build times in large repositories.

    ---
    title: Profiling
    description: Learn how to profile Titanpack and optimize glob patterns
    performance:
      - Understand glob pattern efficiency
      - Optimize build times in large repositories
    ---
    


    Inputs are hashed by Titanrepo, creating a "fingerprint" for the task run. When "fingerprints" match, running the task will hit the cache.

    Under the hood, Titanrepo creates two hashes: a global hash and a task hash. If either of the hashes change, the task will miss cache.
    Copy link

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    suggestion: Explain the dual-hash approach in more detail

    It would be beneficial to elaborate on why both a global hash and a task hash are used. Explain the advantages of this approach and how it contributes to more efficient and accurate caching.

    Suggested change
    Under the hood, Titanrepo creates two hashes: a global hash and a task hash. If either of the hashes change, the task will miss cache.
    Under the hood, Titanrepo employs a dual-hash approach: a global hash and a task-specific hash. The global hash captures repository-wide changes, while the task hash focuses on task-specific inputs. This strategy ensures both broad and granular cache invalidation. If either hash changes, the task will miss the cache, providing a balance between cache efficiency and accuracy. This approach allows for precise cache hits when only task-specific elements change, while also ensuring cache invalidation for wider-reaching modifications.

    timeout-minutes: 15
    runs-on: ubuntu-latest
    # To use Remote Caching, uncomment the next lines and follow the steps below.
    # env:
    Copy link

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    🚨 suggestion (security): Add security best practices for environment variables

    Consider adding a section on security best practices for handling sensitive environment variables like TITAN_TOKEN. This could include using GitHub Secrets, rotating tokens regularly, and limiting token permissions.

    Suggested change
    # env:
    env:
    TITAN_TOKEN: ${{ secrets.TITAN_TOKEN }}
    TITAN_TEAM: ${{ secrets.TITAN_TEAM }}

    };

    // Main function that triggers link validation across .mdx files
    async function validateAllInternalLinks(): Promise<void> {
    Copy link

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    issue (complexity): Consider refactoring the validateAllInternalLinks function into smaller, focused functions.

    To reduce complexity while maintaining functionality, consider the following refactoring:

    1. Break down the validateAllInternalLinks function:
    async function validateAllInternalLinks(): Promise<void> {
      try {
        const allMdxFilePaths = await getAllMdxFilePaths([DOCS_PATH]);
        documentMap = await createDocumentMap(allMdxFilePaths);
        const allErrors = await processAllDocuments(allMdxFilePaths);
        await handleErrors(allErrors);
      } catch (error) {
        handleGlobalError("Error validating internal links", error);
      }
    }
    
    async function createDocumentMap(filePaths: string[]): Promise<Map<string, Document>> {
      return new Map(await Promise.all(filePaths.map(prepareDocumentMapEntry)));
    }
    
    async function processAllDocuments(filePaths: string[]): Promise<Errors[]> {
      return Promise.all(filePaths.map(processDocument));
    }
    
    async function processDocument(filePath: string): Promise<Errors> {
      const doc = documentMap.get(normalizePath(filePath));
      if (!doc) return createEmptyErrors();
      const tree = await parseDocument(doc.body);
      return traverseTreeAndValidateLinks(tree, doc);
    }
    1. Use async/await consistently to flatten promise chains:
    async function handleErrors(allErrors: Errors[]): Promise<void> {
      const { errorsExist, errorRows } = collectErrors(allErrors);
      if (errorsExist) {
        const errorComment = createErrorComment(errorRows);
        const commentUrl = await updateOrCreateComment(errorComment);
        logErrorsToConsole(allErrors);
        process.exit(1);
      } else {
        await removeExistingErrorComment();
      }
      await updateCheckStatus(errorsExist, commentUrl);
    }
    1. Centralize error handling:
    function handleGlobalError(message: string, error: unknown): void {
      setFailed(`${message}: ${error}`);
    }
    
    function handleProcessingError(context: string, error: unknown): void {
      console.error(`Error in ${context}:`, error);
      // Optionally, you can choose to continue processing or throw the error
    }

    These changes will make the code more modular, easier to read, and maintain while keeping all functionality intact. The use of smaller, focused functions improves testability and reduces cognitive load when reading the code.

    console.log("Skipping since this is not a pull request");
    process.exit(0);
    }
    export const sha = pullRequest.head.sha;
    Copy link

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    suggestion (code-quality): Prefer object destructuring when accessing and using properties. (use-object-destructuring)

    Suggested change
    export const sha = pullRequest.head.sha;
    export const {sha} = pullRequest.head;


    ExplanationObject destructuring can often remove an unnecessary temporary reference, as well as making your code more succinct.

    From the Airbnb Javascript Style Guide

    Comment on lines +121 to +126
    const normalized = filePath
    .replace("repo-docs", "/repo/docs")
    .replace("pack-docs", "/pack/docs")
    .replace(".mdx", "");

    return normalized;
    Copy link

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    suggestion (code-quality): Inline variable that is immediately returned (inline-immediately-returned-variable)

    Suggested change
    const normalized = filePath
    .replace("repo-docs", "/repo/docs")
    .replace("pack-docs", "/pack/docs")
    .replace(".mdx", "");
    return normalized;
    return filePath
    .replace("repo-docs", "/repo/docs")
    .replace("pack-docs", "/pack/docs")
    .replace(".mdx", "");


    ExplanationSomething that we often see in people's code is assigning to a result variable
    and then immediately returning it.

    Returning the result directly shortens the code and removes an unnecessary
    variable, reducing the mental load of reading the function.

    Where intermediate variables can be useful is if they then get used as a
    parameter or a condition, and the name can act like a comment on what the
    variable represents. In the case where you're returning it from a function, the
    function name is there to tell you what the result is, so the variable name
    is unnecessary.

    try {
    visit(tree, (node: any) => {
    if (node.type === "element" && node.tagName === "a") {
    const href = node.properties.href;
    Copy link

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    suggestion (code-quality): Prefer object destructuring when accessing and using properties. (use-object-destructuring)

    Suggested change
    const href = node.properties.href;
    const {href} = node.properties;


    ExplanationObject destructuring can often remove an unnecessary temporary reference, as well as making your code more succinct.

    From the Airbnb Javascript Style Guide

    if (node.type === "element" && node.tagName === "a") {
    const href = node.properties.href;

    if (!href) return;
    Copy link

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    suggestion (code-quality): Use block braces for ifs, whiles, etc. (use-braces)

    Suggested change
    if (!href) return;
    if (!href) {


    ExplanationIt is recommended to always use braces and create explicit statement blocks.

    Using the allowed syntax to just write a single statement can lead to very confusing
    situations, especially where subsequently a developer might add another statement
    while forgetting to add the braces (meaning that this wouldn't be included in the condition).

    Signed-off-by: fortishield <[email protected]>
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Configuration changes dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement New feature or request Review effort [1-5]: 4
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant