8000 chore: tooling · NativeScript/plugins@b8180f8 · GitHub
[go: up one dir, main page]

Skip to content

Commit b8180f8

Browse files
committed
chore: tooling
1 parent eeecf91 commit b8180f8

File tree

10 files changed

+204
-127
lines changed

apps/demo-angular/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
"reflect-metadata": "file:../../node_modules/reflect-metadata",
1616
"rxjs": "file:../../node_modules/rxjs",
1717
"zone.js": "file:../../node_modules/zone.js",
18-
"@nativescript/camera": "file:../../dist/packages/camera",
18+
"@nativescript/email": "file:../../dist/packages/email",
1919
"@nativescript/appavailability": "file:../../dist/packages/appavailability",
20+
"@nativescript/camera": "file:../../dist/packages/camera",
2021
"@nativescript/datetimepicker": "file:../../dist/packages/datetimepicker",
2122
"@nativescript/directions": "file:../../dist/packages/directions",
22-
"@nativescript/email": "file:../../dist/packages/email",
2323
"@nativescript/fingerprint-auth": "file:../../dist/packages/fingerprint-auth",
2424
"@nativescript/geolocation": "file:../../dist/packages/geolocation",
2525
"@nativescript/imagepicker": "file:../../dist/packages/imagepicker",

apps/demo-angular/src/app-routing.module.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ import { NativeScriptRouterModule } from '@nativescript/angular';
55
import { HomeComponent } from './home.component';
66

77
const routes: Routes = [
8-
{ path: '', redirectTo: '/home', pathMatch: 'full' },
9-
{ path: 'home', component: HomeComponent },
10-
{ path: 'appavailability', loadChildren: () => import('./plugin-demos/appavailability.module').then((m) => m.AppavailabilityModule) },
11-
{ path: 'camera', loadChildren: () => import('./plugin-demos/camera.module').then((m) => m.CameraModule) },
12-
{ path: 'datetimepicker', loadChildren: () => import('./plugin-demos/datetimepicker.module').then((m) => m.DatetimepickerModule) },
13-
{ path: 'directions', loadChildren: () => import('./plugin-demos/directions.module').then((m) => m.DirectionsModule) },
14-
{ path: 'email', loadChildren: () => import('./plugin-demos/email.module').then((m) => m.EmailModule) },
15-
{ path: 'fingerprint-auth', loadChildren: () => import('./plugin-demos/fingerprint-auth.module').then((m) => m.FingerprintAuthModule) },
16-
{ path: 'geolocation', loadChildren: () => import('./plugin-demos/geolocation.module').then((m) => m.GeolocationModule) },
17-
{ path: 'imagepicker', loadChildren: () => import('./plugin-demos/imagepicker.module').then((m) => m.ImagepickerModule) },
18-
{ path: 'iqkeyboardmanager', loadChildren: () => import('./plugin-demos/iqkeyboardmanager.module').then((m) => m.IqkeyboardmanagerModule) },
19-
{ path: 'local-notifications', loadChildren: () => import('./plugin-demos/local-notifications.module').then((m) => m.LocalNotificationsModule) },
20-
{ path: 'shared-notification-delegate', loadChildren: () => import('./plugin-demos/shared-notification-delegate.module').then((m) => m.SharedNotificationDelegateModule) },
21-
{ path: 'zip', loadChildren: () => import('./plugin-demos/zip.module').then((m) => m.ZipModule) },
8+
{ path: '', redirectTo: '/home', pathMatch: 'full' },
9+
{ path: 'home', component: HomeComponent },
10+
{ path: 'appavailability', loadChildren: () => import('./plugin-demos/appavailability.module').then(m => m.AppavailabilityModule) },
11+
{ path: 'camera', loadChildren: () => import('./plugin-demos/camera.module').then(m => m.CameraModule) },
12+
{ path: 'datetimepicker', loadChildren: () => import('./plugin-demos/datetimepicker.module').then(m => m.DatetimepickerModule) },
13+
{ path: 'directions', loadChildren: () => import('./plugin-demos/directions.module').then(m => m.DirectionsModule) },
14+
{ path: 'email', loadChildren: () => import('./plugin-demos/email.module').then(m => m.EmailModule) },
15+
{ path: 'fingerprint-auth', loadChildren: () => import('./plugin-demos/fingerprint-auth.module').then(m => m.FingerprintAuthModule) },
16+
{ path: 'geolocation', loadChildren: () => import('./plugin-demos/geolocation.module').then(m => m.GeolocationModule) },
17+
{ path: 'imagepicker', loadChildren: () => import('./plugin-demos/imagepicker.module').then(m => m.ImagepickerModule) },
18+
{ path: 'iqkeyboardmanager', loadChildren: () => import('./plugin-demos/iqkeyboardmanager.module').then(m => m.IqkeyboardmanagerModule) },
19+
{ path: 'local-notifications', loadChildren: () => import('./plugin-demos/local-notifications.module').then(m => m.LocalNotificationsModule) },
20+
{ path: 'shared-notification-delegate', loadChildren: () => import('./plugin-demos/shared-notification-delegate.module').then(m => m.SharedNotificationDelegateModule) },
21+
{ path: 'zip', loadChildren: () => import('./plugin-demos/zip.module').then(m => m.ZipModule) }
2222
];
2323

2424
@NgModule({

apps/demo-angular/src/home.component.ts

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,41 @@ import { Component } from '@angular/core';
66
})
77
export class HomeComponent {
88
demos = [
9-
{
10-
name: 'appavailability',
11-
},
12-
{
13-
name: 'camera',
14-
},
15-
{
16-
name: 'datetimepicker',
17-
},
18-
{
19-
name: 'directions',
20-
},
21-
{
22-
name: 'email',
23-
},
24-
{
25-
name: 'fingerprint-auth',
26-
},
27-
{
28-
name: 'geolocation',
29-
},
30-
{
31-
name: 'imagepicker',
32-
},
33-
{
34-
name: 'iqkeyboardmanager',
35-
},
36-
{
37-
name: 'local-notifications',
38-
},
39-
{
40-
name: 'shared-notification-delegate',
41-
},
42-
{
43-
name: 'zip',
44-
},
45-
];
46-
}
9+
{
10+
name: 'appavailability'
11+
},
12+
{
13+
name: 'camera'
14+
},
15+
{
16+
name: 'datetimepicker'
17+
},
18+
{
19+
name: 'directions'
20+
},
21+
{
22+
name: 'email'
23+
},
24+
{
25+
name: 'fingerprint-auth'
26+
},
27+
{
28+
name: 'geolocation'
29+
},
30+
{
31+
name: 'imagepicker'
32+
},
33+
{
34+
name: 'iqkeyboardmanager'
35+
},
36+
{
37+
name: 'local-notifications'
38+
},
39+
{
40+
name: 'shared-notification-delegate'
41+
},
42+
{
43+
name: 'zip'
44+
}
45+
];
46+
}

apps/demo-vue/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"nativescript-theme-core": "file:../../node_modules/nativescript-theme-core",
55
"nativescript-vue": "file:../../node_modules/nativescript-vue",
66
"@nativescript/core": "file:../../node_modules/@nativescript/core",
7-
"@nativescript/camera": "file:../../packages/camera",
7+
"@nativescript/email": "file:../../packages/email",
88
"@nativescript/appavailability": "file:../../packages/appavailability",
9+
"@nativescript/camera": "file:../../packages/camera",
910
"@nativescript/datetimepicker": "file:../../packages/datetimepicker",
1011
"@nativescript/directions": "file:../../packages/directions",
11-
"@nativescript/email": "file:../../packages/email",
1212
"@nativescript/fingerprint-auth": "file:../../packages/fingerprint-auth",
1313
"@nativescript/geolocation": "file:../../packages/geolocation",
1414
"@nativescript/imagepicker": "file:../../packages/imagepicker",

apps/demo/package.json

Lines changed: 26 additions & 26 deletions 10000
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
{
2-
"main": "app.js",
3-
"description": "NativeScript Application",
4-
"license": "SEE LICENSE IN <your-license-filename>",
5-
"repository": "<fill-your-repository-here>",
6-
"dependencies": {
7-
"nativescript-theme-core": "file:../../node_modules/nativescript-theme-core",
8-
"@nativescript/core": "file:../../node_modules/@nativescript/core",
9-
"@nativescript/camera": "file:../../packages/camera",
10-
"@nativescript/appavailability": "file:../../packages/appavailability",
11-
"@nativescript/datetimepicker": "file:../../packages/datetimepicker",
12-
"@nativescript/directions": "file:../../packages/directions",
13-
"@nativescript/email": "file:../../packages/email",
14-
"@nativescript/fingerprint-auth": "file:../../packages/fingerprint-auth",
15-
"@nativescript/geolocation": "file:../../packages/geolocation",
16-
"@nativescript/imagepicker": "file:../../packages/imagepicker",
17-
"@nativescript/iqkeyboardmanager": "file:../../packages/iqkeyboardmanager",
18-
"@nativescript/local-notifications": "file:../../packages/local-notifications",
19-
"@nativescript/shared-notification-delegate": "file:../../packages/shared-notification-delegate",
20-
"@nativescript/zip": "file:../../packages/zip"
21-
},
22-
"devDependencies": {
23-
"@nativescript/android": "~7.0.0",
24-
"@nativescript/ios": "7.0.0",
25-
"@nativescript/webpack": "3.0.0",
26-
"typescript": "file:../../node_modules/typescript"
27-
}
2+
"main": "app.js",
3+
"description": "NativeScript Application",
4+
"license": "SEE LICENSE IN <your-license-filename>",
5+
"repository": "<fill-your-repository-here>",
6+
"dependencies": {
7+
"nativescript-theme-core": "file:../../node_modules/nativescript-theme-core",
8+
"@nativescript/core": "file:../../node_modules/@nativescript/core",
9+
"@nativescript/email": "file:../../packages/email",
10+
"@nativescript/appavailability": "file:../../packages/appavailability",
11+
"@nativescript/camera": "file:../../packages/camera",
12+
"@nativescript/datetimepicker": "file:../../packages/datetimepicker",
13+
"@nativescript/directions": "file:../../packages/directions",
14+
"@nativescript/fingerprint-auth": "file:../../packages/fingerprint-auth",
15+
"@nativescript/geolocation": "file:../../packages/geolocation",
16+
"@nativescript/imagepicker": "file:../../packages/imagepicker",
17+
"@nativescript/iqkeyboardmanager": "file:../../packages/iqkeyboardmanager",
18+
"@nativescript/local-notifications": "file:../../packages/local-notifications",
19+
"@nativescript/shared-notification-delegate": "file:../../packages/shared-notification-delegate",
20+
"@nativescript/zip": "file:../../packages/zip"
21+
},
22+
"devDependencies": {
23+
"@nativescript/android": "~7.0.0",
24+
"@nativescript/ios": "7.0.0",
25+
"@nativescript/webpack": "3.0.0",
26+
"typescript": "file:../../node_modules/typescript"
27+
}
2828
}

tools/schematics/add-package/index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,15 @@ function updateWorkspaceConfig() {
7878
commands: [`nx run ${name}:build`, `node tools/scripts/build-finish.ts ${name}`],
7979
parallel: false,
8080
},
81-
},
81+
},
82+
focus: {
83+
builder: '@nrwl/workspace:run-commands',
84+
outputs: ['dist/packages'],
85+
options: {
86+
commands: [`nx workspace-schematic focus-packages ${name}`],
87+
parallel: false
88+
}
89+
}
8290
},
8391
};
8492
// add to build all
@@ -113,7 +121,7 @@ function updateWorkspaceScripts() {
113121
const focusStart = workspaceScripts.substring(0, focusSectionIndex);
114122
const focusEnd = workspaceScripts.substring(focusSectionIndex, workspaceScripts.length);
115123
const newFocus = `'${name}': {
116-
script: 'node tools/scripts/focus.ts ${name}',
124+
script: 'nx run ${name}:focus',
117125
description: 'Focus on ${scopeName}/${name}',
118126
},
119127
`;

tools/schematics/focus-packages/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,11 @@ export default function (schema: Schema): Rule {
7878
},
7979
(tree: Tree, context: SchematicContext) => {
8080
const isFocusing = focusPackages && focusPackages.length > 0;
81-
const focusTargets = (focusPackages && focusPackages.length ? focusPackages : allPackages).map((n) => `${scopeName}/${n}`).join(', ');
82-
console.log(`${isFocusing ? 'Focusing workspace on:' : 'Resetting workspace for:'}`, focusTargets, `${schema.ignoreDemos || !isFocusing ? '' : '...and isolating code across all demo apps.'}`);
81+
const focusTargets = (focusPackages && focusPackages.length ? focusPackages : allPackages).map((n) => `\n${scopeName}/${n}`).join('');
82+
context.logger.info(`${isFocusing ? 'Focusing workspace on:' : 'Resetting workspace for:'}\n${focusTargets}\n\n`);
83+
if (!schema.ignoreDemos) {
84+
context.logger.info(` > NOTE: Clean the demo app you plan to test with before running now that the demo code has been updated.\n`);
85+
}
8386
},
8487
]);
8588
}

tools/scripts/focus.ts

Lines changed: 0 additions & 38 deletions
This file was deleted.

tools/workspace-scripts.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ module.exports = {
176176
description: 'Focus on @nativescript/appavailability',
177177
},
178178
camera: {
179-
script: 'nx workspace-schematic focus-packages camera',
179+
script: 'nx run camera:focus',
180180
description: 'Focus on @nativescript/camera',
181181
},
182182
datetimepicker: {
@@ -188,7 +188,7 @@ module.exports = {
188188
description: 'Focus on @nativescript/directions',
189189
},
190190
email: {
191-
script: 'nx workspace-schematic focus-packages email',
191+
script: 'nx run email:focus',
192192
description: 'Focus on @nativescript/email',
193193
},
194194
'fingerprint-auth': {
@@ -220,7 +220,7 @@ module.exports = {
220220
description: 'Focus on @nativescript/zip',
221221
},
222222
reset: {
223-
script: 'nx workspace-schematic focus-packages',
223+
script: 'nx run all:focus',
224224
description: 'Reset Focus',
225225
},
226226
},

0 commit comments

Comments
 (0)
0