{"id":19880927,"url":"https://github.com/gridaco/coli","last_synced_at":"2025-10-06T12:30:27.106Z","repository":{"id":43410758,"uuid":"300628290","full_name":"gridaco/CoLI","owner":"gridaco","description":"Computer Language Interface. A Code builder (json, jsx, js, ts, dart, css, xml, html, python) AST Builder / Parser","archived":false,"fork":false,"pushed_at":"2024-02-23T19:52:44.000Z","size":2889,"stargazers_count":17,"open_issues_count":5,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-23T00:22:03.013Z","etag":null,"topics":["asdl","ast","coli","css","dart","es-builder","jsx","tsx","typescript"],"latest_commit_sha":null,"homepage":"https://coli.codes/","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/gridaco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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},"funding":{"open_collective":"grida"}},"created_at":"2020-10-02T13:46:02.000Z","updated_at":"2023-08-14T06:34:39.000Z","dependencies_parsed_at":"2023-01-23T00:31:25.278Z","dependency_job_id":"52ca181d-812e-4caf-a66d-3f2756d3aa7f","html_url":"https://github.com/gridaco/CoLI","commit_stats":{"total_commits":534,"total_committers":4,"mean_commits":133.5,"dds":0.2191011235955056,"last_synced_commit":"bd4bfcec628cb8e9825f2679b89cf38812911a5c"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridaco%2FCoLI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridaco%2FCoLI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridaco%2FCoLI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridaco%2FCoLI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gridaco","download_url":"https://codeload.github.com/gridaco/CoLI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235524158,"owners_count":19003816,"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":["asdl","ast","coli","css","dart","es-builder","jsx","tsx","typescript"],"created_at":"2024-11-12T17:12:49.204Z","updated_at":"2025-10-06T12:30:21.558Z","avatar_url":"https://github.com/gridaco.png","language":"TypeScript","funding_links":["https://opencollective.com/grida"],"categories":[],"sub_categories":[],"readme":"# CoLI\n\n![](./branding/cover.png)\n\nComputer Language Interface (node, dart, css, html, python) An AST Builder / Parser\n\n_design file available [here](https://www.figma.com/file/JYhmzaX7E5HNHQEK2Dp7Cp/CoLI?node-id=0%3A1)_\n\n## Installation\n\n```sh\nyarn add coli\n```\n\n## Supported platforms\n\n- NodeJS\n\n## Builders\n\nRead [BUILDERS.md](./docs/BUILDERS.md)\n\n## Supported gen target languages\n\n- JSX / TSX\n- JS / TS\n- Dart (+ Flutter)\n- CSS\n- SCSS\n- XML\n- HTML\n\n### [Try the demo](https://coli.codes)\n\n![](./branding/coli-web-demo-example.png)\n\n## CoLI Node implementation.\n\n**jsx building**\n\n```\ndiv(div(\"content\"))\n\n\u003e\u003e\u003e \u003cdiv\u003e\n\u003e\u003e\u003e   \u003cdiv\u003e\n\u003e\u003e\u003e     content\n\u003e\u003e\u003e   \u003c/div\u003e\n\u003e\u003e\u003e \u003c/div\u003e\n```\n\n**dart variable declaration**\n\n```\nconst file = new File(\"main.dart\")\nfile.add(Variable.const(\"someVariable\", \"hi there!\", CoLITypes.String))\n\n// main.dart\n\u003e\u003e\u003e final String someVariable = \"hi there!\";\n```\n\n\u003e to check work around for generating flutter code - checkout [@flutter-builder](https://github.com/gridaco/flutter/tree/main/flutter-builder)\n\n## Function\n\n\u003e build function with coli syntax\n\n```typescript\n// 1.\n\nfunction thisIsNativeFunction() {}\n\nconst coliFunc = coli.function(thisIsNativeFunction);\n\ncoliFunc.toDart();\n// \u003e void thisIsNativeFunction(){}\ncoliFunc.toPython({ followConvention: true });\n// \u003e def this_is_native_function(): ...\ncoliFunc.toJavascript();\n// \u003e function thisIsNativeFunction(){}\n\n// 2.\nconst coliFunc = new coli.Function({\n  returns: coli.Types.void,\n  name: \"thisIsGeneratedFunction\",\n  params: {\n    first: {\n      required: false,\n      type: coli.Types.any,\n    },\n  },\n  executable: coli.Executable.fromStatic(\"console.log('hi there.');\"),\n});\ncoliFunc.toJavascript();\n// \u003e function thisIsGeneratedFunction(first){ console.log('hi there.'); }\n```\n\n## Development\n\n```sh\n# packs the workspace\nyarn\n# runs the editor webapp\nyarn editor\n```\n\nBuilding - coli use lerna to build packages. running `yarn build` will build individual packages.\n\n```sh\nyarn build\n```\n\n## References\n\n- https://astexplorer.net/\n- https://github.com/acornjs/acorn\n- ts-ast-viewer.com\n- https://github.com/benjamn/ast-types\n- https://en.wikipedia.org/wiki/Abstract-Type_and_Scheme-Definition_Language\n- https://docs.python.org/3/library/ast.html\n- https://github.com/estree/estree\n- https://github.com/benjamn/ast-types\n- https://github.com/tc39/proposals\n- https://doc.esdoc.org/github.com/mason-lang/esast/class/src/ast.js~ImportSpecifier.html\n- https://github.com/facebook/jsx/blob/master/AST.md\n- https://github.com/acornjs/acorn-jsx\n- https://www.typescriptlang.org/docs/handbook/jsx.html\n- https://github.com/github/codeql\n- https://github.com/csstree/csstree\n- https://github.com/davidbonnet/astring\n- https://shift-ast.org/\n- https://github.com/estree/estree/blob/master/es5.md\n- https://github.com/csstree/csstree/blob/master/docs/generate.md#generateast-options\n- https://github.com/frenic/csstype\n- https://github.com/mdn/data\n- https://pub.dev/documentation/analyzer/latest/dart_ast_ast_factory/dart_ast_ast_factory-library.html\n- https://pub.dev/documentation/analyzer/latest/dart_ast_ast/dart_ast_ast-library.html\n- https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API\n- https://github.com/ktsn/ts-compiler-api-examples\n- https://learning-notes.mistermicheels.com/javascript/typescript/compiler-api/\n- https://github.com/grommet/jsx-to-string\n- https://github.com/babel/babel\n- https://github.com/unifiedjs/unified\n- https://github.com/remarkjs/remark\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgridaco%2Fcoli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgridaco%2Fcoli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgridaco%2Fcoli/lists"}