Skip to content
This repository was archived by the owner on Nov 9, 2023. It is now read-only.

Commit a05def1

Browse files
committed
chore(package): upgrade tauri
1 parent a0b9540 commit a05def1

File tree

5 files changed

+219
-660
lines changed

5 files changed

+219
-660
lines changed

__tests__/createProject.helper.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ const create = require('@vue/cli-test-utils/createTestProject')
22
const { defaultPreset } = require('@vue/cli/lib/options')
33
const path = require('path')
44

5-
module.exports = projectName => {
5+
module.exports = (projectName) => {
66
const preset = { ...defaultPreset }
7-
preset.plugins['vue-cli-plugin-tauri'] = {}
7+
preset.plugins['vue-cli-plugin-tauri'] = {
8+
appName: 'app'
9+
}
810
delete preset.plugins['@vue/cli-plugin-eslint']
911

1012
return create(

generator/index.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const execa = require('execa')
22
const { error } = require('@vue/cli-shared-utils')
3-
const init = require('tauri/dist/api/init')
3+
const { init } = require('@tauri-apps/cli/dist/api/cli')
44

55
module.exports = async (api, options) => {
66
await execa('cargo', ['tauri-bundler', '--version']).catch(() => {
@@ -13,14 +13,9 @@ module.exports = async (api, options) => {
1313
init({
1414
directory: api.resolve('.'),
1515
appName: options.appName,
16-
customConfig: {
17-
build: null,
18-
tauri: {
19-
window: {
20-
title: options.windowTitle
21-
}
22-
}
23-
}
16+
windowTitle: options.windowTitle,
17+
distDir: 'Set automatically by Vue CLI plugin',
18+
devPath: 'Set automatically by Vue CLI plugin'
2419
})
2520

2621
api.extendPackage({

index.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ module.exports = (api, options) => {
3636
usage: 'todo'
3737
},
3838
async () => {
39-
const dev = require('tauri/dist/api/dev')
39+
const { dev } = require('@tauri-apps/cli/dist/api/cli')
4040

4141
// Use custom config for webpack
4242
process.env.TAURI_SERVE = true
4343

4444
const server = await api.service.run('serve')
4545

4646
return dev({
47-
build: {
48-
// Has to be a valid dir, contents don't matter
49-
distDir: api.resolve('.'),
50-
devPath: server.url
47+
config: {
48+
build: {
49+
devPath: server.url
50+
}
5151
}
5252
})
5353
}
@@ -61,7 +61,7 @@ module.exports = (api, options) => {
6161
usage: 'todo'
6262
},
6363
async (args) => {
64-
const build = require('tauri/dist/api/build')
64+
const { build } = require('@tauri-apps/cli/dist/api/cli')
6565
const { error } = require('@vue/cli-shared-utils')
6666

6767
// Use custom config for webpack
@@ -83,13 +83,14 @@ module.exports = (api, options) => {
8383
}
8484

8585
build({
86-
build: {
87-
// Has to be a non-empty string, value doesn't matter
88-
devPath: ' ',
89-
distDir: './target/webpack_dist'
86+
config: {
87+
build: {
88+
distDir: './target/webpack_dist'
89+
}
9090
},
91-
ctx: { debug: args.debug },
92-
verbose: args.verbose
91+
verbose: args.v || args.verbose || false,
92+
debug: args.d || args.debug || false,
93+
target: args.t || args.target || false
9394
})
9495
}
9596
)

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"pretest": "rimraf __tests__/temp_projects/*"
1212
},
1313
"dependencies": {
14+
"@tauri-apps/cli": "^1.0.0-beta-rc.1",
1415
"@vue/cli-shared-utils": "^4.1.1",
15-
"execa": "^3.4.0",
16-
"tauri": "^0.14.0"
16+
"execa": "^3.4.0"
1717
},
1818
"devDependencies": {
1919
"@vue/cli": "^4.1.1",

0 commit comments

Comments
 (0)