{"id":28100356,"url":"https://github.com/tidev/titanium-editor-commons","last_synced_at":"2026-03-16T08:02:01.351Z","repository":{"id":37951120,"uuid":"183234053","full_name":"tidev/titanium-editor-commons","owner":"tidev","description":"Commons package for the Atom plugin and VS Code Extension for Titanium","archived":false,"fork":false,"pushed_at":"2023-03-06T20:30:44.000Z","size":4554,"stargazers_count":2,"open_issues_count":27,"forks_count":2,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-30T15:11:58.749Z","etag":null,"topics":["npm-package"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tidev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"tidev","liberapay":"tidev"}},"created_at":"2019-04-24T13:25:23.000Z","updated_at":"2023-01-18T15:14:38.000Z","dependencies_parsed_at":"2023-02-19T12:00:37.812Z","dependency_job_id":null,"html_url":"https://github.com/tidev/titanium-editor-commons","commit_stats":null,"previous_names":["appcelerator/titanium-editor-commons"],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Ftitanium-editor-commons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Ftitanium-editor-commons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Ftitanium-editor-commons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Ftitanium-editor-commons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tidev","download_url":"https://codeload.github.com/tidev/titanium-editor-commons/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254003559,"owners_count":21997903,"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":["npm-package"],"created_at":"2025-05-13T18:33:48.120Z","updated_at":"2025-10-11T11:01:36.291Z","avatar_url":"https://github.com/tidev.png","language":"TypeScript","funding_links":["https://github.com/sponsors/tidev","https://liberapay.com/tidev"],"categories":[],"sub_categories":[],"readme":"# titanium-editor-commons\n\n`titanium-editor-commons` is a commons library for the [Atom](https://github.com/appcelerator/atom-appcelerator-titanium) and [VS Code](https://github.com/appcelerator/vscode-appcelerator-titanium) editor plugins for [Titanium SDK](https://github.com/appcelerator/titanium_mobile). It aims to provide a common layer for the two projects.\n\nIt aims to be a library that allows sharing code between the two projects that doesn't require interaction with the editor specifc APIs. Currently it focuses on providing:\n\n* Completions generation and loading\n* Environment validation\n* Checking for and installing product updates\n\n## Completions\n\nThe two editor projects use their own completions format for the intellisense feature, this file gets generated from the `api.jsca` file included in the SDK and the `Alloy/commands/compile/parsers` directory in an alloy installation.\n\n### Generating completions\n\n```js\nimport { completion } from 'titanium-editor-commons';\n\n// Generate a v3 completions file, overwriting it if it already exists. The active Alloy version is detected\nconst alloyVersion = await completion.generateAlloyCompletions(true, completion.CompletionsFormat.v3);\nconsole.log(alloyVersion) // The Alloy version the completions were generated for\n\n// Generate a v3 completions file for SDK 12.7.0, do not create one if it already exists\nconst sdkVersion = await completion.generateSDKCompletions(false, '12.7.0', '/Users/user/Library/Application Support/Titanium/mobilesdk/osx/12.7.0', completion.CompletionsFormat.v3);\nconsole.log(sdkVersion) // The SDK version the completions were generated for\n```\n\n### Loading completions\n\n```js\nimport { completion } from 'titanium-editor-commons';\n\n// Load a v3 completions file\nconst completions = await completion.loadCompletions('12.7.0', completion.CompletionsFormat.v3)\nconsole.log(completions) // An object with `alloy` and `titanium` keys with their respective completions data. View the `CompletionsData` type for full information\n```\n\n## Environment\n\nThis validates that an environment has the required tooling to perform Titanium development. It does not detect the platform specific tooling like Android SDKs or Xcode. By default it requires the Appc tooling, but can also detect for the OSS tooling\n\n```js\nimport { environment } from 'titanium-editor-commons';\n\n// Validate the environment has the required Appc tooling. If Node.js is missing, require a version that matches the 18.x || 22.x range\nconst details = await environment.validateEnvironment({ nodeJS: '18.x || 22.x'}, true);\nconsole.log(details); // An object with `installed` and `missing` keys\n```\n\n## Updates\n\nThis checks the current version of tooling and then sees if there is a new version. It also provides a way to install these updates.\nYou can either check for all updates or import the individual products and check individually.\n\n```js\nimport { updates } from 'titanium-editor-commons';\n\n// Check for updates in the OSS tooling, and check if there is an Node.js update that matches the 18.x || 22.x range\nconst newUpdates = await updates.checkAllUpdates({ nodeJS: '18.x || 22.x'}, false);\nconsole.log(newUpdates); // An array of products that require updates, sorted in order of the priority they should be instaleld\n\nconst alloyUpdate = await updates.alloy.checkForUpdate();\nconsole.log(alloyUpdate); // An object with the following keys.\n\n/**\n * {String} currentVersion - The installed version\n * {String}latestVersion - The version that will be installed\n * {Function} action - Function to call to install the version\n * {String} productName - The pretty product name\n * {String} releaseNotes - The URL for the release notes\n * {Number} priority - The priority of the update\n * {Boolean} hasUpdate - Whether there is an update or not\n */\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidev%2Ftitanium-editor-commons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftidev%2Ftitanium-editor-commons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidev%2Ftitanium-editor-commons/lists"}