Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred-Skyblue committed Mar 8, 2023
0 parents commit d25b2a6
Show file tree
Hide file tree
Showing 19 changed files with 6,042 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
40 changes: 40 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// @ts-check
const { defineConfig } = require('eslint-define-config');

module.exports = defineConfig({
root: true,
env: {
node: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:node/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:vue/base'
],
plugins: ['import'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
sourceType: 'module',
ecmaVersion: 2021,
},
rules: {
'no-debugger': ['error'],
'@typescript-eslint/no-var-requires': 'off',
'node/no-unpublished-require': 'off',
'node/no-extraneous-import': 'off',
'node/no-extraneous-require': 'off',
'node/no-missing-import': 'off',
'node/no-missing-require': 'off',
'no-undef': 'off',
'node/no-unpublished-import': 'off',
'node/no-unsupported-features/es-syntax': 'off',
'no-process-exit': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'no-constant-condition': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
});
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
.idea
.nuxt
.temp
*.log
components.d.ts
dist
node_modules
types
coverage
.eslintcache
.vitepress/cache
.docs
7 changes: 7 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
printWidth: 80,
};
61 changes: 61 additions & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { defineConfig } from 'vitepress';
import { applyPlugins } from '@ruabick/md-demo-plugins';
import { genTemp } from '@ruabick/vite-plugin-gen-temp';
import { genApiDoc } from '@ruabick/vite-plugin-gen-api-doc';
import { sidebar } from './sidebar.js';
import { resolve } from 'path';

export default defineConfig({
lang: 'zh-CN',
lastUpdated: true,
base: process.env.NODE_ENV === 'production' ? '/vue-draggable-plus' : '/',
locales: {
'/': {
lang: 'zh-CN',
title: 'vue-draggable-plus',
description: 'vue3拖拽排序组件',
},
'/en/': {
lang: 'en-US',
title: 'vue-draggable-plus',
description: 'vue3拖拽排序组件',
},
},
themeConfig: {
logo: '/logo.svg',
localeLinks: {
text: '',
items: [
{ text: '简体中文', link: '/' },
{ text: 'English', link: '/en/' },
],
},
nav: [{ text: '指南', link: '/guide' }],
sidebar,
algolia: {},
socialLinks: [
{ icon: 'github', link: 'https://github.com/Alfred-Skyblue/vue-draggable-plus' },
],
},
vue: {},
vite: {
plugins: [genTemp(), genApiDoc()],
resolve: {
alias: {
'vue-draggable-plus': resolve('./src/'),
},
},
},
markdown: {
config: (md) => {
applyPlugins(md);
},
theme: {
light: 'github-light',
dark: 'github-dark',
},
},
buildEnd() {
process.exit(0);
},
});
18 changes: 18 additions & 0 deletions docs/.vitepress/sidebar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export const sidebar = {
'/en/': [
{
text: 'Guide',
items: [
{ text: 'Button', link: '/en/' },
],
},
],
'/': [
{
text: '介绍',
items: [
{ text: '按钮', link: '/' },
],
},
],
};
15 changes: 15 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import DefaultTheme from 'vitepress/theme';
import DemoBlock from '@ruabick/vitepress-demo-block';
import '@ruabick/vitepress-demo-block/dist/style.css';
import './var.css';

export default {
...DefaultTheme,

enhanceApp({ app, router, siteData }) {
// app is the Vue 3 app instance from `createApp()`.
// router is VitePress' custom router. `siteData` is
// a `ref` of current site-level metadata.
app.component('demo', DemoBlock);
},
};
79 changes: 79 additions & 0 deletions docs/.vitepress/theme/var.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
:root {
--vp-code-block-bg: #f9fafb;
/* --vp-code-block-bg: var(--vp-c-bg-alt); */

--vp-code-line-highlight-color: rgba(0, 0, 0, 0.5);
--vp-code-line-number-color: var(--vp-c-text-dark-3);

--vp-code-copy-code-hover-bg: rgba(255, 255, 255, 0.05);
--vp-code-copy-code-active-text: var(--vp-c-bg-alt);

--demi-border-color: #ebedf1;
}

.dark {
--vp-code-block-bg: var(--vp-c-bg-alt);
}

.vp-doc [class*='language-']:before {
color: var(--vp-c-text-2);
}

@media (min-width: 640px) {
.vp-doc div[class*='language-'] {
border-radius: 4px;
margin: 16px 0;
}
}

@media (max-width: 639px) {
.vp-doc div[class*='language-'] {
border-radius: 4px;
}
}

/* 中文字太大了 */
@media (min-width: 640px) {
.name,
.text {
font-size: 28px !important;
}
}

@media (min-width: 960px) {
.name,
.text {
font-size: 32px !important;
}
}

.vp-doc table {
display: table;
width: 100%;
font-size: 15px;
}

.vp-doc tr {
border-top: 1px solid var(--demi-border-color);
}

.vp-doc tr:nth-child(2n) {
background-color: unset;
}

.vp-doc th,
.vp-doc td {
border: 1px solid var(--demi-border-color);
padding: 10px 20px;
}

.vp-doc th {
font-size: 15px;
font-weight: 600;
background-color: var(--vp-c-white-soft);
}

.vp-doc table td:first-child {
font-size: 15px;
font-weight: 600;
}
19 changes: 19 additions & 0 deletions docs/public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "vue-draggable-plus",
"version": "0.0.0",
"description": "vue3拖拽排序组件",
"type": "module",
"types": "./dist/index.d.ts",
"main": "./dist/vue-draggable-plus.umd.cjs",
"module": "./dist/vue-draggable-plus.js",
"exports": {
".": {
"import": "./dist/vue-draggable-plus.js",
"require": "./dist/vue-draggable-plus.umd.cjs"
},
"./dist/style.css": "./dist/style.css"
},
"scripts": {
"dev": "initial-scan docs && vitepress dev .docs --host",
"build": "vite build",
"site:build": "initial-scan docs && cross-env NODE_ENV=production vitepress build .docs",
"serve": "cross-env NODE_ENV=production vitepress serve .docs --host",
"deploy": "gh-pages -d .docs/.vitepress/dist -t true",
"docs-build-deploy": "yarn docs-build && yarn docs-deploy",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
"lint": "eslint src/**/*.{vue,js,ts,tsx}",
"lint-fix": "yarn lint -- --fix",
"release": "np"
},
"keywords": [],
"author": "ypt",
"license": "MIT",
"devDependencies": {
"@algolia/client-search": "^4.15.0",
"@ruabick/md-demo-plugins": "latest",
"@ruabick/vite-plugin-gen-api-doc": "latest",
"@ruabick/vite-plugin-gen-temp": "latest",
"@ruabick/vitepress-demo-block": "latest",
"@typescript-eslint/eslint-plugin": "^5.33.1",
"@typescript-eslint/parser": "^5.33.1",
"@vitejs/plugin-vue": "^3.0.1",
"cross-env": "^7.0.3",
"eslint": "^8.20.0",
"eslint-define-config": "^1.6.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-vue": "^9.9.0",
"gh-pages": "^4.0.0",
"np": "^7.6.2",
"prettier": "^2.7.1",
"typescript": "^4.9.5",
"vite": "latest",
"vite-plugin-dts": "^1.4.0",
"vitepress": "latest",
"vue": "latest",
"vue-eslint-parser": "^9.1.0"
},
"peerDependencies": {
"vue": "latest"
}
}
Loading

0 comments on commit d25b2a6

Please sign in to comment.