{"id":13337743,"url":"https://github.com/chronoDave/tic-bundle","last_synced_at":"2025-03-11T07:30:47.685Z","repository":{"id":42465734,"uuid":"264185123","full_name":"chronoDave/tic-bundle","owner":"chronoDave","description":"Multi-file development in TIC-80","archived":false,"fork":false,"pushed_at":"2024-10-21T21:20:42.000Z","size":433,"stargazers_count":20,"open_issues_count":2,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-22T05:59:12.468Z","etag":null,"topics":["babel","fantasy-console","javascript","tic-80","tic80"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chronoDave.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":"2020-05-15T12:14:54.000Z","updated_at":"2024-10-21T21:20:46.000Z","dependencies_parsed_at":"2024-10-22T05:28:03.379Z","dependency_job_id":null,"html_url":"https://github.com/chronoDave/tic-bundle","commit_stats":{"total_commits":82,"total_committers":3,"mean_commits":"27.333333333333332","dds":0.08536585365853655,"last_synced_commit":"a1187f680806de306c4f8835c6bf1fb2814f0708"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronoDave%2Ftic-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronoDave%2Ftic-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronoDave%2Ftic-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronoDave%2Ftic-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chronoDave","download_url":"https://codeload.github.com/chronoDave/tic-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221144469,"owners_count":16763675,"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":["babel","fantasy-console","javascript","tic-80","tic80"],"created_at":"2024-07-29T19:14:56.422Z","updated_at":"2024-10-23T16:31:25.759Z","avatar_url":"https://github.com/chronoDave.png","language":"JavaScript","funding_links":["https://ko-fi.com/Y8Y41E23T"],"categories":[],"sub_categories":[],"readme":"![tic-bundle logo](https://i.imgur.com/YpexCm4.png)\n\n[![license GPLv3](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![npm](https://img.shields.io/npm/v/tic-bundle?label=npm)](https://www.npmjs.com/package/tic-bundle)\n[![ci](https://github.com/chronoDave/tic-bundle/actions/workflows/ci.yml/badge.svg)](https://github.com/chronoDave/tic-bundle/actions/workflows/ci.yml)\n\n# tic-bundle\n\nSimple CLI tool for bundling [TIC-80](https://tic80.com/) cartridge code. Supports any language!\n\n## Content\n\n - [Installation](#installation)\n - [Example](#example)\n - [CLI](#cli)\n - [Configuration](#configuration)\n   - [Options](#options)\n   - [Babel](#babel)\n - [License](./LICENSE)\n - [Donating](#donating)\n\n\n## Installation\n\n```\n// Yarn\nyarn add tic-bundle --dev\n\n// Npm\nnpm i tic-bundle --save-dev\n```\n\n## Example\n\n\u003cb\u003eConfig\u003c/b\u003e\n\n```JSON\n{\n  \"files\": [\"ui.js\", \"main.js\"],\n  \"assets\": [\"assets.js\"]\n}\n```\n\n\u003cb\u003eInput\u003c/b\u003e\n\n`src/main.js`\n\n```JS\nfunction TIC() {\n\n};\n\n// \u003cTILES\u003e\n// 000:0100000010100000010000000000000000000000000000000000000000000000\n// \u003c/TILES\u003e\n```\n\n`src/ui.js`\n\n```JS\nfunction ui() {\n  return 'ui';\n};\n```\n\n`src/assets.js`\n\n```JS\n// script: js\n\n// \u003cTILES\u003e\n// 000:0100000010100000010000000000000000000000000000000000000000000000\n// \u003c/TILES\u003e\n```\n\n\u003cb\u003eOutput\u003c/b\u003e\n\n`build.js`\n\n```JS\n// script: js\n\nfunction ui() {\n  return 'ui';\n};\n\nfunction TIC() {\n\n};\n\n// \u003cTILES\u003e\n// 000:0100000010100000010000000000000000000000000000000000000000000000\n// \u003c/TILES\u003e\n```\n\n## CLI\n\n`package.json`\n\n```JSON\n{\n  \"scripts\": {\n    \"watch\": \"tic-bundle\"\n  }\n}\n```\n\n\u003cb\u003eCLI options\u003c/b\u003e\n\n - `-r / --root` - Root folder\n - `-w / --wait` - Wait interval\n - `-c / --config` - Path to config file\n - `-o / --output` - Bundled file output path\n - `-n / --name` - Bundle file name\n - `-f / --file` - Bundle file extension\n - `-s / --script` - Language\n - `-b / --build` - Build\n\n\n## Configuration\n\n`tic-bundle` supports config files. By default, `tic-bundle` looks for a `.ticbundle.js` file in the current directory, but an alternative location can be specified using `-c \u003cfile\u003e` or `--config \u003cfile\u003e`. \n\nThe specificity is as folows:\n\n - `.ticbundle.js`\n - `.ticbundle.json`\n - CLI\n - Default config\n\n\u003cb\u003eDefault config\u003c/b\u003e\n\n```JS\n{\n  root: 'src',\n  wait: 200,\n  metadata: {\n    title: null,\n    author: null,\n    desc: null,\n    script: 'js',\n    input: null,\n    saveid: null\n  },\n  output: {\n    path: './',\n    extension: 'js',\n    name: 'build'\n  },\n  files: [],\n  assets: [],\n  after: null\n}\n```\n\n### Options\n\n - `root` (default `src`) - Folder to watch.\n - `wait` (default `200`) - [Chokidar awaitWriteFinish.stabilityThreshold](https://github.com/paulmillr/chokidar#performance)\n - `metadata` - [Cartridge metadata](https://github.com/nesbox/TIC-80/wiki#cartridge-metadata)\n - `metadata.title` - The name of the cart.\n - `metadata.author` - The name of the developer.\n - `metadata.description` - Optional description of the game.\n - `metadata.script` (default `js`) - Used scripting language.\n - `metadata.input` - Selects gamepad, mouse or keyboard input source.\n - `metadata.saveid` - Allows save data to be shared within multiple games on a copy of TIC.\n - `output.path` (default `./`) - Bundled file output path.\n - `output.extension` (default `js`) - Bundle file output extension\n - `output.name` (default `build`) - Bundled file name.\n - `files` - Files to bundle. Asset data will be stripped (graphics data, sprite data, etc.) Files will be ordered by index (top first, bottom last).\n  - `assets` - Assets to bundle. Code data will be stripped. Assets will be ordered by index (top first, bottom last) and are always places below `files`.\n - `after` - Run after generating the bundle, this can be used to further modify the bundle.\n\n### Babel\n\n`after` can be used to transform the bundled code. A common use-case for `js` is transforming `ES6` syntax to `ES5`.\n\n\u003cb\u003eExample\u003c/b\u003e\n\n`.ticbundle.js`\n\n```JS\nmodule.exports = {\n  after: bundle =\u003e {\n    const { code } = require('@babel/standalone').transform(bundle, {\n      plugins: [require('@babel/plugin-transform-arrow-functions')]\n    });\n    \n    return  code;\n  }\n};\n\n```\n\n## Donating\n\n[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/Y8Y41E23T)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FchronoDave%2Ftic-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FchronoDave%2Ftic-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FchronoDave%2Ftic-bundle/lists"}