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

Commit 80c0f73

Browse files
authored
Merge pull request #255 from asigloo/feature/change-to-vite
Feature/change to vite
2 parents 1c0e3c2 + 0aea046 commit 80c0f73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+8751
-1037
lines changed

.github/workflows/ci.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
1616
with:
1717
node-version: 12
1818
- name: Install dependencies
19-
run: npm ci
20-
- name: Run unit tests
21-
run: npm run test --verbose
19+
run: yarn
2220
- name: Build Library
23-
run: npm run build
21+
run: yarn build

.github/workflows/release.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,12 @@ jobs:
1616
with:
1717
node-version: 12
1818
- name: Install dependencies
19-
run: npm ci
20-
- name: Run unit tests
21-
run: npm run test --verbose
19+
run: yarn
2220
- name: Build Library
23-
run: npm run build
24-
- name: Build Types Declarations
25-
run: npm run build:dts
21+
run: yarn build
2622
- name: Release
2723
env:
2824
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2925
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3026
CI: true
31-
run: npm run semantic-release
27+
run: yarn semantic-release

.husky/pre-commit

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
#!/bin/sh
22
. "$(dirname $0)/_/husky.sh"
33

4-
npm run lint

.husky/pre-push

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname $0)/_/husky.sh"
33

4-
npm test
4+

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export default defineComponent({
148148

149149
We've prepared some demos to show different use cases of the library and how to use each type of input field.
150150

151-
To check them just run the command bellow which run the app at `http://localhost:6044/ `
151+
To check them just run the command bellow which run the app at `http://localhost:3000/ `
152152

153153
```
154154
yarn run serve

cypress.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"baseUrl": "http://localhost:6044",
2+
"baseUrl": "http://localhost:3000",
33
"pluginsFile": "tests/e2e/plugins/index.js",
44
"testFiles": "**/*.e2e.js*"
55
}

demos/vue-3/public/index.html

-17
This file was deleted.

demos/vue-3/src/App.vue

+7-13
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
1-
<template>
2-
<div id="app">
3-
<Toolbar />
4-
<router-view />
5-
</div>
6-
</template>
7-
81
<script lang="ts">
92
import { defineComponent } from 'vue';
10-
import Toolbar from './components/Toolbar.vue';
11-
12-
const components = {
13-
Toolbar,
14-
};
153
164
export default defineComponent({
175
name: 'app',
18-
components,
196
});
207
</script>
8+
9+
<template>
10+
<div id="app">
11+
<Toolbar />
12+
<router-view />
13+
</div>
14+
</template>

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

+3-8
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

-65
This file was deleted.

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

+17-25
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

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { createApp } from 'vue';
22
import App from './App.vue';
3-
import './styles/main.scss';
3+
import './styles/main.css';
44
import router from './router';
55

6-
import { createDynamicForms } from '../../../src';
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');

demos/vue-3/src/styles/_vendors.css

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
/* @import '/@/styles/themes/default.scss'; */

demos/vue-3/src/styles/_vendors.scss

-7
This file was deleted.
File renamed without changes.

demos/vue-3/src/styles/main.css

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@import './_vendors';
2+
@import './base';

demos/vue-3/src/styles/main.scss

-9
This file was deleted.

demos/vue-3/src/views/Basic.vue

+41-35
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,9 @@
1-
<template>
2-
<div class="page container">
3-
<div class="mx-auto w-full sm:w-1/2 relative mb-24">
4-
<div
5-
class="absolute inset-0 bg-gradient-to-r from-blue-400 to-green-200 shadow-xl transform -skew-y-3 sm:skew-y-0 sm:-rotate-3 sm:rounded-3xl"
6-
></div>
7-
<div class="relative card p-6 bg-white">
8-
<DynamicForm
9-
:form="form"
10-
@submitted="handleSubmit"
11-
@change="valueChanged"
12-
@error="handleError"
13-
/>
14-
<button
15-
data-cy="submit"
16-
class="btn bg-green-500 text-white hover:bg-green-700 mt-4"
17-
submit="true"
18-
:form="form?.id"
19-
>
20-
Try me
21-
</button>
22-
</div>
23-
</div>
24-
<div class="mx-auto w-full sm:w-1/2"><Console :content="formValues" /></div>
25-
</div>
26-
</template>
27-
281
<script lang="ts">
29-
import { CheckboxField, TextField, SelectField } from '@/';
2+
import { CheckboxField, TextField, SelectField } from '/@/';
303
import { computed, defineComponent, reactive } from 'vue';
31-
import Console from '../components/Console.vue';
324
33-
const components = {
34-
Console,
35-
};
36-
/* } from '../../dist/as-dynamic-forms.esm'; */
375
export default defineComponent({
386
name: 'BasicDemo',
39-
components,
407
setup() {
418
const formValues = reactive({});
429
@@ -92,4 +59,43 @@ export default defineComponent({
9259
},
9360
});
9461
</script>
95-
<style lang="scss"></style>
62+
<template>
63+
<div class="page container">
64+
<div class="mx-auto w-full sm:w-1/2 relative mb-24">
65+
<div
66+
class="
67+
absolute
68+
inset-0
69+
bg-gradient-to-r
70+
from-blue-400
71+
to-green-200
72+
shadow-xl
73+
transform
74+
-skew-y-3
75+
sm:skew-y-0 sm:-rotate-3 sm:rounded-3xl
76+
"
77+
></div>
78+
<div class="relative card p-6 bg-white">
79+
<DynamicForm
80+
:form="form"
81+
@submitted="handleSubmit"
82+
@change="valueChanged"
83+
@error="handleError"
84+
/>
85+
<button
86+
data-cy="submit"
87+
class="btn bg-green-500 text-white hover:bg-green-700 mt-4"
88+
submit="true"
89+
:form="form?.id"
90+
>
91+
Try me
92+
</button>
93+
</div>
94+
</div>
95+
<div class="mx-auto w-full sm:w-1/2"><Console :content="formValues" /></div>
96+
</div>
97+
</template>
98+
99+
<style lang="scss">
100+
@import '/@/styles/themes/default.scss';
101+
</style>

0 commit comments

Comments
 (0)