Describe the bug
When adding the plugin to a project that has typescript enabled:
electron.spec is in JavaScript, not TypeScript
vue add electron-builder ends with a failure
β ~ vue create hello-world
Vue CLI v4.3.1
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, TS, PWA, Router, Vuex, CSS Pre-processors, Linter, Unit, E2E
? Use class-style component syntax? Yes
? Use Babel alongside TypeScript (required for modern mode, auto-detected polyfills, transpiling JSX)? Yes
? Use history mode for router? (Requires proper server setup for index fallback in production) Yes
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Sass/SCSS (with dart-sass
)
? Pick a linter / formatter config: Prettier
? Pick additional lint features: Lint on save
? Pick a unit testing solution: Jest
? Pick an E2E testing solution: Cypress
? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files
? Save this as a preset for future projects? No
Vue CLI v4.3.1
β¨ Creating project in /home/patrick/hello-world.
π Initializing git repository...
βοΈ Installing CLI plugins. This might take a while...
yarn install v1.22.4
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
success Saved lockfile.
Done in 23.97s.
π Invoking generators...
π¦ Installing additional dependencies...
[5/5] β’ cypress
yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 11.34s.
β Running completion hooks...
π Generating README.md...
π Successfully created project hello-world.
π Get started with the following commands:
$ cd hello-world
$ yarn serve
β ~ cd hello-world
β hello-world git:(master) vue add electron-builder
? Choose Electron Version ^6.0.0
? Add tests with Spectron to your project? Yes
π Invoking generator for vue-cli-plugin-electron-builder...
WARN Devtools extensions are broken in Electron 6.0.0 and greater
WARN Vue Devtools have been disabled, see the comments in your background file for more info
π¦ Installing additional dependencies...
yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
$ electron-builder install-app-deps
β’ electron-builder version=21.2.0
Done in 18.00s.
β Running completion hooks...
WARN It is detected that you are using Vue Router. If you are using history mode, you must push the default route when the root component is loaded. Learn more at https://goo.gl/GM1xZG .
error: Require statement not part of import statement (@typescript-eslint/no-var-requires) at tests/unit/electron.spec.js:1:30:
**To Reproduce**
Steps to reproduce the behavior:
```bash
β ~ vue create hello-world
Vue CLI v4.3.1
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, TS, PWA, Router, Vuex, CSS Pre-processors, Linter, Unit, E2E
? Use class-style component syntax? Yes
? Use Babel alongside TypeScript (required for modern mode, auto-detected polyfills, transpiling JSX)? Yes
? Use history mode for router? (Requires proper server setup for index fallback in production) Yes
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Sass/SCSS (with dart-sass
)
? Pick a linter / formatter config: Prettier
? Pick additional lint features: Lint on save
? Pick a unit testing solution: Jest
? Pick an E2E testing solution: Cypress
? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files
? Save this as a preset for future projects? No
β ~ cd hello-world
β ~ vue add electron-builder
β Successfully installed plugin: vue-cli-plugin-electron-builder
? Choose Electron Version ^6.0.0
? Add tests with Spectron to your project? Yes
Expected behavior
spec is generated in typescript
spec does not throw errors from @typescript-eslint
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
OS and version: Ubuntu 20.04
node version: v14.2.0
npm version:
yarn version (if used): 1.22.4
vue-cli-plugin-electron-builder version : "vue-cli-plugin-electron-builder": "~1.4.6"
Describe the bug When adding the plugin to a project that has typescript enabled:
vue add electron-builder
ends with a failureVue CLI v4.3.1 ? Please pick a preset: Manually select features ? Check the features needed for your project: Babel, TS, PWA, Router, Vuex, CSS Pre-processors, Linter, Unit, E2E ? Use class-style component syntax? Yes ? Use Babel alongside TypeScript (required for modern mode, auto-detected polyfills, transpiling JSX)? Yes ? Use history mode for router? (Requires proper server setup for index fallback in production) Yes ? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Sass/SCSS (with dart-sass ) ? Pick a linter / formatter config: Prettier ? Pick additional lint features: Lint on save ? Pick a unit testing solution: Jest ? Pick an E2E testing solution: Cypress ? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files ? Save this as a preset for future projects? No
Vue CLI v4.3.1 β¨ Creating project in /home/patrick/hello-world. π Initializing git repository... βοΈ Installing CLI plugins. This might take a while...
yarn install v1.22.4 info No lockfile found. [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@2.1.3: The platform "linux" is incompatible with this module. info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
success Saved lockfile. Done in 23.97s. π Invoking generators... π¦ Installing additional dependencies... [5/5] β’ cypress yarn install v1.22.4 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@2.1.3: The platform "linux" is incompatible with this module. info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@1.2.13: The platform "linux" is incompatible with this module. info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages...
success Saved lockfile. Done in 11.34s. β Running completion hooks...
π Generating README.md...
π Successfully created project hello-world. π Get started with the following commands:
$ cd hello-world $ yarn serve
β ~ cd hello-world β hello-world git:(master) vue add electron-builder
π¦ Installing vue-cli-plugin-electron-builder...
yarn add v1.22.4 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@2.1.3: The platform "linux" is incompatible with this module. info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@1.2.13: The platform "linux" is incompatible with this module. info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages... success Saved lockfile. success Saved 109 new dependencies. info Direct dependencies ββ vue-cli-plugin-electron-builder@1.4.6 info All dependencies ββ @develar/schema-utils@2.1.0 ββ @sindresorhus/is@0.14.0 ββ @szmarczak/http-timer@1.1.2 ββ @types/debug@4.1.5 ββ ansi-align@3.0.0 ββ app-builder-bin@3.4.3 ββ app-builder-lib@21.2.0 ββ archiver@2.1.1 ββ array-find-index@1.0.2 ββ bl@1.2.2 ββ boxen@3.2.0 ββ buffer-alloc-unsafe@1.1.0 ββ buffer-alloc@1.2.0 ββ buffer-fill@1.0.0 ββ cacheable-request@6.1.0 ββ camelcase-keys@2.1.0 ββ chromium-pickle-js@0.2.0 ββ cli-boxes@2.2.0 ββ clone-response@1.0.2 ββ compress-commons@1.2.2 ββ configstore@4.0.0 ββ crc@3.8.0 ββ crc32-stream@2.0.0 ββ crypto-random-string@1.0.0 ββ css-parse@2.0.0 ββ css-value@0.0.1 ββ currently-unhandled@0.4.1 ββ decompress-response@3.3.0 ββ deep-extend@0.6.0 ββ defer-to-connect@1.1.3 ββ dev-null@0.1.1 ββ dmg-builder@21.2.0 ββ dot-prop@4.2.0 ββ duplexer3@0.1.4 ββ electron-builder@21.2.0 ββ electron-chromedriver@5.0.1 ββ electron-download@4.1.1 ββ electron-publish@21.2.0 ββ env-paths@1.0.0 ββ friendly-errors-webpack-plugin@1.7.0 ββ fs-constants@1.0.0 ββ gaze@1.1.3 ββ globule@1.3.1 ββ got@9.6.0 ββ grapheme-splitter@1.0.4 ββ has-yarn@2.1.0 ββ http-cache-semantics@4.1.0 ββ immediate@3.0.6 ββ import-lazy@2.1.0 ββ is-npm@3.0.0 ββ is-utf8@0.2.1 ββ is-yarn-global@0.3.0 ββ isbinaryfile@4.0.6 ββ json-buffer@3.0.0 ββ jszip@3.4.0 ββ keyv@3.1.0 ββ latest-version@5.1.0 ββ lazystream@1.0.0 ββ lie@3.3.0 ββ lodash.merge@4.6.2 ββ loud-rejection@1.6.0 ββ lowercase-keys@1.0.1 ββ map-obj@1.0.1 ββ meow@3.7.0 ββ npm-install-package@2.1.0 ββ nugget@2.0.1 ββ optimist@0.6.1 ββ p-cancelable@1.1.0 ββ package-json@6.5.0 ββ progress-stream@1.2.0 ββ redent@1.0.0 ββ registry-auth-token@4.1.1 ββ registry-url@5.1.0 ββ responselike@1.0.2 ββ rgb2hex@0.1.10 ββ rx-lite-aggregates@4.0.8 ββ rx-lite@4.0.8 ββ semver-diff@2.1.0 ββ set-immediate-shim@1.0.1 ββ shebang-loader@0.0.1 ββ single-line-log@1.1.2 ββ spectron@7.0.0 ββ speedometer@0.1.4 ββ split@1.0.1 ββ split2@3.1.1 ββ stat-mode@0.3.0 ββ sumchecker@2.0.2 ββ tar-stream@1.6.2 ββ term-size@1.2.0 ββ through2-filter@3.0.0 ββ through2-map@3.0.0 ββ to-buffer@1.1.1 ββ to-readable-stream@1.0.0 ββ trim-newlines@1.0.0 ββ truncate-utf8-bytes@1.0.2 ββ unique-string@1.0.0 ββ unzip-crx@0.2.0 ββ update-notifier@3.0.1 ββ url-parse-lax@3.0.0 ββ utf8-byte-length@1.0.4 ββ vue-cli-plugin-electron-builder@1.4.6 ββ wdio-dot-reporter@0.0.10 ββ webdriverio@4.14.4 ββ webpack-chain@5.2.4 ββ wgxpath@1.0.0 ββ widest-line@2.0.1 ββ wordwrap@0.0.3 ββ yaku@0.16.7 ββ zip-stream@1.2.0 Done in 22.74s. β Successfully installed plugin: vue-cli-plugin-electron-builder
? Choose Electron Version ^6.0.0 ? Add tests with Spectron to your project? Yes
π Invoking generator for vue-cli-plugin-electron-builder... WARN Devtools extensions are broken in Electron 6.0.0 and greater WARN Vue Devtools have been disabled, see the comments in your background file for more info π¦ Installing additional dependencies...
yarn install v1.22.4 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@2.1.3: The platform "linux" is incompatible with this module. info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@1.2.13: The platform "linux" is incompatible with this module. info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages... success Saved lockfile. $ electron-builder install-app-deps β’ electron-builder version=21.2.0 Done in 18.00s. β Running completion hooks...
WARN It is detected that you are using Vue Router. If you are using history mode, you must push the default route when the root component is loaded. Learn more at https://goo.gl/GM1xZG . error: Require statement not part of import statement (@typescript-eslint/no-var-requires) at tests/unit/electron.spec.js:1:30:
1 error found.
Expected behavior
Screenshots If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
v14.2.0
1.22.4
"vue-cli-plugin-electron-builder": "~1.4.6"
"electron": "^6.0.0"
Additional context Add any other context about the problem here.