Skip to content

Commit

Permalink
Add bundled version (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
selfagency committed Jun 17, 2021
1 parent 1e46b5c commit 48f7f8a
Show file tree
Hide file tree
Showing 12 changed files with 495 additions and 1,459 deletions.
19 changes: 0 additions & 19 deletions .release-it.json

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ issues](https://img.shields.io/github/issues/grid-js/gridjs-vue?color=41B883&sty
npm install gridjs-vue
```

Also available on [unpkg](https://unpkg.com/browse/gridjs-vue@5.0.1/dist/) and [Skypack](https://www.skypack.dev/view/gridjs-vue)!
Also available on [unpkg](https://unpkg.com/browse/gridjs-vue/dist/) and [Skypack](https://www.skypack.dev/view/gridjs-vue)!

```html
<script>
import Grid from 'gridjs-vue'
import { Grid } from 'gridjs-vue'
export default {
components: {
Expand Down
9 changes: 3 additions & 6 deletions bili.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
jsCompiler: 'babel',
input: 'src/index.js',
input: ['src/index.browser.mjs', 'src/index.mjs'],
bundleNodeModules: true,
output: {
format: ['cjs', 'esm', 'umd'],
bundleNodeModules: true,
minify: true,
moduleName: 'Grid',
extractCSS: false
Expand All @@ -13,15 +13,12 @@ module.exports = {
include: 'node_modules/**/*.css'
},
vue: {
target: 'browser',
babelHelopers: 'runtime',
css: true
target: 'browser'
},
babel: {
presets: ['vue', ['@babel/preset-env', { useBuiltIns: 'usage', corejs: 3 }]],
plugins: ['@babel/plugin-transform-runtime'],
babelHelpers: 'runtime',
exclude: 'node_modules/**',
configFile: false
},
'node-resolve': true
Expand Down
21 changes: 19 additions & 2 deletions examples/basic/hello-world.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,24 @@ export default {
},
data() {
return {
columns: ['Name', 'Email', 'Phone Number'],
sort: true,
columns: [
'Name',
'Email',
{
name: 'Phone Number',
sort: {
compare: (a, b) => {
a = parseInt(a.replace(/\(|\)|\s/g, ''))
b = parseInt(b.replace(/\(|\)|\s/g, ''))
let out = 0
if (a > b) out = 1
if (a < b) out = -1
return out
}
}
}
],
rows: [
['John', 'john@example.com', '(353) 01 222 3333'],
['Mark', 'mark@gmail.com', '(01) 22 888 4444']
Expand All @@ -20,6 +37,6 @@ export default {
}
},
template: `
<div><grid :columns="columns" :rows="rows" @ready="log('Hi to you too!')"></grid></div>
<div><grid :columns="columns" :rows="rows" ref="helloWorld" @ready="log('Hi to you too!')"></grid></div>
`
}
15 changes: 9 additions & 6 deletions examples/basic/loading-state.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ export default {
columns: ['Name', 'Email', 'Phone Number'],
sort: true,
search: true,
rows:() => {
rows: () => {
return new Promise(resolve => {
setTimeout(() =>
resolve([
['John', 'john@example.com', '(353) 01 222 3333'],
['Mark', 'mark@gmail.com', '(01) 22 888 4444']
]), 2000);
setTimeout(
() =>
resolve([
['John', 'john@example.com', '(353) 01 222 3333'],
['Mark', 'mark@gmail.com', '(01) 22 888 4444']
]),
2000
)
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/customizing/vue-component-in-cells.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
{
name: 'Name',
formatter: cell =>
return this.$gridjs.helper({
this.$gridjs.helper({
components: { TestComponent },
template: `<test-component :content="content"></test-component>`,
data() {
Expand Down
32 changes: 24 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gridjs-vue",
"description": "A Vue.js wrapper component for Grid.js",
"version": "5.0.2-0",
"version": "5.0.2-3",
"license": "MIT",
"private": false,
"authors": [
Expand All @@ -14,13 +14,25 @@
"type": "git",
"url": "https://github.com/grid-js/gridjs-vue.git"
},
"main": "./dist/index.js",
"keywords": [
"table",
"grid",
"spreadsheet",
"vue",
"vue-component"
],
"main": "./dist/index.esm.js",
"umd": "./dist/index.umd.js",
"module": "./dist/index.esm.js",
"module": "./dist/index.browser.esm.js",
"exports": {
"require": "./dist/index.js",
"import": "./dist/index.esm.js",
"default": "./dist/index.esm.js",
"browser": "./dist/index.browser.esm.js"
},
"scripts": {
"dev": "baechli -c 'yarn build'",
"build": "rm -rf dist/*; bili src/index.mjs;",
"release": "doppler run -- release-it"
"build": "rm -rf dist/*; bili;"
},
"files": [
"dist/*",
Expand All @@ -36,6 +48,8 @@
"@babel/core": "^7.14.3",
"@babel/plugin-transform-runtime": "^7.14.3",
"@babel/preset-env": "^7.14.4",
"@juggle/resize-observer": "^3.3.1",
"@lesniewski.pro/necktie": "^1.1.3",
"@release-it/keep-a-changelog": "^2.3.0",
"@vue/compiler-sfc": "^3.1.1",
"@vue/eslint-config-prettier": "^6.0.0",
Expand All @@ -51,18 +65,20 @@
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-vue": "^7.10.0",
"gridjs": "5.0.1",
"parse-css-stylesheet": "^0.0.1",
"prettier": "^2.3.1",
"release-it": "^14.8.0",
"rollup": "^2.51.1",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-string": "^3.0.0",
"rollup-plugin-vue": "^6.0.0",
"styl-injector": "^1.4.0",
"typescript": "^4.3.2",
"uid": "^2.0.0",
"vue": "^2.6.11",
"vue-runtime-helpers": "1.1.2",
"vue-template-compiler": "^2.6.14"
},
"dependencies": {}
}
}

0 comments on commit 48f7f8a

Please sign in to comment.