{"id":13547450,"url":"https://github.com/netlify/build-info","last_synced_at":"2025-04-02T19:33:10.251Z","repository":{"id":37904240,"uuid":"351851608","full_name":"netlify/build-info","owner":"netlify","description":"Build info utility","archived":true,"fork":false,"pushed_at":"2022-10-10T08:49:16.000Z","size":1599,"stargazers_count":5,"open_issues_count":9,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T05:12:42.099Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/netlify.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2021-03-26T16:52:10.000Z","updated_at":"2023-01-27T20:24:50.000Z","dependencies_parsed_at":"2022-07-20T00:48:53.893Z","dependency_job_id":null,"html_url":"https://github.com/netlify/build-info","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlify%2Fbuild-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlify%2Fbuild-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlify%2Fbuild-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlify%2Fbuild-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netlify","download_url":"https://codeload.github.com/netlify/build-info/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246880380,"owners_count":20848852,"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-08-01T12:00:55.957Z","updated_at":"2025-04-02T19:33:07.286Z","avatar_url":"https://github.com/netlify.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\n\u003e ## !important Notice\n\u003e\n\u003e This repository was moved into the mono repository of [github.com/netlify/build](https://github.com/netlify/build)\n\u003e The package name and the versions are preserved!\n\n[![Build](https://github.com/netlify/build-info/workflows/Build/badge.svg)](https://github.com/netlify/build-info/actions)\n[![Node](https://img.shields.io/node/v/@netlify/build-info.svg?logo=node.js)](https://www.npmjs.com/package/@netlify/build-info)\n\n# Build Info\n\nBuild information detection utility.\n\nThe purpose of this lib is to, given a project and a configuration, return a set of useful data for our build system.\nCurrently it's used to detect:\n\n- [`jsWorkspaces`](https://docs.npmjs.com/cli/v7/using-npm/workspaces)\n- [`frameworks`](https://github.com/netlify/framework-info)\n\nBut it's possible to extend it in the future to extract other bits of information, such as the heuristics present in the\n[`build-image`](https://github.com/netlify/build-image/blob/xenial/run-build-functions.sh#L214).\n\n# Example (Node.js)\n\n```js\nimport { getBuildInfo } from '@netlify/build-info'\n\nconsole.log(await getBuildInfo({ projectDir: 'path/to/site', rootDir: '/project/root/dir' }))\n// {\n//   jsWorkspaces: {\n//     isRoot: false,\n//     packages: [\n//       'path/to/site',\n//       'path/to/component/library'\n//       'path/to/utility/library'\n//     ]\n//   },\n//   frameworks: [\n//     {\n//        name: 'gatsby',\n//        category: 'static_site_generator',\n//        dev: {\n//          commands: ['gatsby develop'],\n//          port: 8000\n//        },\n//        build: {\n//          commands: ['gatsby build'],\n//          directory: 'public'\n//        },\n//        env: { GATSBY_LOGGER: 'yurnalist' },\n//        plugins: []\n//      }\n//    ]\n// }\n\nconsole.log(await getBuildInfo({ projectDir: '/project/root/dir' }))\n// {\n//   jsWorkspaces: {\n//     isRoot: true,\n//     packages: [\n//       'path/to/site',\n//       'path/to/component/library'\n//       'path/to/utility/library'\n//     ]\n//   },\n//   frameworks: []\n// }\n```\n\n# Example (CLI)\n\n```bash\n$ build-info /project/root/dir\n{\n  jsWorkspaces: {\n    isRoot: true,\n    packages: [\n      'path/to/site',\n      'path/to/component/library'\n      'path/to/utility/library'\n    ]\n  },\n  frameworks: []\n}\n\n$ build-info path/to/site --rootDir /project/root/dir\n{\n  jsWorkspaces: {\n    isRoot: false,\n    packages: [\n      'path/to/site',\n      'path/to/component/library'\n      'path/to/utility/library'\n    ]\n  },\n  frameworks: [\n    {\n       name: 'gatsby',\n       category: 'static_site_generator',\n       dev: {\n         commands: ['gatsby develop'],\n         port: 8000\n       },\n       build: {\n         commands: ['gatsby build'],\n         directory: 'public'\n       },\n       env: { GATSBY_LOGGER: 'yurnalist' },\n       plugins: []\n     }\n  ]\n}\n```\n\n## Contributors\n\nPlease see [CONTRIBUTING.md](./CONTRIBUTING.md) for instructions on how to set up and work on this repository. Thanks\nfor contributing!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetlify%2Fbuild-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetlify%2Fbuild-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetlify%2Fbuild-info/lists"}