Skip to content

Commit

Permalink
feat: kanri setup folder
Browse files Browse the repository at this point in the history
  • Loading branch information
DiarCode committed Jun 25, 2024
1 parent 93ad481 commit da26a9b
Show file tree
Hide file tree
Showing 25 changed files with 8,645 additions and 0 deletions.
73 changes: 73 additions & 0 deletions kanri/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
root: true,
extends: [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/typescript/recommended', // Recommended TypeScript rules for Vue
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier
],
plugins: ['import', 'vue'],
overrides: [
{
files: ['e2e/**/*.{test,spec}.{js,ts,jsx,tsx}'],
extends: ['plugin:playwright/recommended'],
},
],
rules: {
// TypeScript specific rules
'@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }],
'@typescript-eslint/no-unused-vars': 'error',

// General ESLint rules
'vue/no-unused-components': 'error',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', ['parent', 'sibling', 'index']],
'newlines-between': 'always',
},
],
'import/first': 'error',
'import/no-duplicates': 'error',

// Best Practices
'vue/require-default-prop': 'error',
'vue/require-prop-types': 'error',
'vue/require-v-for-key': 'error',
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
'vue/html-closing-bracket-newline': ['error', { singleline: 'never', multiline: 'always' }],

// Code style
'vue/max-attributes-per-line': [
'error',
{
'singleline': {
'max': 1,
},
'multiline': {
'max': 1,
},
},
],
'vue/html-closing-bracket-spacing': 'error',
'vue/no-multi-spaces': 'error',

// ESLint best practices
'no-console': 'warn',
'no-unused-vars': 'warn',
'no-undef': 'error',

// TypeScript ESLint plugin
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2023,
sourceType: 'module',
},
}
33 changes: 33 additions & 0 deletions kanri/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

*.tsbuildinfo

test-results/
playwright-report/
16 changes: 16 additions & 0 deletions kanri/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"trailingComma": "all",
"tabWidth": 2,
"useTabs": true,
"semi": false,
"bracketSpacing": true,
"singleQuote": true,
"jsxSingleQuote": true,
"quoteProps": "preserve",
"arrowParens": "avoid",
"singleAttributePerLine": true,
"embeddedLanguageFormatting": "off",
"endOfLine": "auto",
"printWidth": 100
}
64 changes: 64 additions & 0 deletions kanri/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# kanri

This template should help get you started developing with Vue 3 in Vite.

## Recommended IDE Setup

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).

## Type Support for `.vue` Imports in TS

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 [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.

## Customize configuration

See [Vite Configuration Reference](https://vitejs.dev/config/).

## Project Setup

```sh
npm install
```

### Compile and Hot-Reload for Development

```sh
npm run dev
```

### Type-Check, Compile and Minify for Production

```sh
npm run build
```

### Run Unit Tests with [Vitest](https://vitest.dev/)

```sh
npm run test:unit
```

### Run End-to-End Tests with [Playwright](https://playwright.dev)

```sh
# Install browsers for the first run
npx playwright install

# When testing on CI, must build the project first
npm run build

# Runs the end-to-end tests
npm run test:e2e
# Runs the tests only on Chromium
npm run test:e2e -- --project=chromium
# Runs the tests of a specific file
npm run test:e2e -- tests/example.spec.ts
# Runs the tests in debug mode
npm run test:e2e -- --debug
```

### Lint with [ESLint](https://eslint.org/)

```sh
npm run lint
```
4 changes: 4 additions & 0 deletions kanri/e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"include": ["./**/*"]
}
8 changes: 8 additions & 0 deletions kanri/e2e/vue.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { test, expect } from '@playwright/test'

// See here how to get started:
// https://playwright.dev/docs/intro
test('visits the app root url', async ({ page }) => {
await page.goto('/')
await expect(page.locator('div.greetings > h1')).toHaveText('You did it!')
})
1 change: 1 addition & 0 deletions kanri/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
13 changes: 13 additions & 0 deletions kanri/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Loading

0 comments on commit da26a9b

Please sign in to comment.