Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 53d9274

Browse files
committed
chore: init
1 parent 2372dd5 commit 53d9274

21 files changed

+18249
-113
lines changed

.browserslistrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
> 1%
2+
last 2 versions
3+
IE >= 11
4+
not dead

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[*.{js,jsx,ts,tsx,vue}]
2+
indent_style = space
3+
indent_size = 2
4+
trim_trailing_whitespace = true
5+
insert_final_newline = true

.eslintrc.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true
5+
},
6+
extends: [
7+
'plugin:vue/vue3-essential',
8+
'@vue/standard',
9+
'@vue/typescript/recommended'
10+
],
11+
parserOptions: {
12+
ecmaVersion: 2020
13+
},
14+
rules: {
15+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
16+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
17+
'@typescript-eslint/ban-ts-ignore': 'off'
18+
},
19+
overrides: [
20+
{
21+
files: [
22+
'**/__tests__/*.{j,t}s?(x)',
23+
'**/tests/unit/**/*.spec.{j,t}s?(x)'
24+
],
25+
env: {
26+
jest: true
27+
}
28+
}
29+
]
30+
}

.gitignore

Lines changed: 22 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,26 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
8-
9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11-
12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
20-
21-
# Coverage directory used by tools like istanbul
22-
coverage
23-
*.lcov
24-
25-
# nyc test coverage
26-
.nyc_output
27-
28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
33-
34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
38-
build/Release
39-
40-
# Dependency directories
41-
node_modules/
42-
jspm_packages/
43-
44-
# TypeScript v1 declaration files
45-
typings/
46-
47-
# TypeScript cache
48-
*.tsbuildinfo
1+
.DS_Store
2+
node_modules
3+
/dist
494

50-
# Optional npm cache directory
51-
.npm
5+
/tests/e2e/videos/
6+
/tests/e2e/screenshots/
527

53-
# Optional eslint cache
54-
.eslintcache
558

56-
# Microbundle cache
57-
.rpt2_cache/
58-
.rts2_cache_cjs/
59-
.rts2_cache_es/
60-
.rts2_cache_umd/
9+
# local env files
10+
.env.local
11+
.env.*.local
6112

62-
# Optional REPL history
63-
.node_repl_history
64-
65-
# Output of 'npm pack'
66-
*.tgz
67-
68-
# Yarn Integrity file
69-
.yarn-integrity
70-
71-
# dotenv environment variables file
72-
.env
73-
.env.test
74-
75-
# parcel-bundler cache (https://parceljs.org/)
76-
.cache
77-
78-
# Next.js build output
79-
.next
80-
81-
# Nuxt.js build / generate output
82-
.nuxt
83-
dist
84-
85-
# Gatsby files
86-
.cache/
87-
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88-
# https://nextjs.org/blog/next-9-1#public-directory-support
89-
# public
90-
91-
# vuepress build output
92-
.vuepress/dist
93-
94-
# Serverless directories
95-
.serverless/
96-
97-
# FuseBox cache
98-
.fusebox/
99-
100-
# DynamoDB Local files
101-
.dynamodb/
102-
103-
# TernJS port file
104-
.tern-port
13+
# Log files
14+
npm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
17+
pnpm-debug.log*
18+
19+
# Editor directories and files
20+
.idea
21+
.vscode
22+
*.suo
23+
*.ntvs*
24+
*.njsproj
25+
*.sln
26+
*.sw?

README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,34 @@
1-
# vue-diff
1+
# vue-diff
2+
3+
## Project setup
4+
```
5+
npm install
6+
```
7+
8+
### Compiles and hot-reloads for development
9+
```
10+
npm run serve
11+
```
12+
13+
### Compiles and minifies for production
14+
```
15+
npm run build
16+
```
17+
18+
### Run your unit tests
19+
```
20+
npm run test:unit
21+
```
22+
23+
### Run your end-to-end tests
24+
```
25+
npm run test:e2e
26+
```
27+
28+
### Lints and fixes files
29+
```
30+
npm run lint
31+
```
32+
33+
### Customize configuration
34+
See [Configuration Reference](https://cli.vuejs.org/config/).

babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset'
4+
]
5+
}

dev/App.vue

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<template>
2+
<h1>Vue Diff</h1>
3+
<Diff
4+
language="javascript"
5+
:left="left"
6+
:right="right"
7+
/>
8+
</template>
9+
10+
<script lang="ts">
11+
import { defineComponent, reactive } from 'vue'
12+
13+
export default defineComponent({
14+
setup () {
15+
const left = reactive({
16+
code:
17+
`var a = {
18+
"name": "vue-diff",
19+
"version": "0.0.0",
20+
"description": "Vue diff viewer",
21+
"scripts": {
22+
"dev": "vite",
23+
"build": "vite build",
24+
"test:unit": "vue-cli-service test:unit",
25+
"test:e2e": "vue-cli-service test:e2e",
26+
"lint": "vue-cli-service lint"
27+
}
28+
}`
29+
})
30+
31+
const right = reactive({
32+
code:
33+
`var b = {
34+
"name": "vue-diff",
35+
"version": "0.0.1",
36+
"private": true,
37+
"description": "Vue diff viewer",
38+
"scripts": {
39+
"dev": "vite",
40+
"build": "vite build",
41+
"test:unit": "vue-cli-service test:unit",
42+
"test:e2e": "vue-cli-service test:e2e",
43+
"lint": "vue-cli-service lint"
44+
}
45+
}`
46+
})
47+
48+
return { left, right }
49+
}
50+
})
51+
</script>

dev/main.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { createApp } from 'vue'
2+
import App from './App.vue'
3+
import VueDiff from '../src'
4+
5+
const app = createApp(App)
6+
app.use(VueDiff)
7+
app.mount('#app')

dev/shims-vue.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
declare module '*.vue' {
2+
import type { DefineComponent } from 'vue'
3+
const component: DefineComponent
4+
export default component
5+
}

index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Vue Diff</title>
7+
</head>
8+
<body>
9+
<div id="app"></div>
10+
<script type="module" src="/dev/main.ts"></script>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)