diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..970caf4 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +demo/assets \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index 12d5552..7e6e35a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -6,13 +6,13 @@ "extends": ["plugin:vue/essential", "eslint:recommended"], "rules": {}, "parserOptions": { - "parser": "babel-eslint" + "parser": "@babel/eslint-parser" }, "overrides": [ { "files": ["**/__tests__/*.js"], "parserOptions": { - "parser": "babel-eslint", + "parser": "@babel/eslint-parser", "sourceType": "module" }, "env": { diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..5afbed4 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,29 @@ +name: Lint & Test +on: + pull_request: + types: [opened,synchronize] + branches: master + +concurrency: + group: test-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install + run: npm ci + + - name: List + run: npm run lint + + - name: Test unit + run: npm run test:unit -- --runInBand + + - name: Test e2e + run: npm run test:e2e -- --headless \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2e6ea97 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release +on: + push: + branches: master + +concurrency: + group: release-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install + run: npm ci + + - name: Test + run: | + npm run lint + npm run test:unit -- --runInBand + npm run test:e2e -- --headless + + - name: Deploy to vue-live.surge.sh + uses: dswistowski/surge-sh-action@v1 + with: + domain: 'vue-live.surge.sh' + project: './dist/' + login: ${{ secrets.SURGE_LOGIN }} + token: ${{ secrets.SURGE_TOKEN }} + + - name: Build + run: npm run build + + - name: Release + run: npx semantic-release \ No newline at end of file diff --git a/.releaserc.js b/.releaserc.js index 11757e9..4cd0fa4 100644 --- a/.releaserc.js +++ b/.releaserc.js @@ -1,8 +1,12 @@ module.exports = { + branches: [ + { name: "master" }, + { name: "next", channel: "next", prerelease: "beta" }, // Only after the `next` is created in the repo + ], plugins: [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", "@semantic-release/npm", - "@semantic-release/github" - ] + "@semantic-release/github", + ], }; diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0477dcf..0000000 --- a/.travis.yml +++ /dev/null @@ -1,54 +0,0 @@ -language: node_js - -# Cypress,io 3.4.1 needs this lib to keep working on travis CI -addons: - apt: - packages: - - libgconf-2-4 - -cache: - # cache both npm modules and Cypress binary - directories: - - ~/.npm - - ~/.cache - override: - - npm ci - - npm run cy:verify - -node_js: - - lts/* - -# In order to avoid double build on pull requests, -# only build on pushes on master and on pushes on pull requests -branches: - only: - - master - -stages: - - test - - name: demo - if: type != pull_request AND branch = master - - name: release - if: type != pull_request AND branch = master - -jobs: - include: - - stage: test - script: - - npx danger ci - - npm run lint - - npm run test:unit -- --runInBand - - npm run test:e2e -- --headless - - - stage: demo - script: npm run build:demo - deploy: - skip_cleanup: true - provider: surge - project: ./dist/ - domain: vue-live.surge.sh - - - stage: release - script: - - npm run build - - npx semantic-release diff --git a/README.md b/README.md index dded570..51b0a32 100644 --- a/README.md +++ b/README.md @@ -18,24 +18,28 @@ The simplest way to render components is as a VueJs template: ```vue ``` @@ -55,7 +59,7 @@ module.exports = { alias: { // this enables loading the "full" version of vue // instead of only loading the vue runtime - vue$: "vue/dist/vue.esm.js", + vue$: "vue/dist/vue.esm-browser.js", }, }, }; @@ -68,10 +72,10 @@ module.exports = { configureWebpack: { resolve: { alias: { - vue$: "vue/dist/vue.esm.js" - } - } - } + vue$: "vue/dist/vue.esm.js", + }, + }, + }, }; ``` @@ -82,7 +86,7 @@ export default { build: { extend(config, { isDev, isClient }) { // .. - config.resolve.alias.vue$ = "vue/dist/vue.esm.js"; + config.resolve.alias.vue$ = "vue/dist/vue.esm-browser.js"; }, }, }; @@ -95,7 +99,7 @@ module.exports = { configureWebpack: { resolve: { alias: { - vue$: "vue/dist/vue.esm.js", + vue$: "vue/dist/vue.esm-browser.js", }, }, }, diff --git a/babel.config.js b/babel.config.js index 8def02a..3b0a13d 100644 --- a/babel.config.js +++ b/babel.config.js @@ -5,10 +5,7 @@ module.exports = { include: ["node_modules"], presets: [ [ - "@babel/env", - { - modules: "cjs" - } + "@babel/env" ] ] } diff --git a/demo/App.vue b/demo/App.vue index 5cfaa05..65dcc88 100644 --- a/demo/App.vue +++ b/demo/App.vue @@ -106,9 +106,10 @@