diff --git a/packages/domain-expansion/.changeset/README.md b/packages/domain-expansion/.changeset/README.md new file mode 100644 index 0000000..e5b6d8d --- /dev/null +++ b/packages/domain-expansion/.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/packages/domain-expansion/.changeset/config.json b/packages/domain-expansion/.changeset/config.json new file mode 100644 index 0000000..2da19d4 --- /dev/null +++ b/packages/domain-expansion/.changeset/config.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json", + "changelog": "@changesets/cli/changelog", + "commit": false, + "fixed": [], + "linked": [], + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [ + "@domain-expansion-test/*", + "docs" + ] +} diff --git a/packages/domain-expansion/.github/renovate.json b/packages/domain-expansion/.github/renovate.json new file mode 100644 index 0000000..6cc37d1 --- /dev/null +++ b/packages/domain-expansion/.github/renovate.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:recommended"], + "dependencyDashboard": true, + "lockFileMaintenance": { + "enabled": true + }, + "postUpdateOptions": ["pnpmDedupe"], + "packageRules": [ + { + "groupName": "all dependencies", + "groupSlug": "all", + "matchPackagePatterns": ["*"], + "schedule": ["before 4am on Monday"], + "rangeStrategy": "bump" + } + ], + "ignoreDeps": ["node"] +} diff --git a/packages/domain-expansion/.github/workflows/changesets.yml b/packages/domain-expansion/.github/workflows/changesets.yml new file mode 100644 index 0000000..dbde33a --- /dev/null +++ b/packages/domain-expansion/.github/workflows/changesets.yml @@ -0,0 +1,53 @@ +name: Surface PR Changesets + +on: pull_request + +permissions: + pull-requests: write + checks: write + statuses: write + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Get changed files in the .changeset folder + id: changed-files + uses: tj-actions/changed-files@v35 + with: + files: | + .changeset/**/*.md + + - name: Check if any changesets contain minor or major changes + id: check + run: | + echo "Checking for changesets marked as minor or major" + echo "found=false" >> $GITHUB_OUTPUT + + regex="[\"']astro[\"']: (minor|major)" + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do + if [[ $(cat $file) =~ $regex ]]; then + version="${BASH_REMATCH[1]}" + echo "version=$version" >> $GITHUB_OUTPUT + echo "found=true" >> $GITHUB_OUTPUT + echo "$file has a $version release tag" + fi + done + + - name: Add label + uses: actions/github-script@v6 + if: steps.check.outputs.found == 'true' + env: + issue_number: ${{ github.event.number }} + with: + script: | + github.rest.issues.addLabels({ + issue_number: process.env.issue_number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['semver: ${{ steps.check.outputs.version }}'] + }); diff --git a/packages/domain-expansion/.github/workflows/ci.yml b/packages/domain-expansion/.github/workflows/ci.yml new file mode 100644 index 0000000..ab92a6c --- /dev/null +++ b/packages/domain-expansion/.github/workflows/ci.yml @@ -0,0 +1,147 @@ +name: CI + +on: + workflow_dispatch: + push: + branches: + - main + merge_group: + pull_request: + paths-ignore: + - "**/*.md" + - ".github/ISSUE_TEMPLATE/**" + +# Automatically cancel older in-progress jobs on the same branch +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + +env: + FORCE_COLOR: true + ASTRO_TELEMETRY_DISABLED: true + # 7 GiB by default on GitHub, setting to 6 GiB + # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources + NODE_OPTIONS: --max-old-space-size=6144 + +jobs: + # Build primes out Turbo build cache and pnpm cache + build: + name: "Build - Node ${{ matrix.NODE_VERSION }}" + runs-on: ubuntu-latest + timeout-minutes: 3 + strategy: + matrix: + NODE_VERSION: [20, 22] + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PNPM + uses: pnpm/action-setup@v2 + + - name: Setup node@${{ matrix.NODE_VERSION }} + uses: actions/setup-node@main + with: + node-version: ${{ matrix.NODE_VERSION }} + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Build Packages + run: pnpm run package:build + + lint: + name: Lint + runs-on: ubuntu-latest + timeout-minutes: 5 + needs: build + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PNPM + uses: pnpm/action-setup@v2 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Format Check + run: pnpm run lint + + test: + name: "Test: Node ${{ matrix.NODE_VERSION }}" + runs-on: ubuntu-latest + timeout-minutes: 10 + needs: build + strategy: + matrix: + NODE_VERSION: [20, 22] + fail-fast: false + env: + NODE_VERSION: ${{ matrix.NODE_VERSION }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cache turbo build setup + uses: actions/cache@v4 + with: + path: .turbo + key: ${{ runner.os }}-${{ matrix.NODE_VERSION }}-turbo-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-${{ matrix.NODE_VERSION }}-turbo- + + - name: Setup PNPM + uses: pnpm/action-setup@v2 + + - name: Setup node@${{ matrix.NODE_VERSION }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.NODE_VERSION }} + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Build Packages + run: pnpm run package:build + + - name: Test + run: pnpm test + working-directory: package + + duplicated-packages: + name: Check for duplicated dependencies + runs-on: ubuntu-latest + env: + NODE_VERSION: 22 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PNPM + uses: pnpm/action-setup@v2 + + - name: Setup node@${{ matrix.NODE_VERSION }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.NODE_VERSION }} + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Check duplicated dependencies + run: pnpm dedupe --prefer-offline --check diff --git a/packages/domain-expansion/.github/workflows/preview-mode.yml b/packages/domain-expansion/.github/workflows/preview-mode.yml new file mode 100644 index 0000000..5d9b742 --- /dev/null +++ b/packages/domain-expansion/.github/workflows/preview-mode.yml @@ -0,0 +1,50 @@ +name: Preview mode + +on: + pull_request: + types: + - synchronize + - opened + - reopened + +env: + FORCE_COLOR: true + +jobs: + no-preview: + name: Block Preview mode + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + issues: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + + - name: Setup PNPM + uses: pnpm/action-setup@v2 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Check for preview mode + # Fails if in preview mode + run: pnpm changeset pre enter foo + + - name: Remove Preview Label + uses: actions-ecosystem/action-remove-labels@v1 + with: + labels: preview + + - name: Add Label + if: ${{ failure() }} + uses: actions-ecosystem/action-add-labels@v1 + with: + labels: preview diff --git a/packages/domain-expansion/.github/workflows/release.yml b/packages/domain-expansion/.github/workflows/release.yml new file mode 100644 index 0000000..fcbc9bf --- /dev/null +++ b/packages/domain-expansion/.github/workflows/release.yml @@ -0,0 +1,68 @@ +name: Release + +on: + push: + branches: + - main + pull_request: + types: + - opened + - reopened + - synchronize + - labeled + +defaults: + run: + shell: bash + +env: + FORCE_COLOR: true + +jobs: + changelog: + name: Changelog PR or Release + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'preview') }} + permissions: + contents: write + id-token: write + steps: + - uses: actions/checkout@v4 + + - name: Setup PNPM + uses: pnpm/action-setup@v2 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "pnpm" + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: pnpm install + + - name: Build Packages + run: pnpm run package:build + + - name: Publish preview + if: ${{ contains(github.event.pull_request.labels.*.name, 'preview') }} + run: pnpm exec changeset publish + env: + # Use Node auth from above + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Create Release Pull Request or Publish + id: changesets + if: ${{ github.event_name == 'push' }} + uses: changesets/action@v1 + with: + # Note: pnpm install after versioning is necessary to refresh lockfile + version: pnpm run version + publish: pnpm exec changeset publish + commit: '[ci] release' + title: '[ci] release' + env: + GITHUB_TOKEN: ${{ secrets.COMMIT_TOKEN }} + # Needs access to publish to npm + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/packages/domain-expansion/.github/workflows/todo-tracking.yml b/packages/domain-expansion/.github/workflows/todo-tracking.yml new file mode 100644 index 0000000..5feb5fe --- /dev/null +++ b/packages/domain-expansion/.github/workflows/todo-tracking.yml @@ -0,0 +1,25 @@ +name: TODO Tracking + +on: + push: + # branches: [main] + +permissions: + issues: read + repository-projects: read + contents: read + +jobs: + track-todos: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run tdg-github-action + uses: ribtoks/tdg-github-action@master + with: + TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + SHA: ${{ github.sha }} + REF: ${{ github.ref }} + DRY_RUN: false + COMMENT_ON_ISSUES: true diff --git a/packages/domain-expansion/.gitignore b/packages/domain-expansion/.gitignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/packages/domain-expansion/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/packages/domain-expansion/.husky/pre-commit b/packages/domain-expansion/.husky/pre-commit new file mode 100644 index 0000000..9c1cf54 --- /dev/null +++ b/packages/domain-expansion/.husky/pre-commit @@ -0,0 +1,3 @@ +#!/bin/sh + +node_modules/.bin/lint-staged diff --git a/packages/domain-expansion/.prettierignore b/packages/domain-expansion/.prettierignore new file mode 100644 index 0000000..f7fce49 --- /dev/null +++ b/packages/domain-expansion/.prettierignore @@ -0,0 +1,20 @@ +### Copied directly from Astro's monorepo at: +### https://github.com/withastro/astro/blob/24663c9695385fed9ece57bf4aecdca3a8581e70/.prettierignore + +# Deep Directories +**/dist +**/smoke +**/node_modules +**/fixtures +**/vendor +**/.vercel + +# Directories +.github +.changeset + +*.hbs + +# Files +pnpm-lock.yaml +flake.lock diff --git a/packages/domain-expansion/.vscode/settings.json b/packages/domain-expansion/.vscode/settings.json new file mode 100644 index 0000000..a91ae0b --- /dev/null +++ b/packages/domain-expansion/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "editor.defaultFormatter": "prettier", + "editor.gotoLocation.multipleDefinitions": "goto" +} diff --git a/packages/domain-expansion/CODE_OF_CONDUCT.md b/packages/domain-expansion/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..89e0491 --- /dev/null +++ b/packages/domain-expansion/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +- Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +- The use of sexualized language or imagery, and sexual attention or + advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email + address, without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +report@lferraz.com. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/packages/domain-expansion/Dockerfile b/packages/domain-expansion/Dockerfile new file mode 100644 index 0000000..425bff2 --- /dev/null +++ b/packages/domain-expansion/Dockerfile @@ -0,0 +1,31 @@ +FROM node:lts + +WORKDIR /app + +COPY package.json /app/package.json +COPY pnpm-lock.yaml /app/pnpm-lock.yaml +COPY pnpm-workspace.yaml /app/pnpm-workspace.yaml + +COPY ./patches /app/patches +COPY ./package /app/package +COPY ./docs /app/docs + +RUN corepack enable + +RUN pnpm install + +WORKDIR /app/package + +RUN pnpm build + +WORKDIR /app/docs + +RUN apt-get update && apt-get install -y --no-install-recommends \ + python3 make gcc g++ \ + && rm -rf /var/lib/apt/lists/* + +RUN pnpm build + +EXPOSE 4321:4321 + +CMD ["pnpm", "start"] \ No newline at end of file diff --git a/packages/domain-expansion/LICENSE b/packages/domain-expansion/LICENSE new file mode 100644 index 0000000..e8fd76d --- /dev/null +++ b/packages/domain-expansion/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 astro-expansion + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/domain-expansion/README.md b/packages/domain-expansion/README.md new file mode 100644 index 0000000..acb5e60 --- /dev/null +++ b/packages/domain-expansion/README.md @@ -0,0 +1,25 @@ +# DOMAIN :tm: EXPANSION :tm: + +Incremental :tm: build :tm: for :tm: Astro (not our :tm:). + +## The Tale of the three Mages™️ + +A long, long time ago, back when Astro didn't have incremental builds, two mages met atop of a mountain to discuss their next mad idea. + +"You ready to get started?", asked the first wizard. +"Sorry, I need to wait for a Netlify deployment to finish first. This documentation takes ages to build.", replied the other. +"It sure would be nice if there was a way to speed that up. Incremental builds or something.", the first mage said. + +It was at that moment that he realized: he knew a guy. The great mage, spoken about in the myths and ancient legends, a master of the arcane knowledge. +They called the great mage and begun discussing. The ancient stone tablets reveal some of the knowledge, although most of it looks like madness scribbled on an excalidraw board to those who cannot comprehend the arcane: + + + +Legend has it that, at 12:30am, the mages begun conjuring their greatest spell so far. Many had told them that whatever they were trying to do, they would fail, and that it would be too difficult to conjure, the toll much too great. Nonetheless, the mages pushed forward. After hours of blood, sweat and tears (of laughter™️), their conjured masterpiece laid before them. They decided to name it... +**Domain™️ Expansion™️.** + +## Licensing + +[MIT Licensed](./LICENSE). Made with ❤️ :tm: and :joy: by [the :tm: Domain :tm: Expansion :tm: members :tm:](https://github.com/orgs/astro-expansion/people). + + diff --git a/packages/domain-expansion/benchmarks/.gitignore b/packages/domain-expansion/benchmarks/.gitignore new file mode 100644 index 0000000..d719488 --- /dev/null +++ b/packages/domain-expansion/benchmarks/.gitignore @@ -0,0 +1,2 @@ +*/ +!.results/ \ No newline at end of file diff --git a/packages/domain-expansion/benchmarks/.results/astro-docs.md b/packages/domain-expansion/benchmarks/.results/astro-docs.md new file mode 100644 index 0000000..3fcc497 --- /dev/null +++ b/packages/domain-expansion/benchmarks/.results/astro-docs.md @@ -0,0 +1,5 @@ +| Command | Mean [s] | Min [s] | Max [s] | Relative | +| :------------------------------------------- | ---------------: | ------: | ------: | ----------: | +| `[Astro Docs] Normal Build` | 263.283 ± 13.774 | 251.574 | 278.459 | 1.84 ± 0.11 | +| `[Astro Docs] Domain Expansion (cold build)` | 272.885 ± 15.867 | 256.185 | 287.762 | 1.91 ± 0.12 | +| `[Astro Docs] Domain Expansion (hot build)` | 143.194 ± 4.299 | 139.882 | 148.052 | 1.00 | diff --git a/packages/domain-expansion/benchmarks/.results/astro.build.md b/packages/domain-expansion/benchmarks/.results/astro.build.md new file mode 100644 index 0000000..7fd2364 --- /dev/null +++ b/packages/domain-expansion/benchmarks/.results/astro.build.md @@ -0,0 +1,5 @@ +| Command | Mean [s] | Min [s] | Max [s] | Relative | +| :-------------------------------------------- | -------------: | ------: | ------: | ----------: | +| `[astro.build] Normal Build` | 30.852 ± 3.303 | 27.322 | 37.362 | 1.01 ± 0.12 | +| `[astro.build] Domain Expansion (cold build)` | 31.298 ± 2.398 | 26.875 | 34.678 | 1.02 ± 0.09 | +| `[astro.build] Domain Expansion (hot build)` | 30.660 ± 1.442 | 28.201 | 33.215 | 1.00 | diff --git a/packages/domain-expansion/benchmarks/.results/brutal.md b/packages/domain-expansion/benchmarks/.results/brutal.md new file mode 100644 index 0000000..2222245 --- /dev/null +++ b/packages/domain-expansion/benchmarks/.results/brutal.md @@ -0,0 +1,5 @@ +| Command | Mean [s] | Min [s] | Max [s] | Relative | +| :--------------------------------------------- | ------------: | ------: | ------: | ----------: | +| `[Brutal Theme] Normal Build` | 4.491 ± 0.312 | 3.972 | 5.214 | 1.00 | +| `[Brutal Theme] Domain Expansion (cold build)` | 4.638 ± 0.298 | 4.402 | 5.188 | 1.03 ± 0.10 | +| `[Brutal Theme] Domain Expansion (hot build)` | 4.492 ± 0.266 | 4.122 | 5.059 | 1.00 ± 0.09 | diff --git a/packages/domain-expansion/benchmarks/.results/starlight.md b/packages/domain-expansion/benchmarks/.results/starlight.md new file mode 100644 index 0000000..cda6aa6 --- /dev/null +++ b/packages/domain-expansion/benchmarks/.results/starlight.md @@ -0,0 +1,5 @@ +| Command | Mean [s] | Min [s] | Max [s] | Relative | +| :----------------------------------------------- | -------------: | ------: | ------: | ----------: | +| `[Starlight Docs] Normal Build` | 34.021 ± 2.990 | 30.565 | 39.803 | 1.14 ± 0.15 | +| `[Starlight Docs] Domain Expansion (cold build)` | 35.049 ± 1.906 | 32.662 | 37.278 | 1.18 ± 0.14 | +| `[Starlight Docs] Domain Expansion (hot build)` | 29.722 ± 3.016 | 26.496 | 34.582 | 1.00 | diff --git a/packages/domain-expansion/benchmarks/.results/studiocms-ui.md b/packages/domain-expansion/benchmarks/.results/studiocms-ui.md new file mode 100644 index 0000000..3edc6f7 --- /dev/null +++ b/packages/domain-expansion/benchmarks/.results/studiocms-ui.md @@ -0,0 +1,5 @@ +| Command | Mean [s] | Min [s] | Max [s] | Relative | +| :-------------------------------------------------- | -------------: | ------: | ------: | ----------: | +| `[StudioCMS UI Docs] Normal Build` | 10.523 ± 0.455 | 9.856 | 11.113 | 1.07 ± 0.07 | +| `[StudioCMS UI Docs] Domain Expansion (cold build)` | 10.721 ± 0.472 | 10.239 | 11.412 | 1.09 ± 0.07 | +| `[StudioCMS UI Docs] Domain Expansion (hot build)` | 9.826 ± 0.462 | 9.315 | 10.489 | 1.00 | diff --git a/packages/domain-expansion/benchmarks/.results/zen-browser.md b/packages/domain-expansion/benchmarks/.results/zen-browser.md new file mode 100644 index 0000000..43ba2cf --- /dev/null +++ b/packages/domain-expansion/benchmarks/.results/zen-browser.md @@ -0,0 +1,5 @@ +| Command | Mean [s] | Min [s] | Max [s] | Relative | +| :---------------------------------------------------- | -------------: | ------: | ------: | ----------: | +| `[Zen Browser Website] Normal Build` | 14.983 ± 0.631 | 14.132 | 15.977 | 1.00 | +| `[Zen Browser Website] Domain Expansion (cold build)` | 17.880 ± 0.603 | 16.973 | 18.934 | 1.19 ± 0.06 | +| `[Zen Browser Website] Domain Expansion (hot build)` | 17.490 ± 0.469 | 16.870 | 18.533 | 1.17 ± 0.06 | diff --git a/packages/domain-expansion/benchmarks/README.md b/packages/domain-expansion/benchmarks/README.md new file mode 100644 index 0000000..ce0e65d --- /dev/null +++ b/packages/domain-expansion/benchmarks/README.md @@ -0,0 +1,47 @@ +# Benchmarks + +A benchmark using [`hyperfine`](https://github.com/sharkdp/hyperfine?tab=readme-ov-file). Used for the data we display on [domainexpansion.gg](https://domainexpansion.gg). + +## About the results + +The current results you find in `.results/` were created on Dec. 26, 2024 on a desktop PC with the following specs: + +``` +CPU: AMD Ryzen 9 5950X (32) @ 5,05 GHz +RAM: 32GB DDR4 3200MHz +(Storage: PCIE Gen.4 NVME SSD) +``` + +## Getting Started + +First, install [`hyperfine`](https://github.com/sharkdp/hyperfine?tab=readme-ov-file). You can find instructions in their README file. To run this benchmark, you also need to have `git` and Python installed. + +Once installed, run the `bench.sh` script in this directory. + +### Running specific benchmarks + +You can run the script with the `--exclude=...` flag to exclude certain benchmarks. The following values are valid to pass in: + +- `astro-docs` +- `starlight` +- `astro.build` +- `studiocms-ui` +- `brutal` +- `zen-browser` + +For example, using `./bench.sh --exlude=astro-docs,astro.build` would exclude the two longest benchmarks! + +## What we benchmark + +We chose 6 open-source Astro projects of varying sizes: + +1. [astro.build](https://astro.build), the official Astro website +2. [docs.astro.build](https://docs.astro.build), the Astro docs and probably the biggest Astro-powered repository out there due to its translations +3. [starlight.astro.build](https://starlight.astro.build), the documentation for Starlight to represent mid-scale documentation projects +4. [ui.studiocms.dev](https://ui.studiocms.dev), a small documentation with a lot of MDX components +5. [zen-browser.app](https://zen-browser.app), a small landing page +6. [brutal.elian.codes](https://brutal.elian.codes), a popular Astro theme and rather small project compared to the rest + +## How we benchmark + +First, all repositories are cloned. Afterwards, we go into the directory and run `astro build` once to populate the asset cache. Afterwards, we run `astro build` 10 times, which is `hyperfine`'s default. Once that is done, we add the `@domain-expansion/astro` integration and run `astro build` another 10 times, each time making sure we remove the cache that is created. Last but certainly not least, we run `astro build` without removing the cache first, yet another 10 times. After all benchmarks have concluded, we move on to the next repository. diff --git a/packages/domain-expansion/benchmarks/bench.sh b/packages/domain-expansion/benchmarks/bench.sh new file mode 100644 index 0000000..9dd5ab1 --- /dev/null +++ b/packages/domain-expansion/benchmarks/bench.sh @@ -0,0 +1,331 @@ +#! /usr/bin/bash + +############################### +# Setup +############################### + +EXCLUED_BENCHMARKS="" + +while [[ $# -gt 0 ]]; do + case $1 in + --exclude=*) + excluded_list="${1#*=}" # Extract the value after '=' + shift + ;; + *) + echo "Unknown argument: $1" + exit 1 + ;; + esac +done + +IFS=',' read -ra excluded_array <<< "$excluded_list" + +is_excluded() { + local item=$1 + for excluded in "${excluded_array[@]}"; do + if [[ $excluded == "$item" ]]; then + return 0 # Item is in the list + fi + done + return 1 # Item is not in the list +} + +# Create .results dir if it doesn't exits already +if [ ! -d ".results" ]; then + mkdir .results +fi + +ROOT=$PWD + +# Colors +NO_FORMAT="\033[0m" +F_BOLD="\033[1m" +C_MEDIUMPURPLE1="\033[38;5;141m" +C_MEDIUMSPRINGGREEN="\033[38;5;49m" +C_RED="\033[38;5;9m" +F_UNDERLINED="\033[4m" +C_STEELBLUE1="\033[38;5;75m" + +echo -e "${F_BOLD}${C_MEDIUMPURPLE1}\n[Benchmark Setup]${NO_FORMAT}" + +temp_dir=$(mktemp -d) + +if [ ! -d "$temp_dir" ]; then + echo -e "\n${C_RED}[ERROR]${NO_FORMAT} Failed to create temp directory! Aborting...\n" + exit 1 +fi + +echo -e " ${F_BOLD}New temporary diretory created at:\n ${C_STEELBLUE1}$temp_dir${NO_FORMAT}\n" +echo -e " ${F_BOLD}Cloning benchmark repositories...${NO_FORMAT}" + +cd "$temp_dir" + +if ! is_excluded "astro-docs"; then + { + git clone --depth 1 https://github.com/withastro/docs &> /dev/null + echo -e " Cloned ${C_STEELBLUE1}withastro/docs${NO_FORMAT}!" + } & +fi + +if ! is_excluded "zen-browser"; then + { + git clone --depth 1 https://github.com/zen-browser/www zen-browser &> /dev/null + echo -e " Cloned ${C_STEELBLUE1}zen-browser/www${NO_FORMAT}!" + } & +fi + +if ! is_excluded "studiocms-ui"; then + { + git clone --depth 1 https://github.com/withstudiocms/ui &> /dev/null + echo -e " Cloned ${C_STEELBLUE1}withstudiocms/ui${NO_FORMAT}!" + } & +fi + +if ! is_excluded "brutal"; then + { + git clone --depth 1 https://github.com/eliancodes/brutal &> /dev/null + echo -e " Cloned ${C_STEELBLUE1}eliancodes/brutal${NO_FORMAT}!" + } & +fi + +if ! is_excluded "starlight"; then + { + git clone --depth 1 https://github.com/withastro/starlight &> /dev/null + echo -e " Cloned ${C_STEELBLUE1}withastro/starlight${NO_FORMAT}!" + } & +fi + +if ! is_excluded "astro.build"; then + { + git clone --depth 1 https://github.com/withastro/astro.build &> /dev/null + echo -e " Cloned ${C_STEELBLUE1}withastro/astro.build${NO_FORMAT}!" + } & +fi + +wait + +############################### +# zen-browser/www +############################### + +if ! is_excluded "zen-browser"; then + cd "$temp_dir/zen-browser" + + echo -e "\n${F_BOLD}Running Setup for ${C_STEELBLUE1}zen-browser/www${NO_FORMAT}${F_BOLD}...${NO_FORMAT}" + + echo -e " Running ${C_STEELBLUE1}pnpm install${NO_FORMAT}..." + yes | pnpm install &> /dev/null + echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}" + + echo -e " Running ${C_STEELBLUE1}pnpm build${NO_FORMAT} (to warm up)..." + pnpm build &> /dev/null + echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n" + + hyperfine \ + --export-markdown "$ROOT/.results/zen-browser.md" \ + --prepare '' \ + -n '[Zen Browser Website] Normal Build' \ + 'pnpm build' \ + --prepare 'pnpm astro add @domain-expansion/astro -y && rm -rf ./node_modules/.domain-expansion' \ + -n '[Zen Browser Website] Domain Expansion (cold build)' \ + 'pnpm build' \ + --prepare '' \ + -n '[Zen Browser Website] Domain Expansion (hot build)' \ + 'pnpm build' +fi + +############################### +# withstudiocms/ui +############################### + +if ! is_excluded "studiocms-ui"; then + cd "$temp_dir/ui/docs" + + echo -e "\n${F_BOLD}Running Setup for ${C_STEELBLUE1}withstudiocms/ui${NO_FORMAT}${F_BOLD}...${NO_FORMAT}" + + echo -e " Running ${C_STEELBLUE1}pnpm install${NO_FORMAT}..." + yes | pnpm install &> /dev/null + echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}" + + echo -e " Running ${C_STEELBLUE1}pnpm build${NO_FORMAT} (to warm up)..." + pnpm build &> /dev/null + echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n" + + hyperfine \ + --export-markdown "$ROOT/.results/studiocms-ui.md" \ + --prepare '' \ + -n '[StudioCMS UI Docs] Normal Build' \ + 'pnpm astro build' \ + --prepare 'pnpm astro add @domain-expansion/astro -y && rm -rf ./node_modules/.domain-expansion' \ + -n '[StudioCMS UI Docs] Domain Expansion (cold build)' \ + 'pnpm astro build' \ + --prepare '' \ + -n '[StudioCMS UI Docs] Domain Expansion (hot build)' \ + 'pnpm astro build' +fi + +############################### +# eliancodes/brutal +############################### + +if ! is_excluded "brutal"; then + cd "$temp_dir/brutal" + + echo -e "\n${F_BOLD}Running Setup for ${C_STEELBLUE1}eliancodes/brutal${NO_FORMAT}${F_BOLD}...${NO_FORMAT}" + + echo -e " Running ${C_STEELBLUE1}pnpm install${NO_FORMAT}..." + yes | pnpm install &> /dev/null + echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}" + + echo -e " Running ${C_STEELBLUE1}pnpm build${NO_FORMAT} (to warm up)..." + pnpm build &> /dev/null + echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n" + + hyperfine \ + --export-markdown "$ROOT/.results/brutal.md" \ + -n '[Brutal Theme] Normal Build' \ + --prepare '' \ + 'pnpm build' \ + --prepare 'pnpm astro add @domain-expansion/astro -y && rm -rf ./node_modules/.domain-expansion' \ + -n '[Brutal Theme] Domain Expansion (cold build)' \ + 'pnpm build' \ + --prepare '' \ + -n '[Brutal Theme] Domain Expansion (hot build)' \ + 'pnpm build' +fi + +############################### +# withastro/starlight +############################### + +if ! is_excluded "starlight"; then + cd "$temp_dir/starlight/docs" + + echo -e "\n${F_BOLD}Running Setup for ${C_STEELBLUE1}withastro/starlight${NO_FORMAT}${F_BOLD}...${NO_FORMAT}" + + echo -e " Running ${C_STEELBLUE1}pnpm install${NO_FORMAT}..." + yes | pnpm install &> /dev/null + echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}" + + echo -e " Running ${C_STEELBLUE1}pnpm build${NO_FORMAT} (to warm up)..." + pnpm build &> /dev/null + echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n" + + hyperfine \ + --export-markdown "$ROOT/.results/starlight.md" \ + --prepare '' \ + -n '[Starlight Docs] Normal Build' \ + 'pnpm build' \ + --prepare 'pnpm astro add @domain-expansion/astro -y && rm -rf ./node_modules/.domain-expansion' \ + -n '[Starlight Docs] Domain Expansion (cold build)' \ + 'pnpm build' \ + --prepare '' \ + -n '[Starlight Docs] Domain Expansion (hot build)' \ + 'pnpm build' +fi + +############################### +# withastro/astro.build +############################### + +if ! is_excluded "astro.build"; then + cd "$temp_dir/astro.build" + + echo -e "\n${F_BOLD}Running Setup for ${C_STEELBLUE1}withastro/astro.build${NO_FORMAT}${F_BOLD}...${NO_FORMAT}" + + echo -e " Running ${C_STEELBLUE1}pnpm install${NO_FORMAT}..." + pnpm install &> /dev/null + echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}" + + echo -e " Running ${C_STEELBLUE1}pnpm astro build${NO_FORMAT} (to warm up)..." + pnpm astro build &> /dev/null + echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n" + + hyperfine \ + --export-markdown "$ROOT/.results/astro.build.md" \ + --prepare '' \ + -n '[astro.build] Normal Build' \ + 'pnpm astro build' \ + --prepare 'npx astro add @domain-expansion/astro && rm -rf ./node_modules/.domain-expansion' \ + -n '[astro.build] Domain Expansion (cold build)' \ + 'pnpm astro build' \ + --prepare '' \ + -n '[astro.build] Domain Expansion (hot build)' \ + 'pnpm astro build' +fi + +############################### +# withastro/docs +############################### + +if ! is_excluded "astro-docs"; then + cd "$temp_dir/docs" + + echo -e "\n${F_BOLD}Running Setup for ${C_STEELBLUE1}withastro/docs${NO_FORMAT}${F_BOLD}...${NO_FORMAT}" + + export NODE_OPTIONS=--max-old-space-size=12192 SKIP_OG=true; + + echo -e " Running ${C_STEELBLUE1}pnpm install${NO_FORMAT}..." + yes | pnpm install &> /dev/null + echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}" + + echo -e " Running ${C_STEELBLUE1}pnpm build${NO_FORMAT} (to warm up)..." + pnpm build &> /dev/null + echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n" + + hyperfine \ + --export-markdown "$ROOT/.results/astro-docs.md" \ + --runs 3 \ + --prepare '' \ + -n '[Astro Docs] Normal Build' \ + 'pnpm build' \ + --prepare 'pnpm astro add @domain-expansion/astro -y && rm -rf ./node_modules/.domain-expansion' \ + -n '[Astro Docs] Domain Expansion (cold build)' \ + 'pnpm build' \ + --prepare '' \ + -n '[Astro Docs] Domain Expansion (hot build)' \ + 'pnpm build' +fi + +############################### +# Cleanup +############################### + +cd "$temp_dir" + +# Calculate all folder sizes and print + +echo -e "\n${F_BOLD}${C_MEDIUMPURPLE1}[Cache Size Summary]${NO_FORMAT}" + +if ! is_excluded "zen-browser"; then + echo -e "${F_BOLD}${C_STEELBLUE1}zen-browser/www${NO_FORMAT}: $(du -sh zen-browser/node_modules/.domain-expansion | cut -f1)" +fi + +if ! is_excluded "studiocms-ui"; then + echo -e "${F_BOLD}${C_STEELBLUE1}withstudiocms/ui${NO_FORMAT}: $(du -sh ui/docs/node_modules/.domain-expansion | cut -f1)" +fi + +if ! is_excluded "brutal"; then + echo -e "${F_BOLD}${C_STEELBLUE1}eliancodes/brutal${NO_FORMAT}: $(du -sh brutal/node_modules/.domain-expansion | cut -f1)" +fi + +if ! is_excluded "starlight"; then + echo -e "${F_BOLD}${C_STEELBLUE1}withastro/starlight${NO_FORMAT}: $(du -sh starlight/docs/node_modules/.domain-expansion | cut -f1)" +fi + +if ! is_excluded "astro.build"; then + echo -e "${F_BOLD}${C_STEELBLUE1}withastro/astro.build${NO_FORMAT}: $(du -sh 'astro.build/node_modules/.domain-expansion' | cut -f1)" +fi + +if ! is_excluded "astro-docs"; then + echo -e "${F_BOLD}${C_STEELBLUE1}withastro/docs${NO_FORMAT}: $(du -sh docs/node_modules/.domain-expansion | cut -f1)" +fi + +cd "$ROOT" + +rm -rf "$temp_dir" + +echo "" +echo "$temp_dir deleted" +echo "" \ No newline at end of file diff --git a/packages/domain-expansion/docs/.gitignore b/packages/domain-expansion/docs/.gitignore new file mode 100644 index 0000000..6240da8 --- /dev/null +++ b/packages/domain-expansion/docs/.gitignore @@ -0,0 +1,21 @@ +# build output +dist/ +# generated types +.astro/ + +# dependencies +node_modules/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store diff --git a/packages/domain-expansion/docs/.vscode/extensions.json b/packages/domain-expansion/docs/.vscode/extensions.json new file mode 100644 index 0000000..22a1505 --- /dev/null +++ b/packages/domain-expansion/docs/.vscode/extensions.json @@ -0,0 +1,4 @@ +{ + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] +} diff --git a/packages/domain-expansion/docs/.vscode/launch.json b/packages/domain-expansion/docs/.vscode/launch.json new file mode 100644 index 0000000..d642209 --- /dev/null +++ b/packages/domain-expansion/docs/.vscode/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] +} diff --git a/packages/domain-expansion/docs/CHANGELOG.md b/packages/domain-expansion/docs/CHANGELOG.md new file mode 100644 index 0000000..baaf3ed --- /dev/null +++ b/packages/domain-expansion/docs/CHANGELOG.md @@ -0,0 +1,59 @@ +# docs + +## 0.0.1-beta.6 + +### Patch Changes + +- Updated dependencies [cf9e4ea] + - @domain-expansion/astro@0.1.0-beta.7 + +## 0.0.1-beta.5 + +### Patch Changes + +- Updated dependencies [8684bcb] + - @domain-expansion/astro@0.1.0-beta.6 + +## 0.0.1-beta.4 + +### Patch Changes + +- Updated dependencies [4309f3e] + - @domain-expansion/astro@0.1.0-beta.5 + +## 0.0.1-beta.3 + +### Patch Changes + +- Updated dependencies [1278f19] + - @domain-expansion/astro@0.1.0-beta.4 + +## 0.0.1-beta.2 + +### Patch Changes + +- Updated dependencies +- Updated dependencies [641dfce] +- Updated dependencies [7f93ad2] + - @domain-expansion/astro@0.1.0-beta.3 + +## 0.0.1-beta.1 + +### Patch Changes + +- Updated dependencies + - @domain-expansion/astro@0.1.0-beta.2 + +## 0.0.1-beta.0 + +### Patch Changes + +- Updated dependencies [095445d] + - @domain-expansion/astro@0.1.0-beta.1 + +## 0.0.2-beta.0 + +### Patch Changes + +- Updated dependencies [76702d0] + - @domain-expansion/astro@0.1.0-beta.0 diff --git a/packages/domain-expansion/docs/README.md b/packages/domain-expansion/docs/README.md new file mode 100644 index 0000000..f9f6d31 --- /dev/null +++ b/packages/domain-expansion/docs/README.md @@ -0,0 +1,54 @@ +# Starlight Starter Kit: Basics + +[](https://starlight.astro.build) + +``` +npm create astro@latest -- --template starlight +``` + +[](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics) +[](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics) +[](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/basics) +[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fbasics&project-name=my-starlight-docs&repository-name=my-starlight-docs) + +> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun! + +## 🚀 Project Structure + +Inside of your Astro + Starlight project, you'll see the following folders and files: + +``` +. +├── public/ +├── src/ +│ ├── assets/ +│ ├── content/ +│ │ ├── docs/ +│ └── content.config.ts +├── astro.config.mjs +├── package.json +└── tsconfig.json +``` + +Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name. + +Images can be added to `src/assets/` and embedded in Markdown with a relative link. + +Static assets, like favicons, can be placed in the `public/` directory. + +## 🧞 Commands + +All commands are run from the root of the project, from a terminal: + +| Command | Action | +| :------------------------ | :----------------------------------------------- | +| `npm install` | Installs dependencies | +| `npm run dev` | Starts local dev server at `localhost:4321` | +| `npm run build` | Build your production site to `./dist/` | +| `npm run preview` | Preview your build locally, before deploying | +| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | +| `npm run astro -- --help` | Get help using the Astro CLI | + +## 👀 Want to learn more? + +Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat). diff --git a/packages/domain-expansion/docs/astro.config.ts b/packages/domain-expansion/docs/astro.config.ts new file mode 100644 index 0000000..cab3fcc --- /dev/null +++ b/packages/domain-expansion/docs/astro.config.ts @@ -0,0 +1,52 @@ +// @ts-check +import { defineConfig } from 'astro/config'; +import starlight from '@astrojs/starlight'; +import catppuccin from 'starlight-theme-catppuccin'; +import domainExpansion from '@domain-expansion/astro'; + +import node from '@astrojs/node'; +import starlightImageZoomPlugin from 'starlight-image-zoom'; + +import react from '@astrojs/react'; + +import tailwind from '@astrojs/tailwind'; + +// https://astro.build/config +export default defineConfig({ + site: 'https://domainexpansion.gg', + server: { + host: '0.0.0.0', + }, + integrations: [ + domainExpansion(), + starlight({ + title: 'Domain Expansion', + social: { + github: 'https://github.com/astro-expansion/domain-expansion', + }, + sidebar: [ + { label: 'Installation', slug: '' }, + { label: 'Configuration', slug: 'configuration' }, + { label: 'Deploying', slug: 'deploying' }, + { label: 'The Tale of the Three Mages', slug: 'the-tale-of-the-three-mages' }, + { label: 'An actual explanation of what is going on here', slug: 'actual-explanation' }, + { label: 'Caveats', slug: 'caveats' }, + { label: 'El funny', slug: 'memes' }, + ], + plugins: [ + catppuccin({ dark: 'mocha-teal', light: 'latte-teal' }), + starlightImageZoomPlugin(), + ], + components: { + Head: './src/overrides/Head.astro', + }, + customCss: ['src/styles/globals.css'], + }), + react(), + tailwind({ applyBaseStyles: false }), + ], + + adapter: node({ + mode: 'standalone', + }), +}); diff --git a/packages/domain-expansion/docs/components.json b/packages/domain-expansion/docs/components.json new file mode 100644 index 0000000..3154a3d --- /dev/null +++ b/packages/domain-expansion/docs/components.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": false, + "tsx": true, + "tailwind": { + "config": "tailwind.config.js", + "css": "src/styles/globals.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "iconLibrary": "lucide" +} diff --git a/packages/domain-expansion/docs/package.json b/packages/domain-expansion/docs/package.json new file mode 100644 index 0000000..87510f2 --- /dev/null +++ b/packages/domain-expansion/docs/package.json @@ -0,0 +1,37 @@ +{ + "name": "docs", + "type": "module", + "private": true, + "version": "0.0.1-beta.6", + "scripts": { + "dev": "astro dev", + "start": "node ./dist/server/entry.mjs", + "build": "astro build", + "preview": "astro preview", + "astro": "astro" + }, + "dependencies": { + "@astrojs/node": "^9.0.0", + "@astrojs/react": "^4.1.2", + "@astrojs/starlight": "^0.30.0", + "@astrojs/starlight-tailwind": "^3.0.0", + "@astrojs/tailwind": "^5.1.4", + "@domain-expansion/astro": "workspace:^", + "@types/react": "^19.0.2", + "@types/react-dom": "^19.0.2", + "astro": "^5.0.8", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "lucide-react": "^0.469.0", + "pretty-ms": "^9.2.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "recharts": "^2.15.0", + "sharp": "^0.32.5", + "starlight-image-zoom": "^0.9.0", + "starlight-theme-catppuccin": "^2.0.0", + "tailwind-merge": "^2.5.5", + "tailwindcss": "^3.4.17", + "tailwindcss-animate": "^1.0.7" + } +} diff --git a/packages/domain-expansion/docs/public/favicon.svg b/packages/domain-expansion/docs/public/favicon.svg new file mode 100644 index 0000000..cba5ac1 --- /dev/null +++ b/packages/domain-expansion/docs/public/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/domain-expansion/docs/public/og.jpg b/packages/domain-expansion/docs/public/og.jpg new file mode 100644 index 0000000..e8d8803 Binary files /dev/null and b/packages/domain-expansion/docs/public/og.jpg differ diff --git a/packages/domain-expansion/docs/src/assets/another-3-minutes-to-rollup.png b/packages/domain-expansion/docs/src/assets/another-3-minutes-to-rollup.png new file mode 100644 index 0000000..a85b025 Binary files /dev/null and b/packages/domain-expansion/docs/src/assets/another-3-minutes-to-rollup.png differ diff --git a/packages/domain-expansion/docs/src/assets/arcane-knowledge.png b/packages/domain-expansion/docs/src/assets/arcane-knowledge.png new file mode 100644 index 0000000..58c0fd2 Binary files /dev/null and b/packages/domain-expansion/docs/src/assets/arcane-knowledge.png differ diff --git a/packages/domain-expansion/docs/src/assets/bernie.png b/packages/domain-expansion/docs/src/assets/bernie.png new file mode 100644 index 0000000..e3cec5d Binary files /dev/null and b/packages/domain-expansion/docs/src/assets/bernie.png differ diff --git a/packages/domain-expansion/docs/src/assets/bush.png b/packages/domain-expansion/docs/src/assets/bush.png new file mode 100644 index 0000000..07e71c1 Binary files /dev/null and b/packages/domain-expansion/docs/src/assets/bush.png differ diff --git a/packages/domain-expansion/docs/src/assets/car.png b/packages/domain-expansion/docs/src/assets/car.png new file mode 100644 index 0000000..107d9fb Binary files /dev/null and b/packages/domain-expansion/docs/src/assets/car.png differ diff --git a/packages/domain-expansion/docs/src/assets/communism.png b/packages/domain-expansion/docs/src/assets/communism.png new file mode 100644 index 0000000..dd82252 Binary files /dev/null and b/packages/domain-expansion/docs/src/assets/communism.png differ diff --git a/packages/domain-expansion/docs/src/assets/feelings-of-power.png b/packages/domain-expansion/docs/src/assets/feelings-of-power.png new file mode 100644 index 0000000..f67c7b8 Binary files /dev/null and b/packages/domain-expansion/docs/src/assets/feelings-of-power.png differ diff --git a/packages/domain-expansion/docs/src/assets/goosebumps.png b/packages/domain-expansion/docs/src/assets/goosebumps.png new file mode 100644 index 0000000..e319714 Binary files /dev/null and b/packages/domain-expansion/docs/src/assets/goosebumps.png differ diff --git a/packages/domain-expansion/docs/src/assets/grim-reaper.png b/packages/domain-expansion/docs/src/assets/grim-reaper.png new file mode 100644 index 0000000..02a3389 Binary files /dev/null and b/packages/domain-expansion/docs/src/assets/grim-reaper.png differ diff --git a/packages/domain-expansion/docs/src/assets/new-woman.png b/packages/domain-expansion/docs/src/assets/new-woman.png new file mode 100644 index 0000000..f74620a Binary files /dev/null and b/packages/domain-expansion/docs/src/assets/new-woman.png differ diff --git a/packages/domain-expansion/docs/src/assets/no-builds.png b/packages/domain-expansion/docs/src/assets/no-builds.png new file mode 100644 index 0000000..dcba80d Binary files /dev/null and b/packages/domain-expansion/docs/src/assets/no-builds.png differ diff --git a/packages/domain-expansion/docs/src/assets/og.jpg b/packages/domain-expansion/docs/src/assets/og.jpg new file mode 100644 index 0000000..e8d8803 Binary files /dev/null and b/packages/domain-expansion/docs/src/assets/og.jpg differ diff --git a/packages/domain-expansion/docs/src/components/astro/BenchmarkResults.astro b/packages/domain-expansion/docs/src/components/astro/BenchmarkResults.astro new file mode 100644 index 0000000..57a3bed --- /dev/null +++ b/packages/domain-expansion/docs/src/components/astro/BenchmarkResults.astro @@ -0,0 +1,116 @@ +--- +import { getCollection } from 'astro:content'; +import { BenchmarkChart } from '../other/BenchmarkChart.tsx'; + +const results = await getCollection('benchmark'); +--- + +