diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..5d47c21c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 00000000..f2016043 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +echo "\n---- Commit Lint ----\n"; +npx --no-install commitlint --edit "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..fc41fd7c --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +echo "\n---- Lint Staged ----\n"; +npx --no-install lint-staged --config=package.json diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..ed974f65 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +demo/hooks +demo/platforms +demo/App_Resources +dist/ diff --git a/.vscode/settings.json b/.vscode/settings.json index 7cf936a1..2cf42421 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,21 +1,19 @@ { - "files.exclude": { - "**/.git": true, - "**/.svn": true, - "**/.hg": true, - "**/CVS": true, - "**/.DS_Store": true, - "**/Thumbs.db": true, - "**/*.js": { - "when": "$(basename).ts" - }, - "**/*.map": true, - "**/.idea": false, - "**/.tscache": true, - "**/node_modules": false + "files.exclude": { + "**/.git": true, + "**/.svn": true, + "**/.hg": true, + "**/CVS": true, + "**/.DS_Store": true, + "**/Thumbs.db": true, + "**/*.js": { + "when": "$(basename).ts" }, + "**/*.map": true, + "**/.idea": false, + "**/.tscache": true, + "**/node_modules": false + }, - "html.customData": [ - "./test.json" - ] -} \ No newline at end of file + "html.customData": ["./test.json"] +} diff --git a/README.md b/README.md index 92fe7f21..d4944120 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@

NativeScript-Vue3 Beta

-

npm @@ -14,7 +13,6 @@

- NativeScript-Vue with Vue3 support now in beta! ## Quick start @@ -38,7 +36,6 @@ If you encounter any issues, please open a new issue with as much detail as poss - [Join Discord](https://nativescript.org/discord) - ## Looking for V2? The V2 version has been moved to the [v2 branch](https://github.com/nativescript-vue/nativescript-vue/tree/v2) diff --git a/build.js b/build.js index cc4943ca..b64a31ef 100644 --- a/build.js +++ b/build.js @@ -1,6 +1,6 @@ -import path from "path"; -import { fileURLToPath } from "url"; -import { build } from "esbuild"; +import path from 'path'; +import { fileURLToPath } from 'url'; +import { build } from 'esbuild'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); @@ -9,17 +9,17 @@ try { await build({ bundle: true, sourcemap: true, - format: "cjs", + format: 'cjs', // target: "node", - external: ["@nativescript/core"], - entryPoints: [path.join(__dirname, "src", "index.ts")], - outdir: path.join(__dirname, "dist"), + external: ['@nativescript/core'], + entryPoints: [path.join(__dirname, 'src', 'index.ts')], + outdir: path.join(__dirname, 'dist'), // outExtension: { ".js": ".mjs" }, define: { __VUE_OPTIONS_API__: true, - __VUE_PROD_DEVTOOLS__: true - } + __VUE_PROD_DEVTOOLS__: true, + }, }); } catch { process.exitCode = 1; -} \ No newline at end of file +} diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 00000000..84dcb122 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['@commitlint/config-conventional'], +}; diff --git a/demo/App_Resources/iOS/Podfile b/demo/App_Resources/iOS/Podfile index 2d64ef8f..29ba7ae7 100644 --- a/demo/App_Resources/iOS/Podfile +++ b/demo/App_Resources/iOS/Podfile @@ -1 +1,11 @@ +platform :ios, '13.0' + pod 'FPSCounter', '~> 4.1' + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' + end + end +end diff --git a/demo/App_Resources/iOS/build.xcconfig b/demo/App_Resources/iOS/build.xcconfig index ce70bff2..6756306d 100644 --- a/demo/App_Resources/iOS/build.xcconfig +++ b/demo/App_Resources/iOS/build.xcconfig @@ -1,8 +1,10 @@ // You can add custom settings here // for example you can uncomment the following line to force distribution code signing -// CODE_SIGN_IDENTITY = iPhone Distribution +// CODE_SIGN_IDENTITY = iPhone Distribution // To build for device with XCode you need to specify your development team. // DEVELOPMENT_TEAM = YOUR_TEAM_ID; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = 3462C7DLZZ + +IPHONEOS_DEPLOYMENT_TARGET = 13.0; diff --git a/demo/app/app.ts b/demo/app/app.ts index 58cd327c..0c04a034 100644 --- a/demo/app/app.ts +++ b/demo/app/app.ts @@ -1,13 +1,9 @@ -import { createApp } from "vue"; +import { createApp } from 'nativescript-vue'; -// @ts-ignore -global.window = global; -// import Home from './components/Home.vue' - -import App from "./components/demo_ListView.vue"; +import App from './components/demo_ListView.vue'; createApp(App) .use(() => { - console.log("test1"); + console.log('test1'); }) .start(); diff --git a/demo/app/components/Bench.vue b/demo/app/components/Bench.vue index d529e621..dd085802 100644 --- a/demo/app/components/Bench.vue +++ b/demo/app/components/Bench.vue @@ -6,7 +6,7 @@ export default { show: false, iter: 0, - times: [], + times: [] as number[], }; }, methods: { @@ -24,11 +24,11 @@ export default { if (this.iter < 5) { setTimeout(() => { - console.log("hide now"); + console.log('hide now'); this.show = false; setTimeout(() => { - console.log("and. start."); + console.log('and. start.'); this.start(); }, 5000); }, 2000); @@ -62,12 +62,8 @@ export default { /> diff --git a/demo/app/components/GH1010.vue b/demo/app/components/GH1010.vue index e5f750f1..e87149e3 100644 --- a/demo/app/components/GH1010.vue +++ b/demo/app/components/GH1010.vue @@ -1,23 +1,24 @@ - diff --git a/demo/app/components/GH1010.yaml b/demo/app/components/GH1010.yaml index 45bb76a2..fe0a454e 100644 --- a/demo/app/components/GH1010.yaml +++ b/demo/app/components/GH1010.yaml @@ -1,8 +1,8 @@ appId: org.nativescript.demo --- - launchApp -- assertVisible: "Tap Count: 0" -- tapOn: "Tap: Button" -- assertVisible: "Tap Count: 1" -- tapOn: "Tap: Label" -- assertVisible: "Tap Count: 2" +- assertVisible: 'Tap Count: 0' +- tapOn: 'Tap: Button' +- assertVisible: 'Tap Count: 1' +- tapOn: 'Tap: Label' +- assertVisible: 'Tap Count: 2' diff --git a/demo/app/components/GH1011.vue b/demo/app/components/GH1011.vue index e284e69f..013cce93 100644 --- a/demo/app/components/GH1011.vue +++ b/demo/app/components/GH1011.vue @@ -4,6 +4,6 @@ text="Test text" class="text-2xl m-6" backgroundColor="yellow" - style="background-color: red;" + style="background-color: red" > diff --git a/demo/app/components/GH1012.vue b/demo/app/components/GH1012.vue index 9773c8e6..b30df138 100644 --- a/demo/app/components/GH1012.vue +++ b/demo/app/components/GH1012.vue @@ -1,11 +1,14 @@ diff --git a/demo/app/components/Test.vue b/demo/app/components/Test.vue index 4d8cf76c..3a81922a 100644 --- a/demo/app/components/Test.vue +++ b/demo/app/components/Test.vue @@ -1,3 +1,3 @@ diff --git a/demo/app/components/demo_ListView.vue b/demo/app/components/demo_ListView.vue index d2792ba5..4556961b 100644 --- a/demo/app/components/demo_ListView.vue +++ b/demo/app/components/demo_ListView.vue @@ -1,15 +1,17 @@