Skip to content

Commit b2e49e6

Browse files
committed
ci/cd: changed project structure and add build config
1 parent 641817f commit b2e49e6

File tree

16 files changed

+544
-38
lines changed

16 files changed

+544
-38
lines changed

.github/workflows/actions.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ jobs:
2020
cache: "yarn"
2121
- run: yarn install --frozen-lockfile
2222
- run: yarn test
23-
build-and-deploy:
24-
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
25-
runs-on: ubuntu-latest
26-
steps:
27-
- name: Checkout 🛎️
28-
uses: actions/checkout@v3
23+
# build-and-deploy:
24+
# concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
25+
# runs-on: ubuntu-latest
26+
# steps:
27+
# - name: Checkout 🛎️
28+
# uses: actions/checkout@v3
2929

30-
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
31-
run: |
32-
yarn install --frozen-lockfile
33-
yarn build
34-
- name: Deploy 🚀
35-
uses: JamesIves/github-pages-deploy-action@v4
36-
with:
37-
folder: dist # The folder the action should deploy.
38-
branch: gh-pages
30+
# - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
31+
# run: |
32+
# yarn install --frozen-lockfile
33+
# yarn build
34+
# - name: Deploy 🚀
35+
# uses: JamesIves/github-pages-deploy-action@v4
36+
# with:
37+
# folder: dist # The folder the action should deploy.
38+
# branch: gh-pages

package.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
{
2-
"name": "custom-layout-vue",
3-
"private": true,
4-
"version": "0.0.0",
2+
"name": "@riadh-adrani/custom-layout-vue",
3+
"private": false,
4+
"version": "0.0.1",
55
"type": "module",
6+
"types": "./dist/index.d.ts",
7+
"files": [
8+
"dist"
9+
],
10+
"main": "./dist/clv-umd.js",
11+
"module": "./dist/clv-es.js",
12+
"exports": {
13+
".": {
14+
"import": "./dist/clv-es.js",
15+
"require": "./dist/clv-umd.js"
16+
},
17+
"./dist/style.css": "./dist/style.css"
18+
},
619
"scripts": {
720
"dev": "vite",
821
"build": "vue-tsc && vite build",
@@ -19,6 +32,7 @@
1932
"@vitejs/plugin-vue": "^4.0.0",
2033
"typescript": "^4.9.3",
2134
"vite": "^4.1.0",
35+
"vite-plugin-dts": "^1.7.3",
2236
"vitest": "^0.28.4",
2337
"vue-tsc": "^1.0.24"
2438
}

src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
import { Direction } from "./lib/types";
3-
import { VLayout, useLayout, layout as createLayout, tab as createTab } from "./lib";
2+
import { Direction } from "./components/types";
3+
import { VLayout, useLayout, layout as createLayout, tab as createTab } from "./components";
44
55
const { options } = useLayout(
66
createLayout({
File renamed without changes.

src/lib/VLayout.vue renamed to src/components/VLayout.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ onBeforeUnmount(() => {
254254
@toggle-tab="toggle(item.id)"
255255
@close-tab="close(item.id)"
256256
>
257-
<template #default="props">
258-
<slot name="tab-btn" v-bind="props" />
257+
<template #default="props: TabButtonSlotProps">
258+
<slot name="tab-btn" v-bind="(props as TabButtonSlotProps)" />
259259
</template>
260260
</VTabButton>
261261
</div>
@@ -264,7 +264,7 @@ onBeforeUnmount(() => {
264264
<VTabContent @on-drop="drop">
265265
<slot
266266
name="tab"
267-
v-bind="getTab(options.tree.active!,(options.tree.children as Array<Tab>))"
267+
v-bind="(getTab(options.tree.active!,(options.tree.children as Array<Tab>)) as Tab)"
268268
/>
269269
</VTabContent>
270270
</div>
@@ -274,10 +274,10 @@ onBeforeUnmount(() => {
274274
:key="item.id"
275275
:options="{ tree: item, actions: options.actions }"
276276
>
277-
<template #tab="data">
277+
<template #tab="data: Tab">
278278
<slot name="tab" v-bind="(data as Tab)" />
279279
</template>
280-
<template #tab-btn="props">
280+
<template #tab-btn="props: TabButtonSlotProps">
281281
<slot name="tab-btn" v-bind="(props as TabButtonSlotProps)" />
282282
</template>
283283
</VLayout>
File renamed without changes.
File renamed without changes.

src/components/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { App } from "vue";
2+
import VLayout from "./VLayout.vue";
3+
import VDropZone from "./VDropZone.vue";
4+
import VTabButton from "./VTabButton.vue";
5+
import VTabContent from "./VTabContent.vue";
6+
7+
export * from "./types";
8+
export { default as useLayout, createTab as tab, createLayout as layout } from "./useLayout";
9+
export { VLayout };
10+
11+
export const CLV = {
12+
install(vue: App) {
13+
vue.component("VDropZone", VDropZone);
14+
vue.component("VTabButton", VTabButton);
15+
vue.component("VTabContent", VTabContent);
16+
vue.component("VLayout", VLayout);
17+
},
18+
};
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)