Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 762d639

Browse files
committed
feat(build): library build and demos with vite
1 parent 456d1fb commit 762d639

File tree

18 files changed

+212
-693
lines changed

18 files changed

+212
-693
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ jobs:
2121
run: npm run test --verbose
2222
- name: Build Library
2323
run: npm run build
24-
- name: Build Types Declarations
25-
run: npm run build:dts
2624
- name: Release
2725
env:
2826
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

demos/vue-3/src/App.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
<script lang="ts">
22
import { defineComponent } from 'vue';
3-
import Toolbar from './components/Toolbar.vue';
4-
5-
const components = {
6-
Toolbar,
7-
};
83
94
export default defineComponent({
105
name: 'app',
11-
components,
126
});
137
</script>
8+
149
<template>
1510
<div id="app">
1611
<Toolbar />

demos/vue-3/src/components/Console.vue

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
<li class="rounded w-2 h-2 bg-yellow-300 inline-block mr-1"></li>
66
<li class="rounded w-2 h-2 bg-green-500 inline-block"></li>
77
</ul>
8-
<pre
9-
data-cy="form-values"
10-
class="shadow-lg pt-4"
11-
:data-formValues="jsonValues"
12-
>{{ content }}</pre
13-
>
8+
<pre data-cy="form-values" class="pt-4" :data-formValues="jsonValues">{{
9+
content
10+
}}</pre>
1411
</div>
1512
</template>
1613

@@ -32,5 +29,3 @@ export default defineComponent({
3229
},
3330
});
3431
</script>
35-
36-
<style></style>

demos/vue-3/src/components/Icon.vue

Lines changed: 0 additions & 65 deletions
This file was deleted.

demos/vue-3/src/components/Toolbar.vue

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,21 @@
99
</h1>
1010
</div>
1111
<div class="right-nav">
12-
<ul class="flex align-center">
13-
<li v-for="nav in navs" :key="nav.name" class="ml-4">
14-
<a :href="nav.href" class="hover:text-green-400 transition-colors">
15-
<Icon :name="nav.icon" :alt="nav.name" />
12+
<ul class="flex align-center text-xl">
13+
<li class="ml-4">
14+
<a
15+
href="https://github.com/asigloo/vue-dynamic-forms"
16+
class="text-gray-500 hover:text-green-400 transition-colors"
17+
>
18+
<codicon-github />
19+
</a>
20+
</li>
21+
<li class="ml-4">
22+
<a
23+
href="https://vue-dynamic-forms.alvarosaburido.dev/"
24+
class="text-gray-500 hover:text-green-400 transition-colors"
25+
>
26+
<ion-document-text-outline />
1627
</a>
1728
</li>
1829
</ul>
@@ -21,35 +32,16 @@
2132
</template>
2233

2334
<script lang="ts">
24-
import { computed, defineComponent, ref } from 'vue';
25-
import Icon from './Icon.vue';
35+
import { computed, defineComponent } from 'vue';
2636
import { useRoute } from 'vue-router';
2737
28-
const components = {
29-
Icon,
30-
};
31-
3238
export default defineComponent({
3339
name: 'toolbar',
34-
components,
3540
setup() {
3641
const route = useRoute();
3742
const title = computed(() => route.meta.title || 'Vue Dynamic Forms');
3843
39-
const navs = ref([
40-
{
41-
icon: 'github',
42-
name: 'Repo',
43-
href: 'https://github.com/asigloo/vue-dynamic-forms',
44-
},
45-
{
46-
icon: 'docs',
47-
name: 'Docs',
48-
href: 'https://vue-dynamic-forms.alvarosaburido.dev/',
49-
},
50-
]);
51-
52-
return { title, navs };
44+
return { title };
5345
},
5446
});
5547
</script>

demos/vue-3/src/main.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import App from './App.vue';
33
import './styles/main.css';
44
import router from './router';
55

6-
import { createDynamicForms } from '/@/';
6+
/* import { createDynamicForms } from '/@'; */
7+
8+
import { createDynamicForms } from '../../../dist/as-dynamic-forms.es';
79

810
const VueDynamicForms = createDynamicForms({
911
autoValidate: true,
@@ -17,6 +19,8 @@ const VueDynamicForms = createDynamicForms({
1719

1820
export const app = createApp(App);
1921

22+
console.log({ app });
23+
2024
app.use(VueDynamicForms);
2125

2226
app.use(router).mount('#app');

package.json

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"author": "Alvaro Saburido <[email protected]>",
66
"scripts": {
77
"dev": "vite",
8-
"build": "vite build",
9-
"build:lib": "vite build --config vite-lib.config.js",
8+
"build:demo": "vite build",
9+
"build": "vite build --config vite-lib.config.ts",
1010
"serve": "vite preview",
1111
"test:unit": "vue-cli-service test:unit",
1212
"test:e2e": "vue-cli-service test:e2e",
@@ -21,20 +21,23 @@
2121
"test:watch": "vue-cli-service test:unit --verbose --no-cache --watchAll"
2222
},
2323
"main": "dist/as-dynamic-forms.cjs.js",
24-
"module": "dist/as-dynamic-forms.esm-bundler.js",
25-
"browser": "dist/as-dynamic-forms.esm.js",
26-
"unpkg": "dist/as-dynamic-forms.global.js",
24+
"module": "dist/as-dynamic-forms.es.js",
25+
"browser": "dist/as-dynamic-forms.es.js",
26+
"unpkg": "dist/as-dynamic-forms.iife.js",
27+
"jsdelivr": "dist/as-dynamic-forms.iife.js",
28+
"exports": {
29+
".": {
30+
"import": "./dist/as-dynamic-forms.es.js",
31+
"require": "./dist/as-dynamic-forms.umd.js"
32+
}
33+
},
2734
"dependencies": {
2835
"deep-clone": "^3.0.3",
2936
"deep-object-diff": "^1.1.0"
3037
},
3138
"devDependencies": {
39+
"@iconify/json": "^1.1.373",
3240
"@microsoft/api-extractor": "^7.18.1",
33-
"@rollup/plugin-alias": "^3.1.2",
34-
"@rollup/plugin-buble": "^0.21.3",
35-
"@rollup/plugin-commonjs": "^19.0.0",
36-
"@rollup/plugin-node-resolve": "^13.0.0",
37-
"@rollup/plugin-replace": "^2.4.2",
3841
"@types/jest": "^26.0.24",
3942
"@typescript-eslint/eslint-plugin": "^4.28.2",
4043
"@typescript-eslint/parser": "^4.28.2",
@@ -45,7 +48,6 @@
4548
"babel-core": "7.0.0-bridge.0",
4649
"babel-eslint": "10.1.0",
4750
"babel-jest": "27.0.6",
48-
"chalk": "^4.1.1",
4951
"cypress": "^7.7.0",
5052
"eslint": "7.30.0",
5153
"eslint-plugin-prettier": "^3.4.0",
@@ -57,25 +59,22 @@
5759
"postcss": "^8.3.5",
5860
"prettier": "2.3.2",
5961
"rollup": "^2.53.0",
60-
"rollup-plugin-analyzer": "^4.0.0",
61-
"rollup-plugin-bundle-size": "^1.0.3",
6262
"rollup-plugin-copy": "^3.4.0",
63-
"rollup-plugin-scss": "^3.0.0",
64-
"rollup-plugin-terser": "^7.0.2",
6563
"rollup-plugin-typescript2": "^0.30.0",
66-
"rollup-plugin-vue": "^6.0.0",
6764
"sass": "^1.35.2",
6865
"semantic-release": "17.4.4",
6966
"tailwindcss": "^2.2.4",
7067
"tailwindcss-animatecss": "^1.0.7",
7168
"ts-node": "^10.1.0",
7269
"typescript": "~4.3.5",
7370
"vite": "^2.4.1",
71+
"vite-plugin-components": "^0.12.2",
72+
"vite-plugin-dts": "^0.5.2",
73+
"vite-plugin-icons": "^0.6.5",
7474
"vue": "^3.1.4",
7575
"vue-jest": "^5.0.0-alpha.8",
7676
"vue-router": "^4.0.1",
7777
"vue-select": "3.11.2"
7878
},
79-
"jsdelivr": "dist/as-dynamic-forms.global.js",
8079
"types": "dist/as-dynamic-forms.d.ts"
8180
}

0 commit comments

Comments
 (0)