chore: cleanup

This commit is contained in:
Nathan Walker
2020-07-23 14:03:37 -07:00
parent 6d039909af
commit 1e6fccf272
1534 changed files with 45656 additions and 45945 deletions

42
apps/playground/.gitignore vendored Normal file
View File

@@ -0,0 +1,42 @@
# NativeScript
hooks/
node_modules/
platforms/
# NativeScript Template
*.js.map
*.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
!tools/**

View File

@@ -0,0 +1,4 @@
{
"appResourcesPath": "../../tools/assets/App_Resources",
"appPath": "src"
}

View File

@@ -0,0 +1,23 @@
{
"nativescript": {
"id": "org.ns.testcore",
"tns-ios": {
"version": "6.5.0"
},
"tns-android": {
"version": "6.5.0"
}
},
"main": "app.js",
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"nativescript-theme-core": "file:../../node_modules/nativescript-theme-core",
"@nativescript/core": "file:../../packages/core"
},
"devDependencies": {
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
"typescript": "file:../../node_modules/typescript"
}
}

2
apps/playground/references.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
/// <reference path="../../types-ios/src/lib/ios.d.ts" />
/// <reference path="../../types-android/src/lib/android-29.d.ts" />

View File

@@ -0,0 +1,2 @@
<Frame defaultPage="main-page">
</Frame>

View File

@@ -0,0 +1,21 @@
/*
In NativeScript, the app.css file is where you place CSS rules that
you would like to apply to your entire application. Check out
http://docs.nativescript.org/ui/styling for a full list of the CSS
selectors and properties you can use to style UI components.
/*
In many cases you may want to use the NativeScript core theme instead
of writing your own CSS rules. For a full list of class names in the theme
refer to http://docs.nativescript.org/ui/theme.
The imported CSS rules must precede all other types of rules.
*/
@import '~nativescript-theme-core/css/core.light.css';
/*
The following CSS rule changes the font size of all UI
components that have the btn class name.
*/
.btn {
font-size: 18;
}

View File

@@ -0,0 +1,3 @@
import { Application } from '@nativescript/core';
Application.run({ moduleName: 'app-root' });

View File

@@ -0,0 +1,7 @@
import { EventData, Page } from '@nativescript/core';
import { HelloWorldModel } from './main-view-model';
export function navigatingTo(args: EventData) {
const page = <Page>args.object;
page.bindingContext = new HelloWorldModel();
}

View File

@@ -0,0 +1,11 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page">
<Page.actionBar>
<ActionBar title="My App" icon="" class="action-bar">
</ActionBar>
</Page.actionBar>
<StackLayout class="p-20">
<Label text="Tap the button" class="h1 text-center"/>
<Button text="TAP" tap="{{ onTap }}" class="btn btn-primary btn-active"/>
<Label text="{{ message }}" class="h2 text-center" textWrap="true"/>
</StackLayout>
</Page>

View File

@@ -0,0 +1,38 @@
import { Observable } from '@nativescript/core';
export class HelloWorldModel extends Observable {
private _counter: number;
private _message: string;
constructor() {
super();
// Initialize default values.
this._counter = 42;
this.updateMessage();
}
get message(): string {
return this._message;
}
set message(value: string) {
if (this._message !== value) {
this._message = value;
this.notifyPropertyChange('message', value);
}
}
onTap() {
this._counter--;
this.updateMessage();
}
private updateMessage() {
if (this._counter <= 0) {
this.message = 'Hoorraaay! You unlocked the NativeScript clicker achievement!';
} else {
this.message = `${this._counter} taps left`;
}
}
}

View File

@@ -0,0 +1,10 @@
{
"main": "app.js",
"android": {
"v8Flags": "--nolazy --expose_gc",
"markingMode": "none",
"codeCache": "true",
"suppressCallJSMethodExceptions": false
},
"discardUncaughtJsExceptions": false
}

View File

@@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noEmitHelpers": true,
"noEmitOnError": true,
"skipLibCheck": true,
"lib": ["es2018", "dom"],
"baseUrl": ".",
"paths": {
"~/*": ["src/*"]
}
},
"exclude": ["node_modules", "platforms"]
}

View File

@@ -0,0 +1,7 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"module": "esnext",
"moduleResolution": "node"
}
}