Skip to content
This repository was archived by the owner on Jul 17, 2022. It is now read-only.

Commit 8c70c0e

Browse files
break: move to pnpm (#27)
* break: move to pnpm * chore: fix gh actions * chore: update lockfile * chore: persist credentials * chore: change to gh token * feat: update version and readme Co-authored-by: Irfan Maulana <maulana.irfan@tokopedia.com>
1 parent db6d28f commit 8c70c0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+14780
-10829
lines changed

.babelrc

Lines changed: 0 additions & 25 deletions
This file was deleted.

.editorconfig

100644100755
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
root = true
22

3-
[*]
3+
[*.{js,jsx,ts,tsx,vue}]
44
charset = utf-8
55
indent_style = space
6-
indent_size = 2
76
end_of_line = lf
8-
insert_final_newline = true
7+
indent_size = 2
98
trim_trailing_whitespace = true
9+
insert_final_newline = true

.eslintignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
build/*.js
2-
config/*.js
3-
dist/*.js
4-
test/*.js
51
node_modules
6-
*.config*
2+
dist

.eslintrc.js

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
module.exports = {
2-
"env": {
3-
"browser": true,
4-
"commonjs": true,
5-
"es6": true,
6-
"jest": true
2+
root: true,
3+
env: {
4+
node: true
75
},
8-
"extends": [
9-
"eslint:recommended",
10-
"plugin:vue/recommended"
6+
extends: [
7+
'plugin:vue/essential',
8+
'@vue/standard',
9+
'@vue/typescript',
10+
'prettier'
1111
],
12-
"parserOptions": {
13-
"ecmaVersion": 2018,
14-
"sourceType": "module"
12+
rules: {
13+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
14+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
15+
'no-tabs': 'off'
1516
},
16-
"rules": {
17-
"indent": [ "error", 2 ],
18-
"linebreak-style": [ "error", "unix" ],
19-
"quotes": [ "error", "single" ],
20-
"semi": [ "error", "never" ],
21-
"no-console": "off"
22-
},
23-
"overrides": {
24-
"files": [ "**/*.js", "**/*.vue" ]
17+
parserOptions: {
18+
parser: '@typescript-eslint/parser'
2519
}
26-
};
20+
}

.github/workflows/build_deploy.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: "Build and Deploy"
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
jobs:
8+
build_and_deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
persist-credentials: false
15+
fetch-depth: 0
16+
17+
- name: Cache pnpm modules
18+
uses: actions/cache@v2
19+
env:
20+
cache-name: cache-pnpm-modules
21+
with:
22+
path: ~/.pnpm-store
23+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
24+
restore-keys: |
25+
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
26+
27+
- name: pnpm install recursive
28+
uses: pnpm/action-setup@v1.2.1
29+
with:
30+
version: 5.17.2
31+
run_install: |
32+
- recursive: true
33+
args: [--frozen-lockfile]
34+
35+
- name: Build library
36+
run: pnpm run build:lib
37+
38+
- name: Build demo app
39+
run: pnpm run build:demo
40+
41+
- name: GitHub Pages Deploy
42+
uses: peaceiris/actions-gh-pages@v3
43+
with:
44+
personal_token: ${{ secrets.GITHUB_TOKEN }}
45+
publish_dir: ./packages/demo/dist/
46+
publish_branch: gh-pages

.travis.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

README.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# ⚠️🔌 vue2-simplert-plugin
2-
3-
> Vue2-Simplert as Vue.js Plugins
4-
5-
[![License](https://img.shields.io/github/license/mazipan/vue2-simplert-plugin.svg?maxAge=3600)](https://github.com/mazipan/vue2-simplert-plugin) ![minified](https://badgen.net/bundlephobia/minzip/vue2-simplert-plugin) [![version](https://img.shields.io/npm/v/vue2-simplert-plugin.svg)](https://www.npmjs.com/package/vue2-simplert-plugin) [![downloads](https://img.shields.io/npm/dt/vue2-simplert-plugin.svg)](https://www.npmjs.com/package/vue2-simplert-plugin)
1+
# ⚠️ vue2-simplert-plugin
62

3+
> Vue 2 Simple Alert Plugin (SweetAlert Inspired)
74
5+
[![License](https://img.shields.io/github/license/mazipan/vue2-simplert-plugin.svg?maxAge=3600)](https://github.com/mazipan/vue2-simplert-plugin) ![minified](https://badgen.net/bundlephobia/minzip/vue2-simplert-plugin) [![version](https://img.shields.io/npm/v/vue2-simplert-plugin.svg)](https://www.npmjs.com/package/vue2-simplert-plugin) [![downloads](https://img.shields.io/npm/dt/vue2-simplert-plugin.svg)](https://www.npmjs.com/package/vue2-simplert-plugin) [![Build and Deploy](https://github.com/mazipan/vue2-simplert-plugin/actions/workflows/build_deploy.yml/badge.svg)](https://github.com/mazipan/vue2-simplert-plugin/actions/workflows/build_deploy.yml)
86

97
## Why we need ?
108

119
When we using [vue2-simplert](https://github.com/mazipan/vue2-simplert), we will need to `import` the library in every place we need. This is very bored because we do same task in many place. In [vue2-simplert](https://github.com/mazipan/vue2-simplert) we need to access method inside using `$refs` which is not recommended. For solving those problems I reborn [vue2-simplert](https://github.com/mazipan/vue2-simplert) as Vue.js Plugins and using EventBus for open/close.
1210

1311
## Demo
1412

15-
[https://mazipan.github.io/vue2-simplert-plugin/](https://mazipan.github.io/vue2-simplert-plugin/)
13+
- [Full Demo](https://mazipan.github.io/vue2-simplert-plugin/)
14+
15+
- [Codesandbox Test](https://codesandbox.io/s/vue-simplert-plugin-demo-elkoc)
1616

1717
## Install
1818

@@ -35,16 +35,17 @@ npm i vue2-simplert-plugin --save
3535
Usually `main.js` or `index.js`
3636

3737
```javascript
38-
import Simplert from 'vue2-simplert-plugin'
39-
require('vue2-simplert-plugin/dist/vue2-simplert-plugin.css')
38+
import { Simplert } from 'vue2-simplert-plugin'
39+
import 'vue2-simplert-plugin/dist/vue2-simplert-plugin.min.css'
4040

4141
Vue.use(Simplert)
4242
```
43-
> from v0.4.0 you need to add `vue2-simplert-plugin.css`
4443

4544
Or, with customize default config which still can be overrided.
4645
```javascript
47-
import Simplert from 'vue2-simplert-plugin'
46+
import { Simplert } from 'vue2-simplert-plugin'
47+
import 'vue2-simplert-plugin/dist/vue2-simplert-plugin.min.css'
48+
4849
Vue.use(Simplert, {
4950
title: 'test', //string -- title alert
5051
message: 'message', //string -- message alert
@@ -71,7 +72,7 @@ for more [Methods and Props](https://mazipan.gitbooks.io/vue2-simplert/method-an
7172
Usually `App.vue`
7273

7374
```html
74-
<simplert></simplert>
75+
<simplert />
7576
```
7677

7778
#### Open/Close Popup
@@ -92,39 +93,51 @@ this.$Simplert.close()
9293
If you already use [vue2-simplert](https://github.com/mazipan/vue2-simplert) in your project, please follow this below guide :
9394
+ Make sure you add dependency `npm i vue2-simplert-plugin --save`
9495
+ Import and use this plugin in your main app, ex : `main.js`
96+
9597
```javascript
96-
import Simplert from 'vue2-simplert-plugin'
97-
require('vue2-simplert-plugin/dist/vue2-simplert-plugin.css')
98+
import { Simplert } from 'vue2-simplert-plugin'
99+
import 'vue2-simplert-plugin/dist/vue2-simplert-plugin.min.css'
98100

99101
Vue.use(Simplert)
100102
```
103+
101104
+ Remove all import [vue2-simplert](https://github.com/mazipan/vue2-simplert) in your components and/or pages, because as Plugin you dont need to import in all components
105+
102106
```javascript
103107
import Simplert from 'vue2-simplert'
104108
```
109+
105110
+ Remove all adding component [vue2-simplert](https://github.com/mazipan/vue2-simplert) in your components and/or pages, because you dont need set components again
111+
106112
```javascript
107113
components: {Simplert}
108114
```
115+
109116
+ Remove all template html snippet in each components
117+
110118
```html
111119
<simplert :useRadius="true"
112120
:useIcon="true"
113121
ref="simplert">
114122
</simplert>
115123
```
124+
116125
+ Add new html snippet in root application, ex : `App.vue`
126+
117127
```html
118128
<simplert>
119129
</simplert>
120130
```
131+
121132
+ Change all call method open with new plugin method, you dont need to change all configuration
133+
122134
```javascript
123135
// change this call
124136
this.$refs.simplert.openSimplert(obj)
125137
// to this way
126138
this.$Simplert.open(obj)
127139
```
140+
128141
+ And **DONE** :+1: !!!
129142

130143
## Documentation Vue2-Simplert
@@ -146,4 +159,4 @@ If you'd like to contribute, head to the [contributing guidelines](CONTRIBUTING.
146159

147160
![vue2-simplert](https://mazipan.github.io/vue2-simplert/images/vue2-simplert-logo.png)
148161

149-
Copyright © 2017 Built with ❤️ by Irfan Maulana
162+
Copyright © 2017-present, built with ❤️ by Irfan Maulana

jest.config.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)