{"id":19071916,"url":"https://github.com/cyansalt/vue-spinach","last_synced_at":"2026-02-26T08:04:12.468Z","repository":{"id":236075363,"uuid":"791758815","full_name":"CyanSalt/vue-spinach","owner":"CyanSalt","description":"Transform Vue SFC between Option API and Composition API","archived":false,"fork":false,"pushed_at":"2025-04-25T02:53:14.000Z","size":479,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-28T09:06:01.962Z","etag":null,"topics":["composition-api","vue"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CyanSalt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2024-04-25T10:08:48.000Z","updated_at":"2025-04-25T02:53:18.000Z","dependencies_parsed_at":"2024-04-25T15:28:21.584Z","dependency_job_id":"51e390a3-a67b-4def-9c4b-8d01deb64501","html_url":"https://github.com/CyanSalt/vue-spinach","commit_stats":null,"previous_names":["cyansalt/vue-spinach"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/CyanSalt/vue-spinach","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyanSalt%2Fvue-spinach","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyanSalt%2Fvue-spinach/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyanSalt%2Fvue-spinach/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyanSalt%2Fvue-spinach/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CyanSalt","download_url":"https://codeload.github.com/CyanSalt/vue-spinach/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyanSalt%2Fvue-spinach/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004062,"owners_count":26083667,"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-10-10T02:00:06.843Z","response_time":62,"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":["composition-api","vue"],"created_at":"2024-11-09T01:32:35.945Z","updated_at":"2025-10-10T13:32:15.974Z","avatar_url":"https://github.com/CyanSalt.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-spinach\n\n[![npm](https://img.shields.io/npm/v/vue-spinach.svg)](https://www.npmjs.com/package/vue-spinach)\n\n\u003cimg src=\"https://cdn.jsdelivr.net/gh/CyanSalt/vue-spinach@main/docs/spinach.svg\" width=\"120\" height=\"120\"\u003e\n\n\u003e Popeye can save Olive with the power of spinach. So do Olive.\n\nTransform Vue SFC between Option API and Composition API.\n\n\u003e [!NOTE]\n\u003e This is **NOT** an official library of Vue.\n\n\u003e [!TIP]\n\u003e Currently only the transformation from Option API to Composition API is supported.\n\n## Usage\n\n### CLI\n\n```shell\npnpm dlx vue-spinach \u003cinFile\u003e [--print] [--out outFile] [--config configFile]\n```\n\nvue-spinach will read the file contents from `process.stdin` if `inFile` is not specified.\n\n`outFile` defaults to the same as `inFile`, unless `inFile` is not specified or `print` is specified. Then it will be output via `process.stdout`.\n\n`configFile` specifies an ES Module file with default exports. Refer to [Options](#options).\n\n### JS API\n\n```ts\nimport type { TransformOptions } from 'vue-spinach'\nimport { transformSFC } from 'vue-spinach'\n\nfunction transformSFC(code: string, userOptions?: Partial\u003cTransformOptions\u003e): string\n```\n\n```js\nimport { transformSFC } from 'vue-spinach'\n\nconst code = transformSFC(`\n\u003cscript\u003e\nexport default {\n  // ...\n}\n\u003c/script\u003e\n`, {\n  reactivityTransform: true,\n})\n```\n\n### Options\n\n```ts\ninterface TransformOptions {\n  /**\n   * Always generate code in typescript\n   * @default false\n   */\n  typescript: boolean,\n  /**\n   * Whether to generate \u003cscript setup\u003e block.\n   * @default true\n   */\n  scriptSetup: boolean,\n  /**\n   * Whether to generate code using [Reactivity Transform]{@link https://vue-macros.dev/features/reactivity-transform.html}.\n   * @default false\n   */\n  reactivityTransform: boolean,\n  /**\n   * Whether to destructure props defined by `defineProps`.\n   * Only valid when `scriptSetup` is `true`.\n   * @default true\n   */\n  propsDestructure: boolean,\n  /**\n   * Specifies a mapping of import names.\n   * For example `{ 'vue-router': 'vue-router-v4' }`.\n   * @default {}\n   */\n  aliases: Record\u003cstring, string\u003e,\n  /**\n   * Specifies additional plugins.\n   * Plugins that transform Vue's built-in options are always enabled.\n   * @default [...builtinPlugins]\n   */\n  plugins: Plugin[],\n}\n```\n\n### Plugin\n\nSee [Write a Plugin](/docs/write-a-plugin.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyansalt%2Fvue-spinach","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyansalt%2Fvue-spinach","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyansalt%2Fvue-spinach/lists"}