inital commit.

This commit is contained in:
Miroslav Šedivý 2020-11-05 11:56:26 +01:00
commit fa28f2c6ee
12 changed files with 15312 additions and 0 deletions

3
.babelrc Normal file
View File

@ -0,0 +1,3 @@
{
"presets": ["@vue/cli-plugin-babel/preset"]
}

9
.editorconfig Normal file
View File

@ -0,0 +1,9 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

17
.eslintrc Normal file
View File

@ -0,0 +1,17 @@
{
"root": true,
"env": {
"node": true
},
"extends": ["plugin:vue/essential", "@vue/prettier", "@vue/typescript"],
"parserOptions": {
"parser": "@typescript-eslint/parser"
},
"rules": {
"vue/valid-v-for": "off",
"no-case-declarations": "off",
"no-dupe-class-members": "off",
"no-console": "off",
"no-empty": "off"
}
}

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules
dist

8
.prettierrc Normal file
View File

@ -0,0 +1,8 @@
{
"semi": false,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2,
"vueIndentScriptAndStyle": true
}

15059
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

70
package.json Normal file
View File

@ -0,0 +1,70 @@
{
"name": "neko-component",
"version": "1.0.0",
"description": "Client as reusable Vue.js component for neko streaming server.",
"main": "dist/neko.umd.js",
"module": "dist/neko.esm.js",
"unpkg": "dist/neko.min.js",
"browser": {
"./sfc": "src/Neko.vue"
},
"scripts": {
"serve": "vue-cli-service serve --mode development",
"build:spa": "vue-cli-service build",
"lint": "vue-cli-service lint",
"build": "npm run build:umd & npm run build:es & npm run build:unpkg",
"build:umd": "rollup --config rollup.config.js --format umd --file dist/neko.umd.js",
"build:es": "rollup --config rollup.config.js --format es --file dist/neko.esm.js",
"build:unpkg": "rollup --config rollup.config.js --format iife --file dist/neko.min.js"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.14.0",
"axios": "^0.19.1",
"eventemitter3": "^4.0.7",
"resize-observer-polyfill": "^1.5.1",
"sweetalert2": "^9.17.2",
"typed-vuex": "^0.1.21",
"v-tooltip": "^2.0.3",
"vue": "^2.6.12",
"vue-class-component": "^7.2.6",
"vue-context": "^5.2.0",
"vue-i18n": "^8.21.1",
"vue-notification": "^1.3.20",
"vue-property-decorator": "^8.5.1",
"vuex": "^3.5.1"
},
"devDependencies": {
"@rollup/plugin-alias": "^3.1.1",
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-commonjs": "^16.0.0",
"@types/node": "^13.13.30",
"@types/vue": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0",
"@vue/cli-plugin-babel": "^4.5.6",
"@vue/cli-plugin-eslint": "^4.5.6",
"@vue/cli-plugin-typescript": "^4.5.8",
"@vue/cli-plugin-vuex": "^4.5.6",
"@vue/cli-service": "^4.5.6",
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/eslint-config-typescript": "^5.1.0",
"eslint": "^6.8.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-vue": "^6.2.2",
"node-sass": "^4.14.1",
"prettier": "^2.1.2",
"rollup": "^2.33.1",
"rollup-plugin-auto-external": "^2.0.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.29.0",
"rollup-plugin-vue": "^5.0.1",
"sass-loader": "^8.0.0",
"ts-node": "^8.10.2",
"typescript": "^3.9.7",
"vue-template-compiler": "^2.6.12"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}

35
rollup.config.js Normal file
View File

@ -0,0 +1,35 @@
import typescript from 'rollup-plugin-typescript2'
import vue from 'rollup-plugin-vue'
import alias from '@rollup/plugin-alias'
import commonjs from '@rollup/plugin-commonjs'
import autoExternal from 'rollup-plugin-auto-external'
import buble from '@rollup/plugin-buble'
import { terser } from 'rollup-plugin-terser'
export default {
input: 'src/wrapper.js', // Path relative to package.json
output: {
name: 'NekoClient',
exports: 'named',
},
plugins: [
typescript({
check: false,
}),
vue({
css: true,
compileTemplate: true,
}),
alias({
entries: [
{ find:/^@\/(.+)/, replacement: './$1' }
]
}),
commonjs(),
autoExternal(),
buble({
objectAssign: 'Object.assign',
}),
terser(),
],
};

14
src/Neko.vue Normal file
View File

@ -0,0 +1,14 @@
<template>
<div>
<h1>Hello world, Neko.</h1>
</div>
</template>
<script lang="ts">
import { Vue, Component, Ref } from 'vue-property-decorator'
@Component({
name: 'neko',
})
export default class extends Vue {}
</script>

28
src/wrapper.js Normal file
View File

@ -0,0 +1,28 @@
// Import vue component
import Neko from './Neko.vue';
// Declare install function executed by Vue.use()
export function install(Vue) {
if (install.installed) return;
install.installed = true;
Vue.component('Neko', Neko);
}
// Create module definition for Vue.use()
const plugin = {
install,
};
// Auto-install when vue is found (eg. in browser via <script> tag)
let GlobalVue = null;
if (typeof window !== 'undefined') {
GlobalVue = window.Vue;
} else if (typeof global !== 'undefined') {
GlobalVue = global.Vue;
}
if (GlobalVue) {
GlobalVue.use(plugin);
}
// To allow use as module (npm/webpack/etc.) export Neko
export default Neko;

42
tsconfig.json Normal file
View File

@ -0,0 +1,42 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"skipLibCheck": true,
"baseUrl": ".",
"types": [
"node",
"webpack-env"
],
"paths": {
"~/*": [
"src/*"
],
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
],
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
],
"exclude": [
"node_modules"
]
}

25
vue.config.js Normal file
View File

@ -0,0 +1,25 @@
const path = require('path')
module.exports = {
productionSourceMap: false,
css: {
loaderOptions: {
sass: {
prependData: `
@import "@/assets/styles/_variables.scss";
`,
},
},
},
configureWebpack: {
resolve: {
alias: {
vue$: 'vue/dist/vue.esm.js',
'~': path.resolve(__dirname, 'src/'),
},
},
},
devServer: {
disableHostCheck: true
}
}