{"_id":"@yotoplay/twee2yoto","_rev":"30-4014eebc980c35a5a4694ba212ba794e","name":"@yotoplay/twee2yoto","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"@yotoplay/twee2yoto","version":"1.0.0","keywords":["twine","twee","yoto","converter","interactive-fiction","audio"],"author":{"name":"Yoto"},"license":"MIT","_id":"@yotoplay/twee2yoto@1.0.0","maintainers":[{"name":"alvinometric","email":"hello@alvin.codes"},{"name":"emmabeynon","email":"emma.beynon@gmail.com"},{"name":"gregyoto","email":"greg@yotoplay.com"}],"homepage":"https://github.com/yotoplay/twee2yoto#readme","bugs":{"url":"https://github.com/yotoplay/twee2yoto/issues"},"dist":{"shasum":"041a39c94748b958c5d2c8035d47ba1657ae2cd9","tarball":"https://registry.npmjs.org/@yotoplay/twee2yoto/-/twee2yoto-1.0.0.tgz","fileCount":10,"integrity":"sha512-Pr/YavT5c4NJGROv1PYgudGVm7lKUrZpqyi1Rlomu+7si1hOEIIxScNgYQV6NUXyL7YSBFkJkcF6KP57Ha1zHQ==","signatures":[{"sig":"MEYCIQDGZTpLoc8Fh4vlUwZaflzGHvm/XESoyjMBAylSaASjBwIhAM9bXCWhuH54Ce3M5VwRKAZ3oNQVypdwfxBbPZkTAmAf","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17514},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"0397d532869150312981005333eaa562d7811973","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc","format":"prettier --check .","typecheck":"tsc --noEmit","format:fix":"prettier --write .","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"gregyoto","actor":{"name":"gregyoto","type":"user","email":"greg@yotoplay.com"},"email":"greg@yotoplay.com"},"prettier":"@yoto/prettier-config","repository":{"url":"git+https://github.com/yotoplay/twee2yoto.git","type":"git"},"_npmVersion":"10.9.2","description":"Convert Twine/Twee JSON to Yoto format","directories":{},"_nodeVersion":"22.17.0","eslintConfig":{"extends":"@yoto/eslint-config"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.15.0","vitest":"^3.2.3","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^20.0.0","@tsconfig/node20":"^20.1.2","@yoto/eslint-config":"bitbucket:yotoplay/yoto-config-eslint#semver:3.0.20","@yoto/prettier-config":"bitbucket:yotoplay/yoto-config-prettier#semver:2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/twee2yoto_1.0.0_1751475294651_0.4899863573865664","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@yotoplay/twee2yoto","version":"1.0.1","keywords":["twine","twee","yoto","converter","interactive-fiction","audio"],"author":{"name":"Yoto"},"license":"MIT","_id":"@yotoplay/twee2yoto@1.0.1","maintainers":[{"name":"alvinometric","email":"hello@alvin.codes"},{"name":"emmabeynon","email":"emma.beynon@gmail.com"},{"name":"gregyoto","email":"greg@yotoplay.com"}],"homepage":"https://github.com/yotoplay/twee2yoto#readme","bugs":{"url":"https://github.com/yotoplay/twee2yoto/issues"},"dist":{"shasum":"726f9ee6d3e11c49a5aa8a5d79e7b624f2018639","tarball":"https://registry.npmjs.org/@yotoplay/twee2yoto/-/twee2yoto-1.0.1.tgz","fileCount":10,"integrity":"sha512-sHDPjGtGIGpboNnZ0PYKx0r7h8JWEHIobKcIzaAu67/Ug+8Z48LnU7ZbCn3wqzshhdCrss1cBGaz0JgGh4nZHA==","signatures":[{"sig":"MEYCIQCBcrhHRrfVXETNqitG1xNm672Taqb+PuYPiJs2/RMv/wIhAI4/ha6nhcqjAh7AUMKAjj6O5Xx8OdpPwXUvlSI9hAR8","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17722},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"0f953f4fb23cb121d9b96ae708461beafbca6d73","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc","format":"prettier --check .","typecheck":"tsc --noEmit","format:fix":"prettier --write .","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"gregyoto","actor":{"name":"gregyoto","type":"user","email":"greg@yotoplay.com"},"email":"greg@yotoplay.com"},"repository":{"url":"git+https://github.com/yotoplay/twee2yoto.git","type":"git"},"_npmVersion":"10.9.2","description":"Convert Twine/Twee JSON to Yoto format","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.15.0","vitest":"^3.2.3","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^20.0.0","@tsconfig/node20":"^20.1.2"},"_npmOperationalInternal":{"tmp":"tmp/twee2yoto_1.0.1_1751476155639_0.1293038782075686","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@yotoplay/twee2yoto","version":"1.1.0","keywords":["twine","twee","yoto","converter","interactive-fiction","audio"],"author":{"name":"Yoto"},"license":"MIT","_id":"@yotoplay/twee2yoto@1.1.0","maintainers":[{"name":"alvinometric","email":"hello@alvin.codes"},{"name":"emmabeynon","email":"emma.beynon@gmail.com"},{"name":"gregyoto","email":"greg@yotoplay.com"},{"name":"tomhazledine","email":"tom@tomhazledine.com"}],"homepage":"https://github.com/yotoplay/twee2yoto#readme","bugs":{"url":"https://github.com/yotoplay/twee2yoto/issues"},"dist":{"shasum":"10568661de08a62340de9d47085791bf5bfad218","tarball":"https://registry.npmjs.org/@yotoplay/twee2yoto/-/twee2yoto-1.1.0.tgz","fileCount":10,"integrity":"sha512-KCLSlaEUSY7gjh8QG9wuLttv0nnnaoMgjn8w3DABhNU3963ZDIj0wquBYFZdPgZHkHH8ElFKHFI7QcQZAXkFJw==","signatures":[{"sig":"MEQCIAlFtOga8JMhsaWonzolfsXcca98FXgTI9wqXgyAdP9lAiA9+eizNPzZpIluv4itrTC8ayzvv6jSD+/5giPa0vRiRg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19431},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"20632ded26bfcd08ec948c090db6e6f1ff768223","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc","format":"prettier --check .","release":"semantic-release","typecheck":"tsc --noEmit","format:fix":"prettier --write .","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"gregyoto","email":"greg@yotoplay.com"},"repository":{"url":"git+https://github.com/yotoplay/twee2yoto.git","type":"git"},"_npmVersion":"10.9.3","description":"Convert Twine/Twee JSON to Yoto format","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.15.0","vitest":"^3.2.3","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^20.0.0","@tsconfig/node20":"^20.1.2","semantic-release":"^24.2.7","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^12.0.2","@semantic-release/github":"^11.0.3","@semantic-release/changelog":"^6.0.3","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/release-notes-generator":"^14.0.3"},"_npmOperationalInternal":{"tmp":"tmp/twee2yoto_1.1.0_1753385081735_0.7906153393879829","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@yotoplay/twee2yoto","version":"1.2.0","keywords":["twine","twee","yoto","converter","interactive-fiction","audio"],"author":{"name":"Yoto"},"license":"MIT","_id":"@yotoplay/twee2yoto@1.2.0","maintainers":[{"name":"alvinometric","email":"hello@alvin.codes"},{"name":"emmabeynon","email":"emma.beynon@gmail.com"},{"name":"gregyoto","email":"greg@yotoplay.com"},{"name":"tomhazledine","email":"tom@tomhazledine.com"}],"homepage":"https://github.com/yotoplay/twee2yoto#readme","bugs":{"url":"https://github.com/yotoplay/twee2yoto/issues"},"dist":{"shasum":"85f61bf4651cb6de1cb347af2b3fbc29f2cf49fd","tarball":"https://registry.npmjs.org/@yotoplay/twee2yoto/-/twee2yoto-1.2.0.tgz","fileCount":10,"integrity":"sha512-AYLY+ndsvFb2cB6kqhxyYrlJr46uf4IZ6w21BMyiS2phXVY+xaTsFvNj5S1nJ+P2Sh06JyJs4QaoVkAR5K2j1A==","signatures":[{"sig":"MEQCIAiXoou5/D6sGeoIwIiSe5p8qwCim2Z0E3JpxA2ZG1PGAiA21hdEYXwMu5AqPCIKCpRwf96d7pUVBrNDqYwedxfsOA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@yotoplay%2ftwee2yoto@1.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":19431},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"47cb059a932391ebd8131c9f844491164362e368","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc","format":"prettier --check .","release":"semantic-release","typecheck":"tsc --noEmit","format:fix":"prettier --write .","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"gregyoto","email":"greg@yotoplay.com"},"repository":{"url":"git+https://github.com/yotoplay/twee2yoto.git","type":"git"},"_npmVersion":"10.9.3","description":"Convert Twine/Twee JSON to Yoto format","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.15.0","vitest":"^3.2.3","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^20.0.0","@tsconfig/node20":"^20.1.2","semantic-release":"^24.2.7","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^12.0.2","@semantic-release/github":"^11.0.3","@semantic-release/changelog":"^6.0.3","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/release-notes-generator":"^14.0.3"},"_npmOperationalInternal":{"tmp":"tmp/twee2yoto_1.2.0_1753460696114_0.044520078343086134","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-07-02T16:54:54.649Z","modified":"2026-08-18T09:46:03.747Z","1.0.0":"2025-07-02T16:54:54.846Z","1.0.1":"2025-07-02T17:09:15.825Z","1.1.0":"2025-07-24T19:24:41.974Z","1.2.0":"2025-07-25T16:24:56.292Z"},"bugs":{"url":"https://github.com/yotoplay/twee2yoto/issues"},"author":{"name":"Yoto"},"license":"MIT","homepage":"https://github.com/yotoplay/twee2yoto#readme","keywords":["twine","twee","yoto","converter","interactive-fiction","audio"],"repository":{"url":"git+https://github.com/yotoplay/twee2yoto.git","type":"git"},"description":"Convert Twine/Twee JSON to Yoto format","maintainers":[{"email":"dan@danwebb.net","name":"danwrong"},{"email":"rob.beal@yotoplay.com","name":"yoto-robbeal"},{"email":"asta.malyskaite@yotoplay.com","name":"aistyna"},{"email":"vincenzo.ciaccio@gmail.com","name":"vikkio88"},{"email":"eriks@yotoplay.com","name":"erixk"},{"email":"ralph@yotoplay.com","name":"yoto_ralph"},{"email":"hiroshi.sipahioglu@yotoplay.com","name":"hiro11"},{"email":"hasan.abdulgader@yotoplay.com","name":"hasan-yoto"},{"email":"adam.flitney@gmail.com","name":"adamflitney"},{"email":"jaimen.lathia@yotoplay.com","name":"jaimen-yoto"},{"email":"seb.sim@yotoplay.com","name":"seb.sim"},{"email":"caneycode@gmail.com","name":"escaney"},{"email":"tami.effendowicz@yotoplay.com","name":"tami.effendowicz"},{"email":"liam.sennitt@yotoplay.com","name":"liam-yoto"},{"email":"kieran.mozer@yotoplay.com","name":"kmoze"},{"email":"yusyuan.cheng@yotoplay.com","name":"yusyuan-yoto"},{"email":"Olliewarway@gmail.com","name":"owarway"},{"email":"onishiweb@gmail.com","name":"onishiweb"},{"email":"tash.mulla@yotoplay.com","name":"tash.mulla"},{"email":"filip@yotoplay.com","name":"filipyoto"},{"email":"sian.lynch@yotoplay.com","name":"sianyoto"},{"email":"luke.jeffery@yotoplay.com","name":"lukejeffery-yoto"},{"email":"security-integrations@yotoplay.com","name":"yoto-security-integrations"},{"email":"hello@alvin.codes","name":"alvinometric"},{"email":"emma.beynon@gmail.com","name":"emmabeynon"},{"email":"greg@yotoplay.com","name":"gregyoto"},{"email":"tom@tomhazledine.com","name":"tomhazledine"},{"email":"theresa.may@yotoplay.com","name":"theresa-yo"}],"readme":"# twee2yoto\n\nA TypeScript library for converting Twine/TweeJSON to YotoJSON format for interactive audio content.\n\n## Related Packages\n\nThis package is designed to work together with [`@yotoplay/twee2json`](https://github.com/yotoplay/twee2json) to provide a complete Twee to Yoto conversion pipeline:\n\n- **`@yotoplay/twee2json`**: Converts Twee format to TweeJSON\n- **`@yotoplay/twee2yoto`**: Converts TweeJSON to YotoJSON\n\n### Complete Workflow\n\n```bash\n# Convert Twee to TweeJSON\nnpm install @yotoplay/twee2json\n# Then convert TweeJSON to YotoJSON\nnpm install @yotoplay/twee2yoto\n```\n\n## Installation\n\n```bash\nnpm install twee2yoto\n```\n\n## Usage\n\n```typescript\nimport { convertTweeToYoto, generateTracks } from \"twee2yoto\";\n\n// Convert Twee JSON to Yoto format\nconst tweeJson = {\n  metadata: {\n    title: \"My Story\",\n    init: null,\n    data: {\n      start: \"Start\",\n      ifid: \"12345678-1234-1234-1234-123456789012\",\n      creator: \"Author Name\",\n    },\n  },\n  variables: {\n    cover: \"https://example.com/cover.jpg\",\n    resumeTimeout: 3600,\n  },\n  passages: [\n    {\n      name: \"Start\",\n      metadata: null,\n      content: \"This is the start of the story.\",\n      choices: [{ text: \"Go to next\", link: \"Next\" }],\n      tags: [\"start\"],\n    },\n    {\n      name: \"Next\",\n      metadata: null,\n      content: \"This is the next passage.\",\n      choices: [{ text: \"Go back\", link: \"Start\" }],\n      tags: [\"middle\"],\n    },\n  ],\n};\n\nconst yotoJson = convertTweeToYoto(tweeJson, { useTags: false });\nconsole.log(yotoJson);\n\n// Generate tracks from audio data\nconst audioData = [\n  {\n    key: \"passage1\",\n    contentAudioUrl: \"https://example.com/audio1.mp3\",\n    choices: [{ text: \"Next\", link: \"passage2\" }],\n  },\n];\n\nconst tracks = generateTracks(audioData, \"aac\");\nconsole.log(tracks);\n```\n\n## API\n\n### `convertTweeToYoto(tweeJson: TweeJSON, options: { useTags: boolean }): YotoJSON`\n\nConverts a Twee JSON object to Yoto format.\n\n#### Parameters\n\n- `tweeJson` (TweeJSON): The Twee JSON object to convert\n- `options` (object): Configuration options\n  - `useTags` (boolean): Whether to include passage tags in chapter titles\n\n#### Returns\n\nA `YotoJSON` object with the following structure:\n\n```typescript\ninterface YotoJSON {\n  title?: string;\n  slug: string;\n  sortkey: string;\n  metadata: YotoMetadata;\n  updatedAt: string;\n  content: YotoContent;\n}\n```\n\n### `generateTracks(audios: GeneratedAudio[], format?: string): Track[]`\n\nGenerates Yoto track objects from audio data.\n\n#### Parameters\n\n- `audios` (GeneratedAudio[]): Array of audio data objects\n- `format` (string, optional): Audio format (default: 'aac')\n\n#### Returns\n\nAn array of `Track` objects with events for interactive navigation.\n\n## Types\n\n### TweeJSON\n\n```typescript\ninterface TweeJSON {\n  metadata: Metadata;\n  variables: { [key: string]: any };\n  passages: Passage[];\n}\n```\n\n### YotoJSON\n\n```typescript\ninterface YotoJSON {\n  title?: string;\n  slug: string;\n  sortkey: string;\n  metadata: YotoMetadata;\n  updatedAt: string;\n  content: YotoContent;\n}\n```\n\n### GeneratedAudio\n\n```typescript\ninterface GeneratedAudio {\n  key: string;\n  contentAudioUrl: string;\n  choices: Choice[];\n}\n```\n\n## Features\n\n- Converts Twee JSON to Yoto interactive format\n- Generates navigation events for left/right button and end actions\n- Supports custom cover images and metadata\n- Handles passage tags and choice navigation\n- Configurable audio format support\n- Automatic slug generation from titles\n- Default values for missing metadata\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Run tests\nnpm test\n\n# Run tests in watch mode\nnpm run test:watch\n\n# Build the package\nnpm run build\n\n# Lint code\nnpm run lint\n\n# Format code\nnpm run format:fix\n\n# Run semantic-release locally (for testing)\nnpm run release\n```\n\n## Releases\n\nThis project uses [semantic-release](https://github.com/semantic-release/semantic-release) for automated versioning and publishing. The release process is triggered automatically when changes are pushed to the `main` branch.\n\n### Commit Message Format\n\nTo ensure proper versioning, commit messages should follow the [Conventional Commits](https://www.conventionalcommits.org/) specification:\n\n- `feat:` - New features (triggers minor version bump)\n- `fix:` - Bug fixes (triggers patch version bump)\n- `BREAKING CHANGE:` - Breaking changes (triggers major version bump)\n- `docs:` - Documentation changes (no version bump)\n- `style:` - Code style changes (no version bump)\n- `refactor:` - Code refactoring (no version bump)\n- `test:` - Adding or updating tests (no version bump)\n- `chore:` - Maintenance tasks (no version bump)\n\n### Release Process\n\n1. Push changes to the `main` branch\n2. GitHub Actions automatically runs tests and builds\n3. If tests pass, semantic-release analyzes commit messages\n4. If a new version is needed, it:\n   - Updates the version in `package.json`\n   - Generates release notes\n   - Updates `CHANGELOG.md`\n   - Publishes to npm\n   - Creates a GitHub release\n\n### Manual Release\n\nTo run semantic-release locally (for testing):\n\n```bash\nnpm run release\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}