Skip to content

Commit 01a8d7f

Browse files
committed
chore: bump deps & test script setup
1 parent a717361 commit 01a8d7f

File tree

12 files changed

+550
-496
lines changed

12 files changed

+550
-496
lines changed

apps/demo/app/components/App.vue

+35-36
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,45 @@
11
<template>
2-
<Frame>
3-
<Page>
4-
<ActionBar title="My Vue3 App!" />
2+
<Frame>
3+
<Page>
4+
<ActionBar title="My Vue3 App!" />
55

6-
<StackLayout ref="stackLayout">
7-
<Label>Hello World</Label>
8-
<Button @tap="toggleThing">Tap Here</Button>
9-
<HelloWorld v-if="showThing" />
10-
</StackLayout>
11-
</Page>
12-
</Frame>
6+
<StackLayout class="content" ref="stackLayout">
7+
<Label class="label">Hello World</Label>
8+
<Button @tap="toggleThing">Tap Here</Button>
9+
<HelloWorld v-if="showThing" />
10+
</StackLayout>
11+
</Page>
12+
</Frame>
1313
</template>
1414

15-
<script>
16-
import { ref, defineComponent } from 'nativescript-vue'
17-
import HelloWorld from './HelloWorld.vue';
15+
<script setup>
16+
import { ref } from 'nativescript-vue'
17+
import HelloWorld from './HelloWorld.vue'
1818
19-
export default defineComponent({
20-
components: {
21-
HelloWorld
22-
},
23-
setup() {
24-
const stackLayout = ref(null)
19+
const stackLayout = ref(null)
20+
const showThing = ref(false)
2521
26-
const showThing = ref(false);
27-
const toggleThing = () => {
28-
showThing.value = !showThing.value
29-
}
22+
function toggleThing() {
23+
showThing.value = !showThing.value
3024
31-
return {
32-
stackLayout,
33-
showThing,
34-
toggleThing,
35-
};
36-
},
37-
});
25+
console.log(stackLayout.value.nativeView)
26+
}
3827
</script>
3928

40-
<style>
41-
label {
42-
font-size: 24;
43-
color: #65adf1;
44-
text-align: center;
29+
<style scoped>
30+
/* deep selector to affect Label from HelloWorld */
31+
.content >>> Label {
32+
padding: 0 24;
33+
color: #333;
34+
font-size: 18;
35+
}
36+
37+
/* non-deep selector to affect local Label */
38+
/* order is important because the deep-selector also targets the local Label */
39+
.content > Label {
40+
font-size: 24;
41+
color: #65adf1;
42+
text-align: center;
43+
margin-top: 20;
4544
}
46-
</style>
45+
</style>

apps/demo/babel.config.js

-16
This file was deleted.

apps/demo/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"main": "app/main.js",
55
"private": true,
66
"dependencies": {
7-
"@nativescript/core": "8.0.8",
7+
"@nativescript/core": "~8.1.0",
88
"nativescript-vue": "3.0.0-dev.4"
99
},
1010
"devDependencies": {
1111
"@nativescript-vue/compiler": "3.0.0-dev.4",
12-
"@nativescript/android": "~8.0.0",
13-
"@nativescript/ios": "~8.0.0",
14-
"@nativescript/webpack": "5.0.0-rc.6",
12+
"@nativescript/android": "~8.1.1",
13+
"@nativescript/ios": "~8.1.0",
14+
"@nativescript/webpack": "~5.0.0",
1515
"vue-loader": "^16.5.0"
1616
}
1717
}

apps/demo/webpack.config.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const webpack = require('@nativescript/webpack')
22
const { VueLoaderPlugin } = require('vue-loader')
3-
const VueLoaderPath = require.resolve('vue-loader')
43

54
module.exports = (env) => {
65
webpack.init(env)
@@ -12,14 +11,23 @@ module.exports = (env) => {
1211
.rule('vue')
1312
.test(/\.vue$/)
1413
.use('vue-loader')
15-
.loader(VueLoaderPath)
14+
.loader(require.resolve('vue-loader'))
1615
.tap((options) => {
1716
return {
1817
...options,
1918
isServerBuild: false,
20-
compiler: require('@nativescript-vue/compiler'),
19+
compiler: require.resolve('@nativescript-vue/compiler'),
2120
}
2221
})
22+
23+
config.plugin('DefinePlugin').tap((args) => {
24+
Object.assign(args[0], {
25+
__VUE_OPTIONS_API__: true,
26+
__VUE_PROD_DEVTOOLS__: false,
27+
})
28+
29+
return args
30+
})
2331
})
2432

2533
return webpack.resolveConfig()

jest.config.js

+18-4
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,35 @@ module.exports = {
55
__TEST__: true,
66
__VERSION__: require('./package.json').version,
77
__BROWSER__: false,
8-
__BUNDLER__: true,
9-
__RUNTIME_COMPILE__: true,
108
__GLOBAL__: false,
9+
__ESM_BUNDLER__: true,
10+
__ESM_BROWSER__: false,
1111
__NODE_JS__: true,
1212
__FEATURE_OPTIONS_API__: true,
1313
__FEATURE_SUSPENSE__: true,
14+
__FEATURE_PROD_DEVTOOLS__: false,
15+
__COMPAT__: true,
16+
'ts-jest': {
17+
tsconfig: {
18+
target: 'esnext',
19+
sourceMap: true,
20+
},
21+
},
1422
},
1523
coverageDirectory: 'coverage',
24+
coverageProvider: 'v8',
1625
coverageReporters: ['html', 'lcov', 'text', 'json-summary'],
1726
collectCoverageFrom: [
1827
'packages/*/src/**/*.ts',
1928
'!packages/shared/**',
2029
'!packages/test-utils/**',
2130
],
22-
watchPathIgnorePatterns: ['/node_modules/', '/dist/', '/.git/'],
31+
watchPathIgnorePatterns: [
32+
'/node_modules/',
33+
'/dist/',
34+
'/.git/',
35+
'/platforms/(android|ios)/app/',
36+
],
2337
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
2438
moduleNameMapper: {
2539
'^@nativescript-vue/(.*?)$': '<rootDir>/packages/$1/src',
@@ -33,5 +47,5 @@ module.exports = {
3347
: ['/node_modules/'],
3448
setupFiles: ['<rootDir>/jest.setup.ts'],
3549
setupFilesAfterEnv: ['<rootDir>/jest.setup.afterEnv.ts'],
36-
silent: true,
50+
// silent: true,
3751
}

packages/compiler/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
},
2424
"homepage": "https://github.com/nativescript-vue/nativescript-vue/tree/dev/packages/compiler#readme",
2525
"dependencies": {
26-
"@vue/compiler-core": "^3.2.6",
27-
"@vue/compiler-sfc": "^3.2.6",
28-
"@vue/shared": "^3.2.6"
26+
"@vue/compiler-core": "^3.2.11",
27+
"@vue/compiler-sfc": "^3.2.11",
28+
"@vue/shared": "^3.2.11"
2929
}
3030
}

packages/nativescript-vue/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
"@nativescript-vue/compiler": "3.0.0-dev.4",
2727
"@nativescript-vue/runtime": "3.0.0-dev.4",
2828
"@nativescript-vue/shared": "3.0.0-dev.4",
29-
"@vue/shared": "^3.2.6"
29+
"@vue/shared": "^3.2.11"
3030
}
3131
}

packages/runtime/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
"homepage": "https://github.com/nativescript-vue/nativescript-vue/tree/dev/packages/runtime#readme",
3333
"dependencies": {
3434
"@nativescript-vue/shared": "3.0.0-dev.4",
35-
"@nativescript/core": "^8.0.8",
36-
"@vue/reactivity": "^3.2.6",
37-
"@vue/runtime-core": "^3.2.6",
38-
"@vue/shared": "^3.2.6",
39-
"set-value": "^4.0.0",
35+
"@nativescript/core": "^8.1.1",
36+
"@vue/reactivity": "^3.2.11",
37+
"@vue/runtime-core": "^3.2.11",
38+
"@vue/shared": "^3.2.11",
39+
"set-value": "^4.1.0",
4040
"unset-value": "^2.0.0"
4141
},
4242
"knownExternals": [

packages/shared/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"homepage": "https://github.com/nativescript-vue/nativescript-vue/tree/dev/packages/shared#readme",
2525
"dependencies": {
26-
"@nativescript/core": "^8.0.8"
26+
"@nativescript/core": "^8.1.1"
2727
},
2828
"knownExternals": [
2929
"@nativescript/core/trace"

packages/template-blank/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
},
2626
"homepage": "https://github.com/nativescript-vue/nativescript-vue/tree/dev/packages/template-blank#readme",
2727
"dependencies": {
28-
"@nativescript/core": "8.0.8",
28+
"@nativescript/core": "8.1.1",
2929
"nativescript-vue": "3.0.0-dev.4"
3030
},
3131
"devDependencies": {
3232
"@nativescript-vue/compiler": "3.0.0-dev.4",
33-
"@nativescript/android": "~8.0.0",
34-
"@nativescript/ios": "~8.0.0",
35-
"@nativescript/webpack": "5.0.0-rc.6",
33+
"@nativescript/android": "~8.1.1",
34+
"@nativescript/ios": "~8.1.0",
35+
"@nativescript/webpack": "5.0.0",
3636
"vue-loader": "^16.5.0"
3737
}
3838
}

packages/test-utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
},
2525
"homepage": "https://github.com/nativescript-vue/nativescript-vue/tree/dev/packages/test-utils#readme",
2626
"dependencies": {
27-
"@nativescript/core": "^8.0.8"
27+
"@nativescript/core": "^8.1.1"
2828
}
2929
}

0 commit comments

Comments
 (0)