{"id":23655235,"url":"https://github.com/caplin/gc-cli","last_synced_at":"2025-11-22T07:30:15.384Z","repository":{"id":19058525,"uuid":"22285017","full_name":"caplin/gc-cli","owner":"caplin","description":"CLI for the global compiler project","archived":false,"fork":false,"pushed_at":"2017-11-08T17:25:21.000Z","size":541,"stargazers_count":3,"open_issues_count":11,"forks_count":1,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-12-28T19:52:03.404Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caplin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-26T11:14:33.000Z","updated_at":"2017-08-04T09:21:54.000Z","dependencies_parsed_at":"2022-09-02T07:12:34.869Z","dependency_job_id":null,"html_url":"https://github.com/caplin/gc-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caplin%2Fgc-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caplin%2Fgc-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caplin%2Fgc-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caplin%2Fgc-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caplin","download_url":"https://codeload.github.com/caplin/gc-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239627287,"owners_count":19670844,"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-12-28T19:52:01.459Z","updated_at":"2025-11-22T07:30:15.295Z","avatar_url":"https://github.com/caplin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gc-cli\n[![Build Status](https://secure.travis-ci.org/caplin/gc-cli.png)](http://travis-ci.org/caplin/gc-cli)\n[![Dependency Status](https://david-dm.org/caplin/gc-cli.png?theme=shields.io)](https://david-dm.org/caplin/gc-cli)\n\n### Purpose\n\nConverts namespaced JavaScript code to CommonJS modules.\n\nThis:\n\n```javascript\ncaplin.grid.GridView = function() {\n\tthis._scrollView = new caplin.grid.ScrollPane();\n}\n```\n\nwill be converted to:\n\n```javascript\n'use strict';\n\nvar ScrollPane = require('caplin/grid/ScrollPane');\n\nfunction GridView() {\n\tthis._scrollView = new ScrollPane();\n}\n\nmodule.exports = GridView;\n```\n\nAlso adds requires for **specified** globals i.e. `jQuery.on(...)` will add a\n`var jQuery = require('jQuery')` statement if not already present in the code.\n\n### Requirements\n\nnode v6 or higher.\n\n### Installation\n\nEither install it globally:\n\n```bash\n$ npm i -g caplin/gc-cli\n```\n\nor clone this repository, `cd` into it and run\n\n```bash\n$ npm link\n```\n\n### Usage\n\nOnce installed `cd` into a directory with a `src` subdirectory (a blade,\nbladeset, lib or aspect) and run.\n\n```bash\n$ gc-cli\n```\n\nThis will format all `*.js` files in the `src` directory.\n\n### Suggested approach\n\nConvert one blade, bladeset, lib, aspect `src` at a time, then run tests, verify\nthe application is working and perform smoke tests. `git checkout .` will revert\nthe changes. Don't get bogged down on one conversion too long, move to another\none if the conversion is not straightforward. Do not work on converted code\nwithout commiting the code locally or it will be difficult to keep track of your\nown changes versus the automated ones. The tests do not need to be converted\nnamespaced tests can still test converted CJS code. Perform a code diff to\nverify the conversion looks reasonable.\n\nTo convert JS patches `cd` into `js-patches` and run\n\n```bash\n$ gc-cli --outputDirectory=. \"**/*.js\"\n```\n\n#### Command line flags\n\nYou can modify the default options using these options:\n\n* `--namespaces` or `-n` comma separated list of namespace roots to convert to\nCJS.\n\n```bash\n$ gc-cli --namespaces caplin,caplinx,br,yournamespaceroot\n```\n\n* `--compileTestFiles` or `-t` convert `tests`, use a transform pipeline\nconfigured for tests.\n\n```bash\n$ gc-cli --compileTestFiles\n```\n\n### Contributing\n\nRaise any issues, feature requests in this repository or create a PR for them.\n\n#### Testing\n\nInside this repo\n\n```bash\n$ npm t\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaplin%2Fgc-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaplin%2Fgc-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaplin%2Fgc-cli/lists"}