diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ca458c1cf..1f411ac0e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -9,10 +9,10 @@ To help the rest of the community review your change, please follow the instruct ## PR Checklist -- [ ] The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md#commit-messages. +- [ ] The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/main/CONTRIBUTING.md#commit-messages. - [ ] There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it. - [ ] You have signed the [CLA](http://www.nativescript.org/cla). -- [ ] All existing tests are passing: https://github.com/NativeScript/NativeScript/blob/master/DevelopmentWorkflow.md#running-unit-tests. +- [ ] All existing tests are passing: https://github.com/NativeScript/NativeScript/blob/main/DevelopmentWorkflow.md#running-unit-tests. ## What is the current behavior? diff --git a/packages/template-blank-ng/README.md b/packages/template-blank-ng/README.md index 557c5587a..e5f1f0dc5 100644 --- a/packages/template-blank-ng/README.md +++ b/packages/template-blank-ng/README.md @@ -10,7 +10,7 @@ ns create my-blank-ng --template @nativescript/template-blank-ng > Note: This command will create a new NativeScript app that uses the latest version of this template published to [npm](https://www.npmjs.com/package/@nativescript/template-blank-ng). -If you want to create a new app that uses the source of the template from the `master` branch, you can execute the following: +If you want to create a new app that uses the source of the template from the `main` branch, you can execute the following: ``` # clone nativescript-app-templates monorepo locally @@ -20,7 +20,7 @@ git clone git@github.com:NativeScript/nativescript-app-templates.git ns create my-blank-ng --template nativescript-app-templates/packages/template-blank-ng ``` -**NB:** Please, have in mind that the master branch may refer to dependencies that are not on NPM yet! +**NB:** Please, have in mind that the main branch may refer to dependencies that are not on NPM yet! ## Walkthrough diff --git a/packages/template-blank-ng/package.json b/packages/template-blank-ng/package.json index 6885b70df..5c9c84174 100644 --- a/packages/template-blank-ng/package.json +++ b/packages/template-blank-ng/package.json @@ -3,7 +3,7 @@ "main": "src/main.ts", "displayName": "Blank", "templateType": "App template", - "version": "8.6.0", + "version": "8.7.0", "description": "Blank template for NativeScript apps using Angular", "author": "NativeScript Team ", "license": "Apache-2.0", @@ -39,26 +39,26 @@ "url": "https://github.com/NativeScript/NativeScript/issues" }, "dependencies": { - "@angular/animations": "~16.2.0", - "@angular/common": "~16.2.0", - "@angular/compiler": "~16.2.0", - "@angular/core": "~16.2.0", - "@angular/forms": "~16.2.0", - "@angular/platform-browser": "~16.2.0", - "@angular/platform-browser-dynamic": "~16.2.0", - "@angular/router": "~16.2.0", - "@nativescript/angular": "^16.0.0", - "@nativescript/core": "~8.6.0", + "@angular/animations": "~17.3.0", + "@angular/common": "~17.3.0", + "@angular/compiler": "~17.3.0", + "@angular/core": "~17.3.0", + "@angular/forms": "~17.3.0", + "@angular/platform-browser": "~17.3.0", + "@angular/platform-browser-dynamic": "~17.3.0", + "@angular/router": "~17.3.0", + "@nativescript/angular": "^17.0.0", + "@nativescript/core": "~8.7.0", "@nativescript/theme": "~3.0.2", "rxjs": "~7.8.0", - "zone.js": "~0.13.0" + "zone.js": "~0.14.0" }, "devDependencies": { - "@angular-devkit/build-angular": "~16.2.0", - "@angular/compiler-cli": "~16.2.0", - "@nativescript/types": "~8.6.0", - "@nativescript/webpack": "~5.0.18", - "@ngtools/webpack": "~16.2.0", - "typescript": "~5.1.6" + "@angular-devkit/build-angular": "~17.3.0", + "@angular/compiler-cli": "~17.3.0", + "@nativescript/types": "~8.7.0", + "@nativescript/webpack": "~5.0.19", + "@ngtools/webpack": "~17.3.0", + "typescript": "~5.4.0" } } diff --git a/packages/template-blank-react-vision/package.json b/packages/template-blank-react-vision/package.json index f54a13de0..982e168a0 100644 --- a/packages/template-blank-react-vision/package.json +++ b/packages/template-blank-react-vision/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/template-blank-react-vision", - "version": "8.6.2", + "version": "8.7.0", "description": "Nativescript visionOS Starter with React", "author": "Jamie Birch <14055146+shirakaba@users.noreply.github.com>", "main": "src/app.ts", @@ -41,18 +41,18 @@ "Vision Pro" ], "dependencies": { - "@nativescript/core": "vision", + "@nativescript/core": "~8.7.0", "react": "^18.2.0", "react-nativescript": "^5.0.0", "react-nativescript-navigation": "^5.0.0" }, "devDependencies": { - "@nativescript/tailwind": "^2.0.1", - "@nativescript/types": "~8.6.0", - "@nativescript/webpack": "vision", + "@nativescript/tailwind": "^2.1.0", + "@nativescript/types": "~8.7.0", + "@nativescript/webpack": "~5.0.0", "@types/react": "npm:types-react-without-jsx-intrinsics@^18.0.17", - "tailwindcss": "~3.2.0", - "typescript": "~5.2.0" + "tailwindcss": "~3.4.0", + "typescript": "~5.4.0" }, "gitHead": "1350d382fb4b0ed4c6e9685df909518b2688e004", "readme": "NativeScript Application" diff --git a/packages/template-blank-react/README.md b/packages/template-blank-react/README.md index a26737f96..cbe677629 100644 --- a/packages/template-blank-react/README.md +++ b/packages/template-blank-react/README.md @@ -21,7 +21,7 @@ ns run ios > Note: This command will create a new NativeScript app that uses the latest version of this template published to [npm](https://www.npmjs.com/package/@nativescript/template-blank-react). -**NB:** Please, keep in mind that the master branch may refer to dependencies that are not on NPM yet! +**NB:** Please, keep in mind that the main branch may refer to dependencies that are not on NPM yet! ## Walkthrough diff --git a/packages/template-blank-react/package.json b/packages/template-blank-react/package.json index 132708ca2..d676ce9ab 100644 --- a/packages/template-blank-react/package.json +++ b/packages/template-blank-react/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/template-blank-react", - "version": "8.6.0", + "version": "8.7.0", "description": "Blank template for NativeScript apps using React.", "author": "Jamie Birch <14055146+shirakaba@users.noreply.github.com>", "main": "src/app.ts", @@ -39,16 +39,16 @@ "template" ], "dependencies": { - "@nativescript/core": "~8.6.0", + "@nativescript/core": "~8.7.0", "react": "^18.2.0", "react-nativescript": "^5.0.0", "react-nativescript-navigation": "^5.0.0" }, "devDependencies": { - "@nativescript/types": "~8.6.0", - "@nativescript/webpack": "~5.0.18", + "@nativescript/types": "~8.7.0", + "@nativescript/webpack": "~5.0.19", "@types/react": "npm:types-react-without-jsx-intrinsics@^18.0.17", - "typescript": "~5.1.6" + "typescript": "~5.4.0" }, "gitHead": "1350d382fb4b0ed4c6e9685df909518b2688e004", "readme": "NativeScript Application" diff --git a/packages/template-blank-solid-vision/.npmrc b/packages/template-blank-solid-vision/.npmrc new file mode 100644 index 000000000..e9ee3cb4d --- /dev/null +++ b/packages/template-blank-solid-vision/.npmrc @@ -0,0 +1 @@ +legacy-peer-deps=true \ No newline at end of file diff --git a/packages/template-blank-solid-vision/package.json b/packages/template-blank-solid-vision/package.json index f08172944..832978d47 100644 --- a/packages/template-blank-solid-vision/package.json +++ b/packages/template-blank-solid-vision/package.json @@ -1,7 +1,7 @@ { "name": "@nativescript/template-blank-solid-vision", "main": "src/index.js", - "version": "8.6.3", + "version": "8.7.0", "description": "Nativescript visionOS Starter with Solid", "author": "NativeScript Team ", "license": "Apache-2.0", @@ -25,6 +25,7 @@ "patches", "types", ".editorconfig", + ".npmrc", "tailwind.config.js", "tsconfig.json", "webpack.config.js" @@ -39,13 +40,13 @@ "Vision Pro" ], "dependencies": { - "@nativescript-community/solid-js": "^0.0.4-alpha.5", - "@nativescript-community/ui-collectionview": "^5.2.0", - "@nativescript/core": "vision", - "dominative": "^0.0.9-alpha.4", + "@nativescript-community/solid-js": "^0.0.6", + "@nativescript-community/ui-collectionview": "^5.3.0", + "@nativescript/core": "~8.7.0", + "dominative": "^0.1.3", "solid-js": "^1.7.12", - "solid-navigation": "^1.0.0-alpha.8", - "undom-ng": "^1.0.10" + "solid-navigation": "^1.0.0-alpha.11", + "undom-ng": "^1.1.2" }, "devDependencies": { "@babel/core": "^7.22.10", @@ -53,14 +54,14 @@ "@babel/preset-typescript": "^7.22.5", "@nativescript-dom/core-types": "^1.0.29", "@nativescript-dom/solidjs-types": "^1.0.15", - "@nativescript/tailwind": "^2.0.1", - "@nativescript/webpack": "vision", + "@nativescript/tailwind": "^2.1.0", + "@nativescript/webpack": "~5.0.0", "babel": "^6.23.0", "babel-loader": "^9.1.3", "babel-preset-solid": "^1.7.12", "patch-package": "^8.0.0", "solid-refresh": "^0.5.3", - "tailwindcss": "~3.2.0", - "typescript": "~5.1.6" + "tailwindcss": "~3.4.0", + "typescript": "~5.4.0" } } diff --git a/packages/template-blank-solid/.gitignore b/packages/template-blank-solid/.gitignore new file mode 100644 index 000000000..1cb1231cf --- /dev/null +++ b/packages/template-blank-solid/.gitignore @@ -0,0 +1,28 @@ +# NativeScript +hooks/ +node_modules/ +platforms/ + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# General +.DS_Store +.AppleDouble +.LSOverride +.idea +.cloud +.project +tmp/ +typings/ + +# Visual Studio Code +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json diff --git a/packages/template-blank-solid/.npmrc b/packages/template-blank-solid/.npmrc new file mode 100644 index 000000000..e9ee3cb4d --- /dev/null +++ b/packages/template-blank-solid/.npmrc @@ -0,0 +1 @@ +legacy-peer-deps=true \ No newline at end of file diff --git a/packages/template-blank-solid/README.md b/packages/template-blank-solid/README.md new file mode 100644 index 000000000..b159b6831 --- /dev/null +++ b/packages/template-blank-solid/README.md @@ -0,0 +1,34 @@ +# NativeScript with Solid Blank Template +App templates help you jump start your native cross-platform apps with built-in UI elements and best practices. Save time writing boilerplate code over and over again when you create new apps. + +## Quick Start +Execute the following command to create an app from this template: + +``` +ns create my-blank-solid --template @nativescript/template-blank-solid +``` + +> Note: This command will create a new NativeScript app that uses the latest version of this template published to [npm](https://www.npmjs.com/package/@nativescript/template-blank-solid). + +If you want to create a new app that uses the source of the template from the `main` branch, you can execute the following: + +``` +# clone nativescript-app-templates monorepo locally +git clone git@github.com:NativeScript/nativescript-app-templates.git + +# create app template from local source (all templates are in the 'packages' subfolder of the monorepo) +ns create my-blank-solid --template nativescript-app-templates/packages/template-blank-solid +``` + +**NB:** Please, have in mind that the main branch may refer to dependencies that are not on NPM yet! + +## Get Help +The NativeScript framework has a vibrant community that can help when you run into problems. + +Try [joining the NativeScript community Discord](https://nativescript.org/discord). The Discord channel is a great place to get help troubleshooting problems, as well as connect with other NativeScript developers. + +If you have found an issue with this template, please report the problem in the [NativeScript repository](https://github.com/NativeScript/NativeScript/issues). + +## Contributing + +We love PRs, and accept them gladly. Feel free to propose changes and new ideas. We will review and discuss, so that they can be accepted and better integrated. diff --git a/packages/template-blank-solid/nativescript.config.ts b/packages/template-blank-solid/nativescript.config.ts new file mode 100644 index 000000000..d05e128ff --- /dev/null +++ b/packages/template-blank-solid/nativescript.config.ts @@ -0,0 +1,11 @@ +import { NativeScriptConfig } from '@nativescript/core'; + +export default { + id: 'org.nativescript.app', + appPath: 'src', + appResourcesPath: 'App_Resources', + android: { + v8Flags: '--expose_gc', + markingMode: 'none', + }, +} as NativeScriptConfig; diff --git a/packages/template-blank-solid/package.json b/packages/template-blank-solid/package.json new file mode 100644 index 000000000..8f8abf395 --- /dev/null +++ b/packages/template-blank-solid/package.json @@ -0,0 +1,60 @@ +{ + "name": "@nativescript/template-blank-solid", + "main": "src/app.js", + "version": "8.7.0", + "description": "Nativescript Starter with Solid", + "author": "NativeScript Team ", + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "https://github.com/NativeScript/nativescript-app-templates" + }, + "homepage": "https://github.com/NativeScript/nativescript-app-templates", + "bugs": { + "url": "https://github.com/NativeScript/NativeScript/issues" + }, + "publishConfig": { + "access": "public" + }, + "files": [ + "src", + "App_Resources", + "hooks", + "tools", + "!tools/assets", + "patches", + "types", + ".editorconfig", + ".npmrc", + "tailwind.config.js", + "tsconfig.json", + "webpack.config.js" + ], + "keywords": [ + "nativescript", + "mobile", + "{N}", + "solid", + "solidjs" + ], + "scripts": {}, + "dependencies": { + "@nativescript-community/solid-js": "^0.0.6", + "@nativescript/core": "~8.7.0", + "dominative": "^0.1.3", + "solid-js": "^1.8.16", + "undom-ng": "^1.1.2" + }, + "devDependencies": { + "@babel/core": "^7.24.4", + "@babel/preset-env": "^7.24.4", + "@babel/preset-typescript": "^7.24.1", + "@nativescript/tailwind": "~2.1.0", + "@nativescript/webpack": "~5.0.0", + "babel": "^6.23.0", + "babel-loader": "^9.1.3", + "babel-preset-solid": "^1.8.8", + "solid-refresh": "^0.7.5", + "tailwindcss": "~3.4.3" + } +} diff --git a/packages/template-blank-solid/src/app.css b/packages/template-blank-solid/src/app.css new file mode 100644 index 000000000..ef01ac1e0 --- /dev/null +++ b/packages/template-blank-solid/src/app.css @@ -0,0 +1,8 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +.h-center { + /* {N} specific css */ + horizontal-align: center; +} diff --git a/packages/template-blank-solid/src/app.js b/packages/template-blank-solid/src/app.js new file mode 100644 index 000000000..e1ecbdc3a --- /dev/null +++ b/packages/template-blank-solid/src/app.js @@ -0,0 +1,11 @@ +import { Application } from '@nativescript/core'; +import { render } from '@nativescript-community/solid-js'; + +import { App } from './app.jsx'; + +document.body.actionBarHidden = false; +render(App, document.body); + +const create = () => document; + +Application.run({ create }); diff --git a/packages/template-blank-solid/src/app.jsx b/packages/template-blank-solid/src/app.jsx new file mode 100644 index 000000000..2ac7f155f --- /dev/null +++ b/packages/template-blank-solid/src/app.jsx @@ -0,0 +1,34 @@ +import { createSignal } from 'solid-js'; +import { Component } from './component.jsx'; + +document.body.actionBarHidden = false; + +const App = () => { + const [count, setCount] = createSignal(0); + const increment = () => { + setCount((c) => c + 1); + }; + return ( + <> + + + + { + // use 'on:___' instead of 'on___' for event handlers + // See https://github.com/SudoMaker/dominative-solid#event-handling for detail + } + + + + + ); +}; + +export { App }; diff --git a/packages/template-blank-solid/src/component.jsx b/packages/template-blank-solid/src/component.jsx new file mode 100644 index 000000000..a943950e0 --- /dev/null +++ b/packages/template-blank-solid/src/component.jsx @@ -0,0 +1,13 @@ +export const Component = (props) => { + const { count } = props; + return ( +