feat(focus): interactive options for focus handling

This commit is contained in:
Nathan Walker
2020-08-19 21:34:23 -07:00
parent 315f0e0f73
commit 1007cf9d92
11 changed files with 71 additions and 111 deletions

View File

@@ -13,13 +13,10 @@ $ npm run setup
$ npm start
```
Browse commands with descriptions of all available workspace scripts.
# Packages
* [@nativescript/angular]()
* [How to contribute]()
* [@nativescript/core]()
* Core iOS/Android for NativeScript
* [How to contribute]()
* [@nativescript/types]()
* Types for both iOS/Android below wrapped up as a convenience. *Most commonly used.*
@@ -28,65 +25,8 @@ Browse commands with descriptions of all available workspace scripts.
* [@nativescript/types-android]()
* Types for Android
* [@nativescript/ui-mobile-base]()
* Base level native ui classes
* UI mobile base native classes used by core
* [How to contribute]()
* [@nativescript/webpack]()
* Webpack build utilities and configs used by NativeScript apps
* [How to contribute]()
## @nativescript/core
```bash
# livesync develop changes
$ npm start apps.playground.ios
$ npm start apps.playground.android
#
# unit tests
$ npm start packages.core.test
$ npm start packages.core.test.watch
#
# build for npm (output: 'dist/packages/core')
$ npm start packages.core.build
```
There are additional targets you can test changes against:
```bash
# variety of manual ui testing
$ npm start apps.ui.ios
$ npm start apps.ui.android
$ npm start apps.ui.clean
#
# used in CI automated tests but you can run these manually as well to check if you caused any regressions
$ npm start apps.automated.ios
$ npm start apps.automated.android
$ npm start apps.automated.clean
```
#### Compatibility package for old style tns-core-modules
Old imports from `tns-core-modules/*`
```bash
$ npm start packages.core-compat.build
```
## @nativescript/ui-mobile-base
Base native classes for ui components.
Included with @nativescript/core right now as direct dependency but also published separately for others to build on top of if desired.
If you would like to make changes to source just build when ready to test your changes (you can then clean any testing target to try your changes)
```bash
$ npm start packages.ui-mobile-base.build
```
## @nativescript/webpack
```bash
# To try any webpack changes, just build and then clean targets to try
$ npm start packages.webpack.build
#
# unit tests
$ npm start packages.webpack.test
```

View File

@@ -1,6 +1,6 @@
{
"name": "nativescript",
"version": "7.0.0-rc.51",
"version": "7.0.0-rc.52",
"license": "MIT",
"scripts": {
"setup": "npx rimraf -- hooks node_modules package-lock.json && npm i && ts-patch install && nx run core:setup",
@@ -17,6 +17,7 @@
"@nrwl/node": "~10.0.7",
"@nrwl/nx-cloud": "~10.0.0",
"@nrwl/workspace": "~10.0.7",
"@nstudio/focus": "~10.0.0",
"@types/chai": "^4.2.11",
"@types/jest": "~26.0.4",
"@types/mocha": "^7.0.2",

View File

@@ -1 +0,0 @@
Angular 11 rewrite in progress here.

View File

@@ -3,7 +3,7 @@
"main": "index",
"types": "index.d.ts",
"description": "NativeScript Core Modules",
"version": "7.0.0-rc.51",
"version": "7.0.0-rc.52",
"homepage": "https://nativescript.org",
"repository": {
"type": "git",

View File

@@ -29,7 +29,7 @@
"url": "https://github.com/NativeScript/nativescript-dev-webpack.git"
},
"scripts": {
"clean": "npx rimraf -- node_modules package-lock.json && npm i",
"clean": "npx rimraf -- node_modules package-lock.json && npm i --ignore-scripts",
"tsc": "tsc",
"postinstall": "node postinstall.js",
"preuninstall": "node preuninstall.js",

View File

@@ -1,33 +1,33 @@
export interface PlatformFSPluginOptions {
/**
* The target platform.
*/
platform?: string;
/**
* A list of all platforms. By default it is `["ios", "android", "desktop"]`.
*/
platforms?: string[];
/**
* An array of minimatch expressions used to filter nodes from the file system.
*/
ignore?: string[];
/**
* The target platform.
*/
platform?: string;
/**
* A list of all platforms. By default it is `["ios", "android", "desktop"]`.
*/
platforms?: string[];
/**
* An array of minimatch expressions used to filter nodes from the file system.
*/
ignore?: string[];
}
export declare class PlatformFSPlugin {
protected readonly platform: string;
protected readonly platforms: ReadonlyArray<string>;
protected readonly ignore: ReadonlyArray<string>;
protected context: string;
constructor({ platform, platforms, ignore }: PlatformFSPluginOptions);
apply(compiler: any): void;
protected readonly platform: string;
protected readonly platforms: ReadonlyArray<string>;
protected readonly ignore: ReadonlyArray<string>;
protected context: string;
constructor({ platform, platforms, ignore }: PlatformFSPluginOptions);
apply(compiler: any): void;
}
export interface MapFileSystemArgs {
/**
* This is the underlying webpack compiler.inputFileSystem, its interface is similar to Node's fs.
*/
readonly context: string;
readonly platform: string;
readonly platforms: ReadonlyArray<string>;
readonly ignore: ReadonlyArray<string>;
readonly compiler: any;
/**
* This is the underlying webpack compiler.inputFileSystem, its interface is similar to Node's fs.
*/
readonly context: string;
readonly platform: string;
readonly platforms: ReadonlyArray<string>;
readonly ignore: ReadonlyArray<string>;
readonly compiler: any;
}
export declare function mapFileSystem(args: MapFileSystemArgs): any;

View File

@@ -1,13 +1,13 @@
export declare enum messages {
compilationComplete = 'Webpack compilation complete.',
startWatching = 'Webpack compilation complete. Watching for file changes.',
changeDetected = 'File change detected. Starting incremental webpack compilation...',
compilationComplete = "Webpack compilation complete.",
startWatching = "Webpack compilation complete. Watching for file changes.",
changeDetected = "File change detected. Starting incremental webpack compilation..."
}
/**
* This little plugin will report the webpack state through the console.
* So the {N} CLI can get some idea when compilation completes.
*/
export declare class WatchStateLoggerPlugin {
isRunningWatching: boolean;
apply(compiler: any): void;
isRunningWatching: boolean;
apply(compiler: any): void;
}

View File

@@ -3,6 +3,6 @@ import { TransformOperation } from '@ngtools/webpack/src/transformers';
import { AngularCompilerPlugin } from '@ngtools/webpack';
export declare function nsSupportHmrNg(getNgCompiler: () => AngularCompilerPlugin, entryPath: string): ts.TransformerFactory<ts.SourceFile>;
export declare function handleHmrSupport(mainFile: ts.SourceFile): TransformOperation[];
export declare const GeneratedDynamicAppOptions = 'options_Generated';
export declare const GeneratedDynamicAppOptions = "options_Generated";
export declare function getHmrOptionsCode(appModuleName: string, appModulePath: string): string;
export declare function getAcceptMainModuleCode(mainModulePath: string): string;

View File

@@ -11,10 +11,7 @@ export declare function getAppModulePath(mainPath: string): string;
export declare function findIdentifierNode(node: ts.Node, text: string): ts.Node | null;
export declare function getObjectPropertyMatches(objectNode: ts.ObjectLiteralExpression, sourceFile: ts.SourceFile, targetPropertyName: string): ts.ObjectLiteralElement[];
export declare function getDecoratorMetadata(source: ts.SourceFile, identifier: string, module: string): ts.Node[];
export declare function angularImportsFromNode(
node: ts.ImportDeclaration,
_sourceFile: ts.SourceFile
): {
[name: string]: string;
export declare function angularImportsFromNode(node: ts.ImportDeclaration, _sourceFile: ts.SourceFile): {
[name: string]: string;
};
export declare function getExpressionName(expression: ts.Expression): string;

View File

@@ -1,8 +1,5 @@
import { AngularCompilerPlugin } from '@ngtools/webpack';
export declare function getResolvedEntryModule(
ngCompiler: AngularCompilerPlugin,
projectDir: string
): {
path: any;
className: string;
export declare function getResolvedEntryModule(ngCompiler: AngularCompilerPlugin, projectDir: string): {
path: any;
className: string;
};

View File

@@ -2,7 +2,7 @@ const npsUtils = require('nps-utils');
module.exports = {
message: 'NativeScript ~ made with ❤️ Choose a command to start...',
pageSize: 25,
pageSize: 32,
scripts: {
default: 'nps-i',
nx: {
@@ -125,6 +125,32 @@ module.exports = {
},
},
},
"⚡": {
script: `npx cowsay "Focus on segments of monorepo for efficiency ⚡"`,
description: '_____________ Focus on source (VS Code supported) _____________'
},
'focus': {
core: {
script: 'nx g @nstudio/focus:mode core',
description: 'Focus on @nativescript/core'
},
types: {
script: 'nx g @nstudio/focus:mode types-android,types-ios',
description: 'Focus on @nativescript/types'
},
'ui-mobile-base': {
script: 'nx g @nstudio/focus:mode ui-mobile-base',
description: 'Focus on @nativescript/ui-mobile-base'
},
webpack: {
script: 'nx g @nstudio/focus:mode webpack',
description: 'Focus on @nativescript/webpack'
},
reset: {
script: 'nx g @nstudio/focus:mode',
description: 'Reset Focus'
}
},
".....................": {
script: `npx cowsay "That's all for now folks ~"`,
description: '.....................'