{"id":14978318,"url":"https://github.com/the-guild-org/shared-config","last_synced_at":"2025-04-05T08:06:13.066Z","repository":{"id":37017749,"uuid":"459645154","full_name":"the-guild-org/shared-config","owner":"the-guild-org","description":"A collection of config, setups, pipelines and GitHub Actions we use in our tools","archived":false,"fork":false,"pushed_at":"2025-04-01T07:09:30.000Z","size":3154,"stargazers_count":33,"open_issues_count":26,"forks_count":9,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-01T08:26:55.711Z","etag":null,"topics":["code-standards","eslint-config","github-actions","javascript","prettier-config","shared-configuration","the-guild","typescript"],"latest_commit_sha":null,"homepage":"https://github.com/the-guild-org/Stack/discussions/19","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/the-guild-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-15T15:50:02.000Z","updated_at":"2025-03-20T15:06:33.000Z","dependencies_parsed_at":"2023-09-28T10:30:21.961Z","dependency_job_id":"1a606d54-2227-4115-9268-069e2cdc13ff","html_url":"https://github.com/the-guild-org/shared-config","commit_stats":{"total_commits":749,"total_committers":17,"mean_commits":44.05882352941177,"dds":"0.40854472630173566","last_synced_commit":"018da4ec27dc1a2a7962c0d06390bfcd4eda6c86"},"previous_names":[],"tags_count":122,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-guild-org%2Fshared-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-guild-org%2Fshared-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-guild-org%2Fshared-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-guild-org%2Fshared-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/the-guild-org","download_url":"https://codeload.github.com/the-guild-org/shared-config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305933,"owners_count":20917208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-standards","eslint-config","github-actions","javascript","prettier-config","shared-configuration","the-guild","typescript"],"created_at":"2024-09-24T13:57:22.471Z","updated_at":"2025-04-05T08:06:13.023Z","avatar_url":"https://github.com/the-guild-org.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shared Config (by The Guild)\n\nThis repository is a collection of configurations, tools and examples, that demonstrate how The\nGuild is using their libs.\n\nWe use the files stored here in our other repositories, to have a single point of truth for all\nconfigurations/pipelines needed.\n\n\u003cdetails\u003e\n  \u003csummary\u003eStep 1: changesets\u003c/summary\u003e\n\nTo setup automated release flow for your package, using `changesets`:\n\n1. Create a monorepo, either by using `yarn` (v1) or `pnpm`.\n2. Install and initialize the Changesets config by following these instructions:\n   https://github.com/changesets/changesets/blob/main/docs/intro-to-using-changesets.md (also make\n   sure to install `@changesets/changelog-github`)\n\nMake sure to adjust you Changesets config file, based on your repo setup:\n\n```jsonc\n{\n  \"$schema\": \"https://unpkg.com/@changesets/config@2.1.0/schema.json\",\n  \"changelog\": [\n    \"@changesets/changelog-github\", // this will make nice output for changesets, with \"thank you...\" notes, and links to the commits + references in PRs!\n    { \"repo\": \"guild-member/project-repo\" } // Set the repo name here\n  ],\n  \"commit\": false,\n  \"linked\": [],\n  \"access\": \"public\",\n  \"baseBranch\": \"master\", // change if needed\n  \"updateInternalDependencies\": \"patch\",\n  \"ignore\": [\"website\"] // change if needed\n}\n```\n\n3. Configure your monorepo packages correctly, you should make sure to have the following in your\n   `package.json`:\n\n```json\n{\n  \"publishConfig\": {\n    \"directory\": \"dist\",\n    \"access\": \"public\"\n  }\n}\n```\n\n\u003e If you are not using a bundler/build flow, make sure to change the `directory` value if needed.\n\n4. Configure Changesets scripts for the release/PR flows. You should have a script called `release`,\n   that basically prepares the package for publishing, and then call `changesets` CLI to do the\n   actual publishing:\n\n```json\n{\n  \"scripts\": {\n    \"release\": \"yarn build \u0026\u0026 changeset publish\"\n  }\n}\n```\n\n5. Install Changesets Bot on your repo: https://github.com/apps/changeset-bot\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eStep 2: Repository Settings\u003c/summary\u003e\n\nConfigure GitHub Actions permissions: Go to repo Settings \u003e Actions \u003e General and make sure to\nconfigure the following:\n\n- `Actions permissions` should be set to `Allow all actions and reusable workflows`\n- `Workflow permissions` should be set to `Read and write permissions`, and make sure the\n  `Allow GitHub Actions to create and approve pull requests` option is active.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eStep 3: Unified secrets\u003c/summary\u003e\n\nYou can create an NPM publishing token by using `npm token create`.\n\nAfter creating your token, make sure to add it as part of your GitHub Actions Secrets (under repo\nSettings). Name it `NPM_TOKEN`.\n\nIn addition, the shared pipelines are going to use `GITHUB_TOKEN` provided by GitHub Actions\nruntime. You can customize it by creating a custom PAT token for the user you wish to use.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eStep 4: Automatic Stable Release\u003c/summary\u003e\n\nCreate a GitHub Actions that refers to the workflow defined in this repo, along with your settings:\n\n```yaml\nname: release\non:\n  push:\n    branches:\n      - master # change to main if needed\n\njobs:\n  stable:\n    uses: the-guild-org/shared-config/.github/workflows/release-stable.yml@main\n    with:\n      releaseScript: release # script to run as part of publish command\n      nodeVersion: 22 # you can change if needed\n    secrets:\n      githubToken: ${{ secrets.GITHUB_TOKEN }}\n      npmToken: ${{ secrets.NPM_TOKEN }}\n```\n\n\u003e By default, we use `aggregated` release mode.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eStep 5: Snapshot release for Pull Requests\u003c/summary\u003e\n\nTo setup automated release flow for your package, using `changesets`, based on PR changes, use the\nfollowing setup:\n\nStart by updating your changesets `config.json` to use the following:\n\n```jsonc\n{\n  // ... other stuff\n  \"snapshot\": {\n    \"useCalculatedVersion\": true,\n    \"prereleaseTemplate\": \"{tag}-{datetime}-{commit}\"\n  }\n}\n```\n\n\u003e You can customize the canary release template, see:\n\u003e https://github.com/changesets/changesets/blob/main/docs/config-file-options.md#prereleasetemplate-optional-string\n\nCreate a GitHub workflow (you can call it `pr.yaml`):\n\n```yaml\nname: pr\non:\n  pull_request:\n    branches:\n      - master # change if needed\n\njobs:\n  release:\n    uses: the-guild-org/shared-config/.github/workflows/release-snapshot.yml@main\n    with:\n      npmTag: alpha\n      buildScript: build\n      nodeVersion: 22\n    secrets:\n      githubToken: ${{ secrets.GITHUB_TOKEN }}\n      npmToken: ${{ secrets.NPM_TOKEN }}\n```\n\n\u003e You can choose the NPM tag of the release. We prefer using `alpha` or `canary` for PR-based\n\u003e releases.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eStep 6: Renovate\u003c/summary\u003e\n\n1. Install Renovate Bot on your repo: https://github.com/marketplace/renovate\n2. Wait for Renovate to create the first setup PR and merge it.\n3. Create `renovate.json` config file in the repo, with the following:\n\n```\n{\n  \"extends\": [\"github\u003ethe-guild-org/shared-config:renovate\"]\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eStep 7: Automatic changesets for dependencies updates\u003c/summary\u003e\n\nTo get automatic changesets created for Renovate PRs (and manual dependencies changes), add the\nfollowing GitHub Action workflow to your repo:\n\n\u003e Note: you can also add this to the existing `pr.yaml` if you are using the snapshot release.\n\n```yaml\nname: pr\non:\n  pull_request:\n    branches:\n      - master # change if needed\n\njobs:\n  dependencies:\n    uses: the-guild-org/shared-config/.github/workflows/changesets-dependencies.yaml@main\n    secrets:\n      githubToken: ${{ secrets.GITHUB_TOKEN }}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eStep 9: ESLint/Prettier config\u003c/summary\u003e\n\nIf you wish to use the unified config for eslint or prettier, following these instructions:\n\n- eslint: https://github.com/the-guild-org/shared-config/tree/main/packages/eslint-config\n- prettier: https://github.com/the-guild-org/shared-config/tree/main/packages/prettier-config\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eStep 10: ESLint pipeline\u003c/summary\u003e\n\nIf you wish to have a lint using ESLint and report the results back to GitHub, do the following:\n\n1. Make sure your project has eslint installed and configured\n2. Add `ci:lint` script with the following flags:\n   `eslint --output-file eslint_report.json --format json` on top of your regular ESLint CLI flags.\n3. Add a CI pipelines with the following:\n\n```yml\nname: test\non:\n  pull_request:\n    branches:\n      - master\n  push:\n    branches:\n      - master\n\njobs:\n  lint:\n    uses: the-guild-org/shared-config/.github/workflows/lint.yml@main\n    with:\n      script: yarn ci:lint\n    secrets:\n      githubToken: ${{ secrets.GITHUB_TOKEN }}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eStep 11: Shared pipelines\u003c/summary\u003e\n\nTo get the most out of the shared pipelines, you can use the following to run scripts as part of\nyour CI process:\n\n```yml\nname: build\non:\n  pull_request:\n    branches:\n      - master\n  push:\n    branches:\n      - master\n\njobs:\n  build:\n    uses: the-guild-org/shared-config/.github/workflows/ci.yml@main\n    with:\n      script: yarn build\n```\n\nIf our script is more complex and requires NodeJS version matrix, you can use this:\n\n```yml\nname: build\non:\n  pull_request:\n    branches:\n      - master\n  push:\n    branches:\n      - master\n\njobs:\n  build:\n    uses: the-guild-org/shared-config/.github/workflows/ci-node-matrix.yml@main\n    with:\n      script: yarn build\n      nodeVersions: '[22,23]'\n```\n\nIf your script requires more stuff, and you just want to avoid configuring NodeJS + Yarn + Caches,\nyou can just use the following to get started with your pipeline:\n\n```yml\nname: test\non:\n  pull_request:\n    branches:\n      - master\n  push:\n    branches:\n      - master\n\njobs:\n  test:\n    name: myScript\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n\n      - uses: the-guild-org/shared-config/setup@main\n        name: setup env\n        with:\n          nodeVersion: 22\n```\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-guild-org%2Fshared-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthe-guild-org%2Fshared-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-guild-org%2Fshared-config/lists"}