Skip to content

Commit

Permalink
feat: housekeeping
Browse files Browse the repository at this point in the history
- [x] add ava config
- [x] update babel config
- [x] add rollup config for building project
- [x] update license
- [x] add husky & commitlint
- [x] add jsconfig for better intellisense
- [x] remove postcss config
- [x] add prettier config
- [x] remove `App.vue`
  • Loading branch information
vinayakkulkarni committed Sep 15, 2020
1 parent c1f4608 commit 620cc90
Show file tree
Hide file tree
Showing 13 changed files with 10,386 additions and 292 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 greyby
Copyright (c) 2020-current GeoSpoc

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 10 additions & 0 deletions ava.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
require: ['./test/helpers/ava.setup.js'],
files: ['./test/spec/**/*'],
ignoredByWatcher: ['!**/*.{js,vue}'],
snapshotDir: './test/snapshot',
babel: true,
tap: false,
verbose: true,
color: true,
};
26 changes: 19 additions & 7 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
module.exports = {
presets: [
'@vue/app'
],
"plugins": [
"transform-flow-comments"
]
}
presets: ['@babel/preset-env'],
env: {
test: {
plugins: [
[
'module-resolver',
{
root: ['./'],
alias: {
'@': './',
'~': './',
},
},
],
],
ignore: ['ava.config.cjs'],
},
},
};
63 changes: 63 additions & 0 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import babel from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import vue from 'rollup-plugin-vue';

export default [
// ESM build to be used with webpack/rollup.
{
input: 'src/index.js',
output: {
format: 'esm',
name: 'v-grid-layout',
file: 'dist/v-grid-layout.esm.js',
},
plugins: [
babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**',
}),
commonjs(),
vue(),
],
external: ['@vue/composition-api'],
},
// CommonJS build
{
input: 'src/index.js',
output: {
format: 'cjs',
name: 'v-grid-layout',
file: 'dist/v-grid-layout.cjs.js',
},
plugins: [
babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**',
}),
commonjs(),
vue(),
],
external: ['@vue/composition-api'],
},
// UMD build.
{
input: 'src/index.js',
output: {
format: 'umd',
name: 'v-grid-layout',
file: 'dist/v-grid-layout.umd.js',
globals: {
'@vue/composition-api': 'vueCompositionApi',
},
},
plugins: [
babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**',
}),
commonjs(),
vue(),
],
external: ['@vue/composition-api'],
},
];
48 changes: 48 additions & 0 deletions build/rollup.min.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import babel from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import { terser } from 'rollup-plugin-terser';
import vue from 'rollup-plugin-vue';

export default [
// UMD
{
input: 'src/index.js',
output: {
format: 'umd',
name: 'v-grid-layout',
file: 'dist/v-grid-layout.umd.min.js',
globals: {
'@vue/composition-api': 'vueCompositionApi',
},
},
plugins: [
babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**',
}),
commonjs(),
terser(),
vue(),
],
external: ['@vue/composition-api'],
},
// CommonJS build
{
input: 'src/index.js',
output: {
format: 'cjs',
name: 'v-grid-layout',
file: 'dist/v-grid-layout.cjs.min.js',
},
plugins: [
babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**',
}),
commonjs(),
terser(),
vue(),
],
external: ['@vue/composition-api'],
},
];
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
};
7 changes: 7 additions & 0 deletions husky.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
hooks: {
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
'pre-commit': 'npm run lint',
'pre-push': 'npm run lint',
},
};
9 changes: 9 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"exclude": ["node_modules", "dist"]
}
Loading

0 comments on commit 620cc90

Please sign in to comment.