{"id":28100420,"url":"https://github.com/tidev/babel-plugin-transform-titanium","last_synced_at":"2025-09-13T00:36:27.495Z","repository":{"id":36985407,"uuid":"164477456","full_name":"tidev/babel-plugin-transform-titanium","owner":"tidev","description":"babel plugin for optimizing titanium code","archived":false,"fork":false,"pushed_at":"2024-03-06T21:41:49.000Z","size":942,"stargazers_count":1,"open_issues_count":15,"forks_count":2,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-06-21T00:05:49.705Z","etag":null,"topics":["babel","babel-plugin","npm-package","titanium","titanium-mobile"],"latest_commit_sha":null,"homepage":"","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/tidev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"github":"tidev","liberapay":"tidev"}},"created_at":"2019-01-07T19:00:29.000Z","updated_at":"2022-03-30T05:50:42.000Z","dependencies_parsed_at":"2024-03-06T22:51:06.721Z","dependency_job_id":null,"html_url":"https://github.com/tidev/babel-plugin-transform-titanium","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tidev/babel-plugin-transform-titanium","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Fbabel-plugin-transform-titanium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Fbabel-plugin-transform-titanium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Fbabel-plugin-transform-titanium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Fbabel-plugin-transform-titanium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tidev","download_url":"https://codeload.github.com/tidev/babel-plugin-transform-titanium/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Fbabel-plugin-transform-titanium/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274902237,"owners_count":25371074,"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","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","babel-plugin","npm-package","titanium","titanium-mobile"],"created_at":"2025-05-13T18:34:41.708Z","updated_at":"2025-09-13T00:36:27.470Z","avatar_url":"https://github.com/tidev.png","language":"JavaScript","funding_links":["https://github.com/sponsors/tidev","https://liberapay.com/tidev"],"categories":[],"sub_categories":[],"readme":"\n# babel-plugin-transform-titanium [![Build Status](https://jenkins.appcelerator.org/buildStatus/icon?job=titanium-sdk%2Fbabel-plugin-transform-titanium%2Fmaster)](https://jenkins.appcelerator.org/job/titanium-sdk/job/babel-plugin-transform-titanium/job/master/) [![babel-plugin-transform-titanium](https://img.shields.io/npm/v/babel-plugin-transform-titanium.png)](https://www.npmjs.com/package/babel-plugin-transform-titanium)\n\nThis is a babel plugin intended to optimize Titanium SDK applications by inlining various static values. Once inlined, Other babel plugins may perform additional optimizations to help strip away \"dead code\".\n\nInformation about the current Titanium application build should be passed to the plugin's options object.\n\n## Plugin Options\n\n```javascript\nconst options = {\n  deploytype: 'development', // one of 'development', 'test', 'production'\n  platform: undefined, // one of 'android', 'ios', 'windows'\n  target: undefined, // one of 'dist-playstore', 'dist-appstore', 'dist-adhoc', null/undefined\n  Ti: {\n    version: undefined, // string, SDK version\n    App: {\n      id: undefined, // string, application id from tiapp.xml\n      name: undefined, // string, application name from tiapp.xml\n      version: undefined, // string, application version from tiapp.xml\n    },\n    Platform: {\n      osname: undefined, // one of 'android', 'ipad', 'iphone', 'windowsphone', 'windowsstore'\n    }\n  }\n};\n```\n\n## Special \"defines\"\n\nIt can:\n\n- replace special `OS_*` references with boolean values\n  - `OS_IOS` - `true` iff `pluginOptions.platform === 'ios'`\n  - `OS_ANDROID` - `true` iff `pluginOptions.platform === 'android'`\n  - `OS_WINDOWS` - `true` iff `pluginOptions.platform === 'windows'`\n  - Useful for `if`/`else` guards for platform specific code. Once booleans are inlined the false blocks can be removed.\n- replace special `ENV_*` references with boolean values\n  - `ENV_DEV` and `ENV_DEVELOPMENT` - `true` iff `pluginOptions.deploytype === 'development'` (typically simulator builds)\n  - `ENV_TEST` - `true` iff `pluginOptions.deploytype === 'test'` (typically device builds)\n  - `ENV_PROD` and `ENV_PRODUCTION` - `true` iff `pluginOptions.deploytype === 'production'` (typically app store/ad hoc builds)\n- replace special `DIST_*` references with boolean values\n  - `DIST_ADHOC` - `true` iff `pluginOptions.target === 'dist-adhoc'`\n  - `DIST_STORE` - `true` iff `pluginOptions.target === 'dist-appstore' || pluginOptions.target === 'dist-playstore'`\n\n## OS \"sniffing\" via Ti.Platform.osname\n\n- replace typical \"sniff\" expressions for iOS/Windows using `Ti.Platform.osname` with static boolean values\ni.e.\n\n```javascript\nif (Ti.Platform.osname === 'iphone' || Ti.Platform.osname === 'ipad') {\n  Ti.API.info('on ios!');\n}\nif (Ti.Platform.osname === 'windowsstore' || Ti.Platform.osname === 'windowsphone') {\n  Ti.API.info('on windows!');\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidev%2Fbabel-plugin-transform-titanium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftidev%2Fbabel-plugin-transform-titanium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidev%2Fbabel-plugin-transform-titanium/lists"}