├── .eslintrc ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── LICENSE ├── README.md ├── build.config.ts ├── examples ├── c2c-with-placeholder │ ├── index.html │ ├── package.json │ ├── src │ │ ├── App.vue │ │ ├── components │ │ │ └── Tooltip.vue │ │ └── main.ts │ ├── unocss.config.ts │ ├── vite-env.d.ts │ └── vite.config.ts └── c2c │ ├── index.html │ ├── package.json │ ├── src │ ├── App.vue │ ├── components │ │ └── Confirm.vue │ └── main.ts │ ├── unocss.config.ts │ ├── vite-env.d.ts │ └── vite.config.ts ├── package.json ├── playground ├── index.html ├── package.json ├── src │ ├── App.vue │ ├── components │ │ └── Confirm.vue │ └── main.ts ├── unocss.config.ts ├── vite-env.d.ts └── vite.config.ts ├── pnpm-lock.yaml ├── pnpm-workspace.yaml ├── src ├── index.ts └── type.ts ├── test └── index.test.ts ├── tsconfig.json ├── vitest.config.ts └── vue-c2c.png /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@antfu", 3 | "rules": { 4 | "vue/one-component-per-file": "off", 5 | "@typescript-eslint/no-use-before-define": "off" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | pull_request: 9 | branches: 10 | - main 11 | 12 | jobs: 13 | lint: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v3 17 | 18 | - name: Install pnpm 19 | uses: pnpm/action-setup@v2 20 | 21 | - name: Set node 22 | uses: actions/setup-node@v3 23 | with: 24 | node-version: 18.x 25 | cache: pnpm 26 | 27 | - name: Setup 28 | run: npm i -g @antfu/ni 29 | 30 | - name: Install 31 | run: nci 32 | 33 | - name: Lint 34 | run: nr lint 35 | 36 | typecheck: 37 | runs-on: ubuntu-latest 38 | steps: 39 | - uses: actions/checkout@v3 40 | 41 | - name: Install pnpm 42 | uses: pnpm/action-setup@v2 43 | 44 | - name: Set node 45 | uses: actions/setup-node@v3 46 | with: 47 | node-version: 18.x 48 | cache: pnpm 49 | 50 | - name: Setup 51 | run: npm i -g @antfu/ni 52 | 53 | - name: Install 54 | run: nci 55 | 56 | - name: Build 57 | run: nr build 58 | 59 | - name: Typecheck 60 | run: nr typecheck 61 | 62 | test: 63 | runs-on: ${{ matrix.os }} 64 | 65 | strategy: 66 | matrix: 67 | node: [16.x, 18.x] 68 | os: [ubuntu-latest, windows-latest, macos-latest] 69 | fail-fast: false 70 | 71 | steps: 72 | - uses: actions/checkout@v3 73 | 74 | - name: Install pnpm 75 | uses: pnpm/action-setup@v2 76 | 77 | - name: Set node ${{ matrix.node }} 78 | uses: actions/setup-node@v3 79 | with: 80 | node-version: ${{ matrix.node }} 81 | cache: pnpm 82 | 83 | - name: Setup 84 | run: npm i -g @antfu/ni 85 | 86 | - name: Install 87 | run: nci 88 | 89 | - name: Build 90 | run: nr build 91 | 92 | - name: Test 93 | run: nr test 94 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .cache 2 | .DS_Store 3 | .idea 4 | *.log 5 | *.tgz 6 | coverage 7 | dist 8 | lib-cov 9 | logs 10 | node_modules 11 | temp 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 webfansplz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
4 | Transforming Vue components to composable functions
5 | (Draw UI with components, Access/Control with composables)
6 |
18 |
19 |
>]: ExtractPropTypes
[PP] 26 | } & { [PP in keyof Pick
>]?: ExtractPropTypes
[PP] }) | (Ref<({ 27 | [PP in keyof Pick
>]: ExtractPropTypes
[PP] 28 | } & { [PP in keyof Pick
>]?: ExtractPropTypes
[PP] })>) : {}) : {}) : FunctionalComponentPropTypes