Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Demetrey Iljin committed Dec 1, 2022
1 parent 23d4d27 commit 831d6dc
Show file tree
Hide file tree
Showing 80 changed files with 10,480 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* eslint-env node */
require("@rushstack/eslint-patch/modern-module-resolution");

module.exports = {
root: true,
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/eslint-config-typescript",
"@vue/eslint-config-prettier",
],
overrides: [
{
files: ["cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}"],
extends: ["plugin:cypress/recommended"],
},
],
parserOptions: {
ecmaVersion: "latest",
},
};
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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?

# Custom Files
2Do.txt
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"printWidth": 120
}
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"Vue.volar",
"Vue.vscode-typescript-vue-plugin",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
]
}
125 changes: 123 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,123 @@
# dim-vue3-template
Vue 3 + Vite Starter
# Vue 3 Starter

- [Vue 3](https://vuejs.org/) + [Vite](https://vitejs.dev/) Minimalistic Starter Template
- Uses [TypeScript](https://www.typescriptlang.org/) and [Script Setup SFC](https://vuejs.org/api/sfc-script-setup.html)
<br/><br/>

## Features

- Full configured and ready
- No complex || heavy dependencies
- Atomic Design Patter
- Pre-configured HTML index page (including SEO-metatags and No-Script section)
- Prepared public folder (icons, robots.txt, htaccess, humans.txt, etc)
- CSS normalization
- SCSS Maps and Modules in global scope
- Configured router (including transitions, navigation guards and 404 page)
- Simple code examples for Storage, Composables, TypeScript, Modules
- ESLint + Prettier for better code quality
- Cypress + Vitest for testing
<br/><br/>

## Preview

[Live Demo](http://vue3-template.demetrey.ru/)
<br/>
<br/>
![image](/public/cover.jpg)

<br/><br/>

## Requirements

- [Node.js](https://nodejs.org/en/): >= 16.11.0
- [npm](https://www.npmjs.com/): >= 6.32.4
<br/><br/>

## Recommended IDE

- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar)
<br/><br/>

## Installed Modules

- [Pinia](https://pinia.vuejs.org/) &rarr; Storage
- [Axios](https://axios-http.com/) &rarr; Promise based HTTP client
- [VueUse](https://vueuse.org/) &rarr; Best Collection of Vue Composition Utilities
- [SASS](https://sass-lang.com/) &rarr; CSS Preprocessor
- [ESLint](https://eslint.org/) + [Prettier](https://prettier.io/) &rarr; linting and code formatting
- [Cypress](https://www.cypress.io/) &rarr; End-to-End (e2e) testing framework
- [Vitest](https://vitest.dev/) &rarr; Unit testing framework
<br/><br/>

## Scripts

### Clone repo

```bash
git clone https://github.com/Demetory/dim-vue3-template
```

### Install and update dependencies

```bash
npm install
```

Update deps if needed

```bash
npm update
```

### Development

Start the development server on http://localhost:5173

```bash
npm run dev
```

### Build for Production

Build with type-check:

```bash
npm run build
```

or just for build only

```bash
npm run build-only
```

### Linting

```bash
npm run lint
```

```bash
npm run type-check
```

### Testing

Vitest unit testing

```bash
npm run test:unit
```

Cypress e2e-testing

```bash
npm run test:e2e
```

<br/><br/>

## License

MIT [@demetory](https://demetrey.ru)
8 changes: 8 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from "cypress";

export default defineConfig({
e2e: {
specPattern: "cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}",
baseUrl: "http://localhost:4173",
},
});
8 changes: 8 additions & 0 deletions cypress/e2e/example.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// https://docs.cypress.io/api/introduction/api.html

describe("My First Test", () => {
it("visits the app root url", () => {
cy.visit("/");
cy.contains("h1", "You did it!");
});
});
10 changes: 10 additions & 0 deletions cypress/e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "@vue/tsconfig/tsconfig.web.json",
"include": ["./**/*", "../support/**/*"],
"compilerOptions": {
"isolatedModules": false,
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress"]
}
}
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
39 changes: 39 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/// <reference types="cypress" />
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
// declare global {
// namespace Cypress {
// interface Chainable {
// login(email: string, password: string): Chainable<void>
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }

export {};
20 changes: 20 additions & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import "./commands";

// Alternatively you can use CommonJS syntax:
// require('./commands')
1 change: 1 addition & 0 deletions env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
53 changes: 53 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<!--
design the planet
_/_/_/_/_/_/
_/_/ _/_/
_/_/ _/_/
_/_/ _/_/_/
_/_/ _/_/
_/_/ _/_/ _/_/
_/_/_/_/_/_/ _/_/
demetrey.ru
-->
<title>Dim Vue3 Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Dim Vue3 Starter Template" />

<meta property="og:title" content="Demetory - Design the Planet" />
<meta property="og:type" content="website" />
<meta property="og:url" content="/" />
<meta property="og:image" content="/cover.jpg" />

<link rel="author" href="/humans.txt" />
<link rel="manifest" href="/site.webmanifest" />
<link rel="apple-touch-icon" href="/icon.png" />
<link rel="icon" href="/favicon.ico" />

<link rel="stylesheet" href="/css/reset.css" />
<link rel="stylesheet" href="/css/noscript.css" />
</head>

<body>
<!--noindex-->
<noscript>
<img src="/images/fatality.svg" />
<div>
<h1>Easy, Tiger</h1>
<p>Turn JavaScript on, don't be so paraniod.</p>
</div>
</noscript>
<!--/noindex-->

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

<!-- #StandWithUkraine -->
</html>
Loading

0 comments on commit 831d6dc

Please sign in to comment.