diff --git a/apps/new/.eslintrc.json b/apps/new/.eslintrc.json new file mode 100644 index 000000000..be41074b7 --- /dev/null +++ b/apps/new/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*", "node_modules/**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/apps/new/.gitignore b/apps/new/.gitignore new file mode 100644 index 000000000..407ded969 --- /dev/null +++ b/apps/new/.gitignore @@ -0,0 +1,42 @@ +# 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/new/nativescript.config.ts b/apps/new/nativescript.config.ts new file mode 100644 index 000000000..2ddc58deb --- /dev/null +++ b/apps/new/nativescript.config.ts @@ -0,0 +1,15 @@ +import { NativeScriptConfig } from '@nativescript/core'; + +export default { + // I'd call it .new but that's a reserved token for Android + id: 'org.nativescript.dom.events.proposed', + appResourcesPath: '../../tools/assets/App_Resources', + android: { + v8Flags: '--expose_gc', + markingMode: 'none', + }, + appPath: 'src', + cli: { + packageManager: 'npm', + }, +} as NativeScriptConfig; diff --git a/apps/new/package.json b/apps/new/package.json new file mode 100644 index 000000000..8efc8d199 --- /dev/null +++ b/apps/new/package.json @@ -0,0 +1,14 @@ +{ + "main": "./src/app.ts", + "description": "New DOM Events", + "license": "SEE LICENSE IN ", + "repository": "", + "dependencies": { + "@nativescript/core": "file:../../packages/core" + }, + "devDependencies": { + "@nativescript/android": "~8.3.0", + "@nativescript/ios": "~8.3.0", + "@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz" + } +} diff --git a/apps/new/project.json b/apps/new/project.json new file mode 100644 index 000000000..eaacb51ca --- /dev/null +++ b/apps/new/project.json @@ -0,0 +1,65 @@ +{ + "name": "apps-new", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "apps/new/src", + "projectType": "application", + "prefix": "nativescript", + "namedInputs": { + "default": ["{projectRoot}/**/*"], + "production": ["!{projectRoot}/**/*.spec.ts"] + }, + "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/new/**/*.ts"] + } + } + } +} diff --git a/apps/new/references.d.ts b/apps/new/references.d.ts new file mode 100644 index 000000000..22bac92c6 --- /dev/null +++ b/apps/new/references.d.ts @@ -0,0 +1 @@ +/// diff --git a/apps/new/src/app-root.xml b/apps/new/src/app-root.xml new file mode 100644 index 000000000..54e70d976 --- /dev/null +++ b/apps/new/src/app-root.xml @@ -0,0 +1,2 @@ + + diff --git a/apps/new/src/app.scss b/apps/new/src/app.scss new file mode 100644 index 000000000..f48bce1ce --- /dev/null +++ b/apps/new/src/app.scss @@ -0,0 +1,2 @@ +@import 'nativescript-theme-core/scss/light'; +@import 'nativescript-theme-core/scss/index'; diff --git a/apps/new/src/app.ts b/apps/new/src/app.ts new file mode 100644 index 000000000..a4c5c529a --- /dev/null +++ b/apps/new/src/app.ts @@ -0,0 +1,3 @@ +import { Application } from '@nativescript/core'; + +Application.run({ moduleName: 'app-root' }); diff --git a/apps/new/src/main-page.ts b/apps/new/src/main-page.ts new file mode 100644 index 000000000..cb9b0f43f --- /dev/null +++ b/apps/new/src/main-page.ts @@ -0,0 +1,7 @@ +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/new/src/main-page.xml b/apps/new/src/main-page.xml new file mode 100644 index 000000000..08346203b --- /dev/null +++ b/apps/new/src/main-page.xml @@ -0,0 +1,13 @@ + + + + + + + +