Skip to content

Commit ce52657

Browse files
committed
Merge branch 'master' into v2
2 parents 16d5ea1 + 27f5b5c commit ce52657

File tree

18 files changed

+1712
-1306
lines changed

18 files changed

+1712
-1306
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ VCP-electron-builder uses the [standard style guide](https://standardjs.com/), e
99

1010
### Testing
1111

12-
VCP-electron-builder uses [Jest](http://jestjs.io/) for testing. It has e2e tests for regular build and serve and typescript build and serve. Because of this, tests can take up to 5 minutes to run. If you have a slower computer (less than quad core) it might help to add the `--runInBand` argument to `yarn test`. The tests only work on Linux or Windows, not MacOS. Please run all tests and make sure they pass before submitting a pull request. [AppVeyor](https://www.appveyor.com/) is used for CI tests.
12+
VCP-electron-builder uses [Jest](http://jestjs.io/) for testing. It has e2e tests for regular build and serve and typescript build and serve. Because of this, tests can take up to 5 minutes to run. If you have a slower computer (less than quad core) it might help to add the `--runInBand` argument to `yarn test`. The tests only work on Linux or Windows, not MacOS. Please run all tests and make sure they pass before submitting a pull request. Github Actions are used for CI.

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# These are supported funding model platforms
22

3-
custom: ['https://www.paypal.me/noahklayman', 'https://venmo.com/noahklayman']
3+
github: nklayman

.github/workflows/nodeCI.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Node CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, windows-latest]
14+
node: [ '12', '10', '8' ]
15+
include:
16+
- os: windows-latest
17+
commandPrefix: ''
18+
- os: ubuntu-latest
19+
commandPrefix: xvfb-run
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- uses: actions/checkout@v1
23+
- name: Setup Node
24+
uses: actions/setup-node@v1
25+
with:
26+
node-version: ${{ matrix.node }}
27+
- name: Get yarn cache dir
28+
id: yarn-cache
29+
run: echo "::set-output name=dir::$(yarn cache dir)"
30+
- name: Yarn cache
31+
if: runner.os != 'Windows'
32+
uses: actions/cache@v1
33+
with:
34+
path: ${{ steps.yarn-cache.outputs.dir }}
35+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-yarn-
38+
- name: yarn install
39+
run: yarn install
40+
- name: yarn test
41+
run: ${{ matrix.commandPrefix }} yarn test --runInBand --coverage
42+
env:
43+
CI: true
44+
- name: Upload coverage to Codecov
45+
if: runner.os == 'Linux'
46+
uses: codecov/codecov-action@v1
47+
with:
48+
token: ${{secrets.CODECOV_TOKEN}}
49+
file: ./coverage/clover.xml

.travis.yml

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

README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
A Vue Cli 3 plugin for Electron with no required configuration that uses [Electron Builder](https://www.electron.build/).
44

5-
Windows (Appveyor): [![Build status](https://ci.appveyor.com/api/projects/status/tyrr8kemli4vfll7?svg=true)](https://ci.appveyor.com/project/nklayman/vue-cli-plugin-electron-builder), Linux (Travis): [![Build Status](https://travis-ci.org/nklayman/vue-cli-plugin-electron-builder.svg?branch=master)](https://travis-ci.org/nklayman/vue-cli-plugin-electron-builder)
5+
Build status: [![Build status](https://github.com/nklayman/vue-cli-plugin-electron-builder/workflows/Node%20CI/badge.svg)](https://github.com/nklayman/vue-cli-plugin-electron-builder/actions)
66

7-
**IMPORTANT: Your app must be created with Vue-CLI 3 (vue create my-app), will not work with Vue-CLI 2 (vue init webpack my-app)!**
7+
[![Sponsor](./docs/.vuepress/public/sponsorShield.svg)](https://github.com/sponsors/nklayman)
88

9-
**IMPORTANT: These docs are for the v1.0.0 release of VCP Electron Builder. If you were previously using an older version of vue-cli-plugin-electron-builder (<1.0.0), please see the [upgrade guide](https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/upgrading.html) or [view the old docs](https://github.com/nklayman/vue-cli-plugin-electron-builder/tree/legacy).**
9+
**IMPORTANT: Your app must be created with Vue-CLI 3 or 4 (vue create my-app), will not work with Vue-CLI 2 (vue init webpack my-app)!**
1010

1111
## Quick Start:
1212

@@ -40,11 +40,8 @@ or with NPM:
4040

4141
To see more documentation, [visit our website](https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/guide.html).
4242

43-
## WARNING
43+
## Supporters
4444

45-
The command names have changed in `v1.0.0-rc.4`. If you are using an older version, the command names are:
46-
`yarn serve:electron`
47-
and
48-
`yarn build:electron`.
49-
50-
Replace `yarn` with `npm run` if you are using npm.
45+
| [![Andrew LeTourneau](https://avatars2.githubusercontent.com/u/2807807?s=64&v=4)](https://github.com/centerorbit) |
46+
| ----------------------------------------------------------------------------------------------------------------- |
47+
| [Andrew LeTourneau](https://github.com/centerorbit) |

__tests__/commands.spec.js

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ describe('electron:build', () => {
123123
expect(Object.keys(mainConfig)).not.toContain('module')
124124
// Ts files are not resolved
125125
expect(
126-
mainConfig.resolve ? mainConfig.resolve.extensions : []
126+
mainConfig.resolve.extensions ? mainConfig.resolve.extensions : []
127127
).not.toContain('ts')
128128
// Proper entry file is used
129129
expect(mainConfig.entry.background[0]).toBe('projectPath/src/background.js')
@@ -242,7 +242,9 @@ describe('electron:build', () => {
242242
['--legacy'],
243243
['--dashboard'],
244244
['--skipBundle'],
245-
['--dest', 'output']
245+
['--dest', 'output'],
246+
['--report'],
247+
['--report-json']
246248
])('%s argument is removed from electron-builder args', async (...args) => {
247249
await runCommand('electron:build', {}, {}, ['--keep1', ...args, '--keep2'])
248250
// Custom args should have been removed, and other args kept
@@ -279,6 +281,16 @@ describe('electron:build', () => {
279281
expect(serviceRun.mock.calls[0][1].modern).toBe(false)
280282
})
281283

284+
test.each(['report', 'report-json'])(
285+
'--%s arg is passed to renderer build',
286+
async argName => {
287+
const args = {}
288+
args[argName] = true
289+
await runCommand('electron:build', {}, args)
290+
expect(serviceRun.mock.calls[0][1][argName]).toBe(true)
291+
}
292+
)
293+
282294
test('App is not bundled if --skipBundle arg is passed', async () => {
283295
await runCommand('electron:build', {}, { skipBundle: true })
284296
expect(serviceRun).not.toBeCalled()
@@ -350,15 +362,11 @@ describe('electron:build', () => {
350362
}
351363
})
352364
expect(fs.writeFileSync).toBeCalledWith(
353-
`dist_electron${path.sep}bundled${
354-
path.sep
355-
}legacy-assets-index.html.json`,
365+
`dist_electron${path.sep}bundled${path.sep}legacy-assets-index.html.json`,
356366
'[]'
357367
)
358368
expect(fs.writeFileSync).toBeCalledWith(
359-
`dist_electron${path.sep}bundled${
360-
path.sep
361-
}legacy-assets-subpage.html.json`,
369+
`dist_electron${path.sep}bundled${path.sep}legacy-assets-subpage.html.json`,
362370
'[]'
363371
)
364372
}
@@ -386,6 +394,17 @@ describe('electron:build', () => {
386394
})
387395
)
388396
})
397+
398+
test('Config arguments overwrite config', async () => {
399+
jest.unmock('yargs')
400+
await runCommand('electron:build', undefined, undefined, [
401+
'-c.directories.output=customDist'
402+
])
403+
404+
expect(builder.build.mock.calls[0][0].config.directories.output).toBe(
405+
'customDist'
406+
)
407+
})
389408
})
390409

391410
describe('electron:serve', () => {
@@ -406,7 +425,7 @@ describe('electron:serve', () => {
406425
expect(Object.keys(mainConfig)).not.toContain('module')
407426
// Ts files are not resolved
408427
expect(
409-
mainConfig.resolve ? mainConfig.resolve.extensions : []
428+
mainConfig.resolve.extensions ? mainConfig.resolve.extensions : []
410429
).not.toContain('ts')
411430
// Proper entry file is used
412431
expect(mainConfig.entry.index[0]).toBe('projectPath/src/background.js')

appveyor.yml

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

docs/.vuepress/components/Sponsor.vue

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<template>
2+
<p class="sponsor">
3+
<a href="https://github.com/sponsors/nklayman" target="_blank">
4+
<span>Support This Project</span>
5+
<img alt="Sponsor" src="sponsorShield.svg">
6+
</a>
7+
</p>
8+
</template>
9+
10+
<style lang="stylus">
11+
.sponsor
12+
font-weight 600
13+
background-color #f3f6f8
14+
padding 0.6em 1.2em
15+
border-radius 8px
16+
display inline-block
17+
margin 1em 0 !important
18+
a
19+
color #999
20+
img
21+
height 20px
22+
margin-left 15px
23+
img, span
24+
vertical-align middle
25+
</style>

docs/.vuepress/config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ module.exports = {
2323
text: 'Changelog',
2424
link:
2525
'https://github.com/nklayman/vue-cli-plugin-electron-builder/releases'
26+
},
27+
{
28+
text: 'Sponsor',
29+
link: 'https://github.com/sponsors/nklayman'
2630
}
2731
],
2832
sidebar: {
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)