diff --git a/.gitignore b/.gitignore index 155dab1..742dab1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # See http://help.github.com/ignore-files/ for more about ignoring files. /apps/demo-vue +/packages/vue/.vitepress/cache /apps/NativeScriptVueUse-demo # compiled output /dist @@ -43,3 +44,6 @@ Thumbs.db *.tgz packages/**/angular/dist + +.nx/cache +.nx/workspace-data \ No newline at end of file diff --git a/.prettierignore b/.prettierignore index 413ca14..342760a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,3 +3,6 @@ /dist /coverage native-src + +/.nx/cache +/.nx/workspace-data \ No newline at end of file diff --git a/README.md b/README.md index 6d1774f..2462bcb 100644 --- a/README.md +++ b/README.md @@ -1,56 +1,45 @@ -- [@vallemar/nativescript-clipboard](packages/nativescript-clipboard/README.md) -- [@vallemar/nativescript-keyboard](packages/nativescript-keyboard/README.md) -- [@vallemar/nativescript-orientation](packages/nativescript-orientation/README.md) -- [@vallemar/nativescript-vueuse](packages/nativescript-vueuse/README.md) +# NativeScript-Use -# How to use? +Collection of NativeScript-Use Composition Utilities -This workspace manages the suite of plugins listed above. +[Documentation (Vue3)](https://nativescriptuse-vue.netlify.app/) +
-In general, when in doubt with what to do, just `npm start`. +This library tries to cover all the `-use` libraries of the frameworks with NativeScript. +Examples: +- [VueUse](https://vueuse.org/) +- [svelte-use](https://svelte-use.vercel.app/) +- [react-use](https://github.com/streamich/react-use) +- [solid-use](https://github.com/lxsmnsyc/solid-use) -## How to add a new package to workspace? +## `Use`Packages +- [@nativescript-use/vue (Vue3)](packages/vue/README.md) -``` -npm run add -``` +As native dependencies, the native code packages have been created in TS so that the core of `NativeScript-Use` is common. Anyone who wants can contribute to create another savor for example: `@nativescript-use/svelte`. +
-At the prompt, enter the name of the new package. +The following plugins are the core of some of the native functionality already being used in `@nativescript-use/vue`, they have been separated so they can be used for any `@nativescript-use/[any_flavor]` flavor and also, so they can be used as individual plugins. inside nativescript -- This adds a plugin harness in `packages` with the necessary boilerplate to just start developing -- Updates all demo app flavors to support demoing the new package -- Adds shared code in `tools/demo` where you can write demo code **once** and share across all demo flavors -- Updates build tooling to support the new package -- Updates the `npm start` interactive display -- Updates the README here to list the new package +- [@nativescript-use/change-icon](packages/change-icon/README.md) +- [@nativescript-use/nativescript-clipboard](packages/nativescript-clipboard/README.md) +- [@nativescript-use/nativescript-intersection-observer](packages/nativescript-intersection-observer/README.md) +- [@nativescript-use/nativescript-keyboard](packages/nativescript-keyboard/README.md) +- [@nativescript-use/nativescript-localstorage](packages/nativescript-localstorage/README.md) +- [@nativescript-use/nativescript-media-query](packages/nativescript-media-query/README.md) +- [@nativescript-use/nativescript-orientation](packages/nativescript-orientation/README.md) +- [@nativescript-use/nativescript-task](packages/nativescript-task/README.md) -## How to add Angular compatibility to a package +# How to contribute? -``` -npm run add-angular -``` +- clone the repository. +- run: `npm run setup` +- clone app in folder `/apps/` for test and preview in docs: `git clone https://github.com/NativeScript-Use/demo-vue.git` +- run app in root folder: `npm run demo:vue:android` or `npm run demo:vue:ios` +- add your changes in `./packages/vue` -At the prompt, enter the name of the package to add an `angular` folder to it with the necessary boilerplate to provide Angular support to the package. +Now all the changes that you add will make the application restart and you will be able to add see the effect of your changes -## How to focus on just 1 package to develop in isolation +For more information you can enter the [NativeScript discord server](https://discord.com/invite/RgmpGky9GR)! -``` -npm start -``` - -- Choose the focus commands for the package you wish to focus on and hit enter. -- All the demo app's will be updated to isolate that 1 package and for supported IDE's (currently VS Code), the source code will also become isolated in the workspace. - -Note: *good to always clean the demo you plan to run after focusing. (You can clean any demo from `npm start` as well)* - -## How to publish packages? - -``` -npm run publish-packages -``` - -- You will be prompted for the package names to publish. Leaving blank and hitting enter will publish them all. -- You will then be prompted for the version to use. Leaving blank will auto bump the patch version (it also handles prerelease types like alpha, beta, rc, etc. - It even auto tags the corresponding prelease type on npm). -- You will then be given a brief sanity check 🧠😊

Made with ❤️

diff --git a/apps/demo/.gitignore b/apps/demo/.gitignore deleted file mode 100644 index 407ded9..0000000 --- a/apps/demo/.gitignore +++ /dev/null @@ -1,42 +0,0 @@ -# NativeScript -hooks/ -node_modules/ -platforms/ - -# NativeScript Template -*.js.map -*.js -!webpack.config.js - -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# General -.DS_Store -.AppleDouble -.LSOverride -.idea -.cloud -.project -tmp/ -typings/ - -# misc -npm-debug.log - -# app -!*.d.ts -!src/assets/fontawesome.min.css -/report/ -.nsbuildinfo -/temp/ -/src/tns_modules/ - -# app uses platform specific scss which can inadvertently get renamed which will cause problems -app/app.scss - -package-lock.json diff --git a/apps/demo/nativescript.config.ts b/apps/demo/nativescript.config.ts deleted file mode 100644 index a0a66bc..0000000 --- a/apps/demo/nativescript.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { NativeScriptConfig } from '@nativescript/core'; - -export default { - id: 'org.nativescript.plugindemo', - appResourcesPath: '../../tools/assets/App_Resources', - android: { - v8Flags: '--expose_gc', - markingMode: 'none', - }, - appPath: 'src', - cli: { - packageManager: 'npm' - } -} as NativeScriptConfig; diff --git a/apps/demo/package.json b/apps/demo/package.json deleted file mode 100644 index 1bd86c9..0000000 --- a/apps/demo/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "main": "./src/app.ts", - "description": "NativeScript Application", - "license": "SEE LICENSE IN ", - "repository": "", - "dependencies": { - "@nativescript/core": "file:../../node_modules/@nativescript/core", - "@vallemar/nativescript-vueuse": "file:../../packages/nativescript-vueuse", - "@vallemar/nativescript-orientation": "file:../../packages/nativescript-orientation", - "@vallemar/nativescript-keyboard": "file:../../packages/nativescript-keyboard", - "@vallemar/nativescript-clipboard": "file:../../packages/nativescript-clipboard" - }, - "devDependencies": { - "@nativescript/android": "~8.4.0", - "@nativescript/ios": "~8.4.0" - } -} diff --git a/apps/demo/project.json b/apps/demo/project.json deleted file mode 100644 index ddda9cc..0000000 --- a/apps/demo/project.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "demo", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "apps/demo/src", - "projectType": "application", - "prefix": "demo", - "targets": { - "build": { - "executor": "@nativescript/nx:build", - "options": { - "noHmr": true, - "production": true, - "uglify": true, - "release": true, - "forDevice": true - }, - "dependsOn": [ - { - "target": "build.all", - "projects": "dependencies" - } - ] - }, - "ios": { - "executor": "@nativescript/nx:build", - "options": { - "platform": "ios" - }, - "dependsOn": [ - { - "target": "build.all", - "projects": "dependencies" - } - ] - }, - "android": { - "executor": "@nativescript/nx:build", - "options": { - "platform": "android" - }, - "dependsOn": [ - { - "target": "build.all", - "projects": "dependencies" - } - ] - }, - "clean": { - "executor": "@nativescript/nx:build", - "options": { - "clean": true - } - }, - "lint": { - "executor": "@nrwl/linter:eslint", - "options": { - "lintFilePatterns": ["apps/demo/**/*.ts"] - } - } - } -} diff --git a/apps/demo/src/app-root.xml b/apps/demo/src/app-root.xml deleted file mode 100644 index 54e70d9..0000000 --- a/apps/demo/src/app-root.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/apps/demo/src/app.scss b/apps/demo/src/app.scss deleted file mode 100644 index d0ac013..0000000 --- a/apps/demo/src/app.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import 'nativescript-theme-core/scss/light'; -@import 'nativescript-theme-core/scss/index'; \ No newline at end of file diff --git a/apps/demo/src/app.ts b/apps/demo/src/app.ts deleted file mode 100644 index a4c5c52..0000000 --- a/apps/demo/src/app.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Application } from '@nativescript/core'; - -Application.run({ moduleName: 'app-root' }); diff --git a/apps/demo/src/main-page.ts b/apps/demo/src/main-page.ts deleted file mode 100644 index 89e6b7a..0000000 --- a/apps/demo/src/main-page.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { EventData, Page } from '@nativescript/core'; -import { MainViewModel } from "./main-view-model"; - -export function navigatingTo(args: EventData) { - const page = args.object; - page.bindingContext = new MainViewModel(); -} diff --git a/apps/demo/src/main-page.xml b/apps/demo/src/main-page.xml deleted file mode 100644 index e4a737a..0000000 --- a/apps/demo/src/main-page.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - -