Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite + Vue 3 Migration #1

Merged
merged 45 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
3ff54f6
initial migration
Maurier Feb 5, 2024
cdc0a8e
address type errors
Maurier Feb 6, 2024
9d2a81c
addressing typescript errors
Maurier Feb 6, 2024
f8f7872
addressing more typescript errors
Maurier Feb 6, 2024
cdebfab
swap lodash for lodash-es
Maurier Feb 6, 2024
b8453ef
improve menu layout
Maurier Feb 6, 2024
45f1f89
fix mapping of failed upload response
Maurier Feb 6, 2024
9229601
add file name override param
Maurier Feb 6, 2024
74152d6
addressing typescript errors
Maurier Feb 26, 2024
db4c350
addressing typescript errors
Maurier Feb 27, 2024
142208b
initial vite + vue 3 migration
Maurier Mar 3, 2024
d870e90
migration changes and refactoring
Maurier Mar 3, 2024
abff1e1
migration changes
Maurier Mar 3, 2024
221e276
updating combinator renderer lookup logic
Maurier Mar 4, 2024
fe18a70
handle combinator fitting schema on create
Maurier Mar 4, 2024
4f9541f
make use of v-field in cz-fieldset component
Maurier Mar 4, 2024
2852a10
migration changes
Maurier Mar 4, 2024
b8f2bdd
migration changes
Maurier Mar 4, 2024
aa2103c
add object renderer default value
Maurier Mar 5, 2024
0fd6fef
handle tags clear
Maurier Mar 5, 2024
bec9f97
handle default object renderer value
Maurier Mar 5, 2024
c941c01
minor style changes
Maurier Mar 5, 2024
d2e75cd
treeview migration changes
Maurier Mar 19, 2024
e8cf445
refactoring
Maurier Mar 25, 2024
dddb25a
drag select migration changes
Maurier Mar 25, 2024
5d3ec16
add workaround for no longer exposed treeview variables
Maurier Mar 26, 2024
3eff9ee
resolve fontawesome icon set
Maurier Mar 26, 2024
d29a6bc
add favicon and update dependencies
Maurier Apr 2, 2024
cb7b326
add drag event handler conditionals
Maurier Apr 8, 2024
3016ffe
update dependencies and change build formats
Maurier Apr 11, 2024
fc860a5
refactor renderer entry exports
Maurier Apr 11, 2024
7e0ffc3
build tweaks
Maurier Apr 12, 2024
349fb6e
add time picker and update dependencies
Maurier May 15, 2024
e2ab26a
use custom activation strategy
Maurier May 30, 2024
8fc380f
refactor file explorer item
Maurier May 31, 2024
b52b43f
fix styling of context menu
Maurier May 31, 2024
8226a73
add select area context menu
Maurier May 31, 2024
4e9d44e
add paste highlight
Maurier May 31, 2024
625901f
integrate file explorer upload
Maurier Jun 3, 2024
b313002
add touch event conditionals
Maurier Jun 3, 2024
423de25
feat: add valid items property
Maurier Jul 5, 2024
122b46d
fix: new folder default uploaded state
Maurier Jul 5, 2024
11d457f
fix: deleting newly created folder
Maurier Jul 5, 2024
a9d8ee2
fix: rename event handler
Maurier Jul 8, 2024
57563f0
bump dependencies
Maurier Jul 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .env

This file was deleted.

1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_APP_GOOGLE_MAPS_API_KEY=
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.vscode/
.yarn/
coverage/
dist/
public/assets/
tsconfig.*.json
components.d.ts
96 changes: 96 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
env:
browser: true
es2021: true
extends:
- plugin:vue/recommended
- standard-with-typescript
- plugin:import/recommended
- plugin:import/typescript
- plugin:vuejs-accessibility/recommended
- plugin:yaml/recommended
- '@vue/eslint-config-prettier'
parser: vue-eslint-parser
parserOptions:
ecmaVersion: latest
parser: '@typescript-eslint/parser'
sourceType: module
createDefaultProgram: true
project:
- ./tsconfig.app.json
- ./tsconfig.node.json
- ./tsconfig.vitest.json
extraFileExtensions:
- .vue
plugins:
- import
- tsdoc
- html
- yaml
- vue
rules:
require-jsdoc: warn
no-unused-vars: warn
'@typescript-eslint/array-type':
- error
- default: array # const lines: string[] = []; style
'@typescript-eslint/ban-ts-comment': off # Enable @ts-ignore etc.
'@typescript-eslint/consistent-generic-constructors':
- error
- type-annotation # Left-hand side style
'@typescript-eslint/consistent-type-imports': # Enable import sort order, see bellow.
- off
- prefer: type-imports
'@typescript-eslint/explicit-function-return-type': off # Fix for pinia
'@typescript-eslint/no-confusing-void-expression':
- error
- ignoreArrowShorthand: true # Allow short land for pretter
'@typescript-eslint/strict-boolean-expressions': off # Fix for vite import.meta.env
'@typescript-eslint/triple-slash-reference': off # Fix for vite env.d.ts.
import/default: off # Fix for Vue setup style
import/no-default-export: off # Fix for Vue setup style
import/order: # Sort Import Order. see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md#importorder-enforce-a-convention-in-module-import-order
- error
- groups:
['builtin', 'external', 'parent', 'sibling', 'index', 'object', 'type']
pathGroups:
# Vue Core
- pattern: '{vue,vue-router,vuex,@/store,vue-i18n,pinia,vite,vitest,vitest/**,@vitejs/**,@vue/**,@logue/vue2-helpers}'
group: external
position: before
# UI Library
- pattern: '{vuetify,vuetify/**,@mdi/**,webfontloader}'
group: parent
position: before
# Internal Codes
- pattern: '{@/**}'
group: internal
position: before
pathGroupsExcludedImportTypes:
- builtin
alphabetize:
order: asc
newlines-between: ignore
tsdoc/syntax: warn
vue/html-self-closing: # A tag with no content should be written like <br />.
- error
- html:
void: always
vue/multi-word-component-names: warn # Mitigate non-multiword component name errors to warnings.
settings:
import/parsers:
'@typescript-eslint/parser':
- .ts
vue-eslint-parser:
- .vue
import/resolver:
typescript: true
alias:
map:
- ['@', './src']
- ['~', './node_modules']
extensions:
- .js
- .ts
- .vue
vite:
configPath: ./vite.config.ts
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
25 changes: 13 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
.DS_Store
node_modules
/dist
lib
stats.html

# local env files
.env.local
.env.*.local

# Log files
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
coverage
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.vscode
.DS_Store
*.suo
*.ntvs*
*.njsproj
Expand Down
10 changes: 10 additions & 0 deletions .ncurc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
upgrade: true
reject:
- '@vue/test-utils'
- eslint-plugin-vuetify
- sass
- vue
- vue-router
- vue-template-compiler
- vuetify
- vuex
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.vscode/
.yarn/
dist/
coverage/
public/assets/
components.d.ts
11 changes: 11 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
printWidth: 80
tabWidth: 2
useTabs: false
semi: true
singleQuote: true
trailingComma: es5
bracketSpacing: true
bracketSameLine: false
arrowParens: avoid
htmlWhitespaceSensitivity: ignore
endOfLine: lf
5 changes: 5 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.vscode/
.yarn/
coverage/
dist/
public/assets/
14 changes: 14 additions & 0 deletions .stylelintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
customSyntax: postcss-html
extends:
- stylelint-config-html/vue
- stylelint-config-recommended-scss
- stylelint-config-recommended-vue/scss
plugins:
- stylelint-scss
ignoreFiles:
- 'dist/**/*'
rules:
color-function-notation: legacy
function-no-unknown: null
no-descending-specificity: null
scss/no-global-function-names: null
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
// "Vue.volar",
"Vue.vscode-typescript-vue-plugin",
"octref.vetur"
]
}
32 changes: 13 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
# cznet-vue-core
# Vue 3 + TypeScript + Vite

## Project setup
```
npm install
```
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

### Compiles and hot-reloads for development
```
npm run serve
```
## Recommended IDE Setup

### Compiles and minifies for production
```
npm run build
```
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

### Lints and fixes files
```
npm run lint
```
## Type Support For `.vue` Imports in TS

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:

1. Disable the built-in TypeScript Extension
1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
19 changes: 0 additions & 19 deletions babel.config.js

This file was deleted.

16 changes: 16 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" href="/czcnet_logo_circle.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CZNet Vue 3 Core</title>
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>

</html>
21 changes: 21 additions & 0 deletions license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright © 2022 Faizal Andyka

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading