{"id":15284369,"url":"https://github.com/etchteam/contentful","last_synced_at":"2025-06-21T00:10:27.364Z","repository":{"id":63902380,"uuid":"571645716","full_name":"etchteam/contentful","owner":"etchteam","description":"Helpers we use at Etch for working with Contentful","archived":false,"fork":false,"pushed_at":"2025-01-14T16:33:33.000Z","size":978,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-30T16:23:58.750Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/etchteam.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-11-28T15:23:15.000Z","updated_at":"2025-01-14T16:32:56.000Z","dependencies_parsed_at":"2023-01-14T13:00:20.302Z","dependency_job_id":"3c37948e-58fc-4d7e-b960-27d7e5478615","html_url":"https://github.com/etchteam/contentful","commit_stats":{"total_commits":29,"total_committers":5,"mean_commits":5.8,"dds":"0.31034482758620685","last_synced_commit":"c7a683862d6b92725096781cb850e15bcbc80032"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/etchteam/contentful","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etchteam%2Fcontentful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etchteam%2Fcontentful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etchteam%2Fcontentful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etchteam%2Fcontentful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/etchteam","download_url":"https://codeload.github.com/etchteam/contentful/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etchteam%2Fcontentful/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261039155,"owners_count":23100978,"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":[],"created_at":"2024-09-30T14:54:13.103Z","updated_at":"2025-06-21T00:10:22.330Z","avatar_url":"https://github.com/etchteam.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @etchteam/contentful\n\nHelpers we use at [Etch](https://etch.co) for working with Contentful.\n\n## Install\n\n```bash\nnpm install @etchteam/contentful\n```\n\n## CLI\n\n### Setup\n\nThe CLI depends on the following environment variables being present\n\n- [`CONTENTFUL_SPACE_ID`](https://www.contentful.com/help/find-space-id/)\n- [`CONTENTFUL_ENVIRONMENT`](https://www.contentful.com/developers/docs/concepts/multiple-environments/)\n- [`CONTENTFUL_MANAGEMENT_ACCESS_TOKEN`](https://www.contentful.com/developers/docs/references/authentication/#getting-a-personal-access-token)\n\n### Usage\n\nUse `--help` to display help for a command.\n\n#### Install migrations\n\n```bash\nnpx etch-contentful-cli migration:install\n```\n\nCreates a directory at `/integrations/contentful/migrations` containing a `0-init` migration.\n\nWhen migrations are run, this will set the migration content type on your configured contentful space.\n\n#### New migration\n\n```bash\nnpx etch-contentful-cli migration:new \"MIGRATION_NAME\"\n```\n\nCreates a new migration file at `/integrations/contentful/migrations` with the `\"MIGRATION_NAME\"` provided.\n\n#### Run migrations\n\n```bash\nnpx etch-contentful-cli migration:run\n```\n\nRuns all migrations that haven't already been run.\n\nThe `migration:run` command accepts an optional *spaces* argument `--spaces \u003cspaceOne,spaceTwo\u003e`.\n\nThis will filter out any migrations that don't export a matching space name as part of its `module.exports.spaces` array:\n\n```javascript\nmodule.exports.spaces = ['spaceOne', 'spaceTwo'];\n```\n\nIf no spaces argument is provided, all migrations will run.\n\n#### Generate types\n\n```bash\nnpx etch-contentful-cli typegen\n```\n\nGenerate GraphQL API compatible types based on your content in Contentful\n\nThe `typegen` command accepts an optional *filename* argument `--filename \u003cfilename\u003e`. If omitted the filename will default to *contentful.d.ts*.\n\n## Validators\n\nSome basic validators are available to use with content types, they can be imported:\n\n```javascript\nimport { validator } from '@etchteam/contentful';\n```\n\nThen used with their corresponding Contentful input type:\n\n```javascript\nnewEntity\n  .createField('summary')\n  .type('RichText')\n  .name('Summary')\n  .validations(validator.richText.boldAndItalicOnly);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetchteam%2Fcontentful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fetchteam%2Fcontentful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetchteam%2Fcontentful/lists"}