Skip to content
This repository was archived by the owner on Mar 17, 2024. It is now read-only.

Commit 1f025ae

Browse files
authored
Merge pull request #6 from xsoulspace/feat/vite
Feat/vite
2 parents daccfc2 + 427fa5e commit 1f025ae

File tree

162 files changed

+1396
-933
lines changed

Some content is hidden

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

162 files changed

+1396
-933
lines changed

.browserslistrc

-3
This file was deleted.

.eslintrc.js

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,28 @@
11
module.exports = {
22
root: true,
33
env: {
4+
browser: true,
5+
es2021: true,
46
node: true,
57
},
68
extends: [
7-
'plugin:vue/vue3-essential',
9+
'plugin:vue/vue3-recommended',
810
'eslint:recommended',
911
'@vue/typescript/recommended',
12+
// 他のルールの下に追加
1013
'@vue/prettier',
1114
'@vue/prettier/@typescript-eslint',
1215
],
1316
parserOptions: {
1417
ecmaVersion: 2021,
1518
},
19+
plugins: [],
1620
rules: {
1721
'no-case-declarations': 'off',
1822
'no-fallthrough': 'off',
1923
quotes: ['error', 'single'],
2024
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
2125
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
26+
'@typescript-eslint/explicit-module-boundary-types': 'off',
2227
},
23-
overrides: [
24-
{
25-
files: [
26-
'**/__tests__/*.{j,t}s?(x)',
27-
'**/tests/unit/**/*.spec.{j,t}s?(x)',
28-
],
29-
env: {
30-
mocha: true,
31-
},
32-
},
33-
],
3428
}

.github/workflows/gh-publish.workflow.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
node-version: 12
1919
registry-url: https://npm.pkg.github.com/
2020
- run: yarn install
21-
- run: yarn build:js
21+
- run: yarn build
2222
- run: npm publish
2323
env:
2424
NODE_AUTH_TOKEN: ${{secrets.GH_PACKAGE}}

.github/workflows/npm-publish.workflow.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
node-version: 12
1919
registry-url: https://registry.npmjs.org/
2020
- run: yarn install
21-
- run: yarn build:js
21+
- run: yarn build
2222
- run: npm publish --access public
2323
env:
2424
NODE_AUTH_TOKEN: ${{secrets.NPM_PACKAGE}}

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ pnpm-debug.log*
1818

1919
# Editor directories and files
2020
.idea
21-
.vscode
2221
*.suo
2322
*.ntvs*
2423
*.njsproj

.prettierrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"trailingComma": "es5",
32
"tabWidth": 2,
43
"semi": false,
54
"singleQuote": true,
65
"printWidth": 80,
7-
"bracketSpacing": true
6+
"bracketSpacing": true,
7+
"vueIndentScriptAndStyle": true
88
}

.vscode/settings.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "esbenp.prettier-vscode"
4+
}

CHANGELOG.md

+74
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,77 @@
1+
## 0.8.0
2+
3+
BREAKING CHANGE: Now package name is `Vuefer`. `vue_flutter_tailwind` will be deprecated as it will reach stable version.
4+
BREAKING CHANGE: Webpack replaced with Vite
5+
BREAKING CHANGE: `MultiProvider.create` replaced to `MultiProvider.build`
6+
BREAKING CHANGE: `Scaffold({})` now builds as `Scaffold.build({})`
7+
BREAKING CHANGE: `Alignment.toOverlay` no is `Alignment.overlay`
8+
9+
feat: Navigation push now can align Dialog(route) window
10+
feat: Drawer
11+
feat: AppBar
12+
feat: Scaffold now has drawer and appBar
13+
14+
To use Drawer you must first initialize somewhere above `Navigation` with `NavigationContorller` as below:
15+
16+
```typescript
17+
MultiProvider.build({
18+
models: [NavigationController],
19+
child: Navigation({
20+
child: ...,
21+
}),
22+
})
23+
```
24+
25+
To open Drawer use
26+
`Scaffold.openDrawer()`
27+
To close Drawer use
28+
`Scaffold.closeDrawer()`
29+
30+
```typescript
31+
Scaffold.build({
32+
drawer: Drawer({
33+
child: Column({
34+
children: [
35+
Text({
36+
text: ref('Drawer header'),
37+
}),
38+
],
39+
}),
40+
}),
41+
appBar: AppBar({
42+
leading: ElevatedButton({
43+
child: Text({
44+
text: ref('='),
45+
}),
46+
onTap: () => {
47+
Scaffold.openDrawer()
48+
},
49+
}),
50+
title: Text({
51+
text: ref('Title'),
52+
}),
53+
actions: [
54+
ElevatedButton({
55+
child: Text({
56+
text: ref('a'),
57+
}),
58+
}),
59+
ElevatedButton({
60+
child: Text({
61+
text: ref('b'),
62+
}),
63+
}),
64+
ElevatedButton({
65+
child: Text({
66+
text: ref('c'),
67+
}),
68+
}),
69+
],
70+
}),
71+
body: Home(),
72+
})
73+
```
74+
175
## 0.7.0
276

377
### feat: MultiDropdownButton

README.md

+45-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
# Vue3 styled like Flutter with Tailwind CSS
1+
# vuefer just a way to write Vue3 styled like Flutter with Tailwind CSS
22

3-
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/xsoulspace/vft)
3+
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/xsoulspace/vuefer)
4+
5+
**Please notice: this project was renamed from vuefer to independent name: vuefer**
46

57
**Please notice: this project is a work in progress and completely experimental!**
68

7-
The reason & motivation why this project have been started is a question: Flutter & Dart awesome! Vue3 & Typescript & Tailwind awesome too!
9+
The reason & motivation why this project have been started is a question: Flutter & Dart awesome! Vue3 & Typescript awesome too!
810

911
But...
1012

1113
Flutter is not working inside Excel:( and its kind of complicated to work with web libraries.
1214

1315
So, what if we will write Vue3 TS in style of Flutter, because it's just simplier and faster?
1416

17+
Purpose: fast prototyping and fast MVP development
18+
1519
Please notice:
1620

1721
- It is **not** a Flutter **at all** and even close, but hopefully will be use its style of components & methods writing.
@@ -34,14 +38,14 @@ Add this package to your package.json file:
3438

3539
```json
3640
"dependencies": {
37-
"@xsoulspace/vue_flutter_tailwind": "next"
41+
"@xsoulspace/vuefer": "next"
3842
}
3943
```
4044

4145
add styling to your main.ts
4246

4347
```typescript
44-
import '@xsoulspace/vue_flutter_tailwind/dist/vft.css'
48+
import '@xsoulspace/vuefer/dist/vft.css'
4549
```
4650

4751
add styling to app div (temporary and will be removed during Scaffold widget refactoring)
@@ -75,7 +79,7 @@ export const wrapperApp = () => {
7579

7680
return Scaffold({
7781
body: Align({
78-
toOverlay: true,
82+
overlay: true,
7983
alignment: Alignment.bottom,
8084
child: Container({
8185
padding,
@@ -306,16 +310,23 @@ MultiProvider.create({
306310
[] Color palette
307311

308312
- [] Scaffold
313+
[x] Drawer
314+
[x] AppBar
315+
316+
- [] Drawer
317+
[x] basic
318+
[] animation
319+
320+
- [] AppBar
321+
[x] basic
309322

310323
## Next
311324

312325
- [] Flexible
313326
- [] OutlinedButton
314327
- [] Ripple
315-
- [] Drawer
316328
- [] Progress
317329
- [] Card
318-
- [] AppBar
319330
- [] Icon
320331
- [] IconButton
321332
- [] Bar
@@ -330,4 +341,29 @@ MultiProvider.create({
330341

331342
# Changelog
332343

333-
Changelog can be found in [Releases](https://github.com/xsoulspace/vue_flutter_tailwind/releases)
344+
Changelog can be found in [Releases](https://github.com/xsoulspace/vuefer/releases)
345+
346+
# Setup with Vue 3 + Typescript + Vite
347+
348+
## Recommended IDE Setup
349+
350+
[VSCode](https://code.visualstudio.com/) + [Vetur](https://marketplace.visualstudio.com/items?itemName=octref.vetur). Make sure to enable `vetur.experimental.templateInterpolationService` in settings!
351+
352+
### If Using `<script setup>`
353+
354+
[`<script setup>`](https://github.com/vuejs/rfcs/pull/227) is a feature that is currently in RFC stage. To get proper IDE support for the syntax, use [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) instead of Vetur (and disable Vetur).
355+
356+
## Type Support For `.vue` Imports in TS
357+
358+
Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can use the following:
359+
360+
### If Using Volar
361+
362+
Run `Volar: Switch TS Plugin on/off` from VSCode command palette.
363+
364+
### If Using Vetur
365+
366+
1. Install and add `@vuedx/typescript-plugin-vue` to the [plugins section](https://www.typescriptlang.org/tsconfig#plugins) in `tsconfig.json`
367+
2. Delete `src/shims-vue.d.ts` as it is no longer needed to provide module info to Typescript
368+
3. Open `src/main.ts` in VSCode
369+
4. Open the VSCode command palette 5. Search and run "Select TypeScript version" -> "Use workspace version"

babel.config.js

-3
This file was deleted.

cypress.json

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

example/index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite App</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>

src/example/HeroButton.tsx renamed to example/src/components/HeroButton.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import { CrossAxisAlignment, EdgeInsetsStep } from '@/abstract'
1+
import { computed, defineComponent, h, ref } from 'vue'
22
import {
3+
CrossAxisAlignment,
4+
EdgeInsetsStep,
35
ElevatedButton,
46
MultiProvider,
57
Row,
68
SizedBox,
79
Text,
8-
} from '@/components'
9-
import { computed, defineComponent, h, ref } from 'vue'
10-
import { HeroesModel } from './HeroesModel'
10+
} from '../../../lib'
11+
import { HeroesModel } from '../models/HeroesModel'
1112

1213
export const HeroButton = () => {
1314
return defineComponent({

example/src/main.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { createApp } from 'vue'
2+
import vueGridLayout from 'vue-grid-layout'
3+
import { MultiProvider, Navigation, NavigationController } from '../../lib'
4+
import '../../lib/index.scss'
5+
import { HeroesModel } from './models/HeroesModel'
6+
// import '../../lib/tailwind.css'
7+
import { ScaffoldApp } from './pages/ScaffoldApp'
8+
9+
const app = MultiProvider.build({
10+
models: [NavigationController, HeroesModel],
11+
child: Navigation({
12+
child: ScaffoldApp,
13+
}),
14+
})
15+
16+
createApp(app).use(vueGridLayout).mount('#app')

src/example/HeroesModel.ts renamed to example/src/models/HeroesModel.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { reactive } from '@vue/reactivity'
2-
import { Maybe } from '..'
1+
import { reactive } from 'vue'
2+
import { Maybe } from '../../../lib'
33
export class Hero {
44
constructor(public name: string) {}
55
}

0 commit comments

Comments
 (0)