{"id":26084394,"url":"https://github.com/c8r/lab-cli","last_synced_at":"2025-07-17T01:34:06.839Z","repository":{"id":95427453,"uuid":"105444826","full_name":"c8r/lab-cli","owner":"c8r","description":"Command line utilities and exporting module for Compositor Lab","archived":false,"fork":false,"pushed_at":"2018-02-18T17:42:26.000Z","size":110,"stargazers_count":51,"open_issues_count":7,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-19T09:24:17.504Z","etag":null,"topics":["cli","components","compositor","css","design-system","emotion","fela","glamorous","lab","react","styled-components","vue"],"latest_commit_sha":null,"homepage":"https://compositor.io/lab","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/c8r.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2017-10-01T13:39:46.000Z","updated_at":"2024-05-17T16:46:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"c40b5a1a-7997-4b6a-9b9e-71203af0f35f","html_url":"https://github.com/c8r/lab-cli","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/c8r/lab-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c8r%2Flab-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c8r%2Flab-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c8r%2Flab-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c8r%2Flab-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c8r","download_url":"https://codeload.github.com/c8r/lab-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c8r%2Flab-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265558637,"owners_count":23787950,"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":["cli","components","compositor","css","design-system","emotion","fela","glamorous","lab","react","styled-components","vue"],"created_at":"2025-03-09T04:56:55.222Z","updated_at":"2025-07-17T01:34:06.825Z","avatar_url":"https://github.com/c8r.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# lab-cli\n\nCommand line utilities and exporting module for [Compositor Lab][lab]\n\n[![Build Status][build-badge]][build]\n\n[build-badge]: https://img.shields.io/travis/c8r/lab-cli/master.svg?style=flat-square\n[build]: https://travis-ci.org/c8r/lab-cli\n\n```sh\nnpm install @compositor/lab\n```\n\n## CLI Usage\n\nCompile `lab.json` to React components:\n\n```sh\nlab --out-dir dist/\n```\n\nWatch for changes:\n\n```sh\nlab --out-dir dist/ --watch\n```\n\n### Lab Packages\n\nLab projects can be published in a way that allows them to be installed and imported into other Lab projects from the app.\n\nExport `index.js`, `lab.json`, and `theme.json` for packaging Lab projects:\n\n```sh\nlab --pkg --out-dir dist/\n```\n\n### CLI Options\n\n```\n-d --out-dir    Output directory\n-w --watch      Watch for changes\n--pkg           Include index.js, lab.json, and theme.json in output\n```\n\n## Node Usage\n\nThe Node API is used by the Lab app to export lab components to React and other formats.\n\n`lab(config, [options])`\n\nReturns an array of objects for writing to files.\n\n```js\nconst fs = require('fs')\nconst path = require('path')\nconst lab = require('@compositor/lab')\nconst config = require('./lab.json')\n\nconst modules = lab(config)\n\nmodules.forEach(mod =\u003e {\n  const filename = path.join(__dirname, 'dist', mod.name + '.js')\n  fs.writeFile(filename, mod.module, err =\u003e {\n    if (err) console.log(err)\n  })\n})\n```\n\n### Options\n\n#### `library`\n\nA string key to choose an output mode, one of the following:\n\n- [`styled-components`][sc]\n- [`glamorous`][glamorous]\n- [`emotion`][emotion]\n- [`fela`][fela]\n- [`cxs`][cxs]\n- [`vue`][vue] (alpha)\n\n#### `harmony`\n\nBoolean to export the template without transpiling to ES5 syntax.\n\n## Templates\n\nCurrently this module uses templates to output to different formats.\nThese templates can be found in [`lib/templates/`](https://github.com/c8r/lab-cli/tree/master/lib/templates).\nUsing an AST for output with tools like Babel is also possible,\nbut templates were used in an attempt to make it easier to contribute to this project.\n\n## lab.json Data Structure\n\nSee [`docs/lab-json.md`](docs/lab-json.md)\n\n## Roadmap\n\n- Vue.js export (currently in alpha)\n- Atomic CSS export\n- Support for using third party CSS libraries\n\n[Made by Compositor](https://compositor.io)\n|\n[MIT License](LICENSE.md)\n\n[lab]: https://compositor.io/lab/\n[sc]: https://styled-components.com\n[glamorous]: https://github.com/paypal/glamorous\n[emotion]: https://github.com/emotion-js/emotion\n[fela]: http://fela.js.org\n[cxs]: https://github.com/jxnblk/cxs\n[vue]: https://vuejs.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc8r%2Flab-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc8r%2Flab-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc8r%2Flab-cli/lists"}