From 44e6f3b156b89983944875c3841613c1ed354644 Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Thu, 11 Apr 2019 11:48:39 +0300 Subject: [PATCH 1/2] feat: use HMR by default for newly created projects (aligned with the NativeScript 5.4 templates) --- src/add-ns/_ns-files/nsconfig.json | 3 ++- src/models/nsconfig.d.ts | 3 ++- src/ng-new/shared/_files/nsconfig.json | 3 ++- src/utils.ts | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/add-ns/_ns-files/nsconfig.json b/src/add-ns/_ns-files/nsconfig.json index 91cbbd1..3400239 100644 --- a/src/add-ns/_ns-files/nsconfig.json +++ b/src/add-ns/_ns-files/nsconfig.json @@ -3,5 +3,6 @@ "appPath": "<%= sourceDir %>", "nsext": "<%= nsext %>", "webext": "<%= webext %>", - "shared": true + "shared": true, + "useLegacyWorkflow": false } \ No newline at end of file diff --git a/src/models/nsconfig.d.ts b/src/models/nsconfig.d.ts index d654ce4..6f5ef2c 100644 --- a/src/models/nsconfig.d.ts +++ b/src/models/nsconfig.d.ts @@ -3,5 +3,6 @@ export interface NsConfig { appPath: string, nsext: string, webext: string, - shared: boolean + shared: boolean, + useLegacyWorkflow: boolean } \ No newline at end of file diff --git a/src/ng-new/shared/_files/nsconfig.json b/src/ng-new/shared/_files/nsconfig.json index 4e19a8d..ae96200 100644 --- a/src/ng-new/shared/_files/nsconfig.json +++ b/src/ng-new/shared/_files/nsconfig.json @@ -3,5 +3,6 @@ "appPath": "<%= sourcedir %>", "nsext": ".tns", "webext": "", - "shared": true + "shared": true, + "useLegacyWorkflow": false } \ No newline at end of file diff --git a/src/utils.ts b/src/utils.ts index f4fc679..cb120ab 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -180,7 +180,8 @@ export function createEmptySharedProject(projectName: string, webExtension: stri 'appPath': 'src', 'nsext': '.tns', 'webext': '', - 'shared': true + 'shared': true, + 'useLegacyWorkflow': false })); return appTree; From 982d3579d8b3aa6cddbbcc81efdfc12ef5502623 Mon Sep 17 00:00:00 2001 From: vakrilov Date: Mon, 13 May 2019 10:33:37 +0300 Subject: [PATCH 2/2] feat(ng-new): add nsconfig.json for non-shared projects --- src/ng-new/application/_files/nsconfig.json | 4 ++++ src/ng-new/application/index_spec.ts | 1 + src/ng-new/shared/index_spec.ts | 1 + 3 files changed, 6 insertions(+) create mode 100644 src/ng-new/application/_files/nsconfig.json diff --git a/src/ng-new/application/_files/nsconfig.json b/src/ng-new/application/_files/nsconfig.json new file mode 100644 index 0000000..80174f3 --- /dev/null +++ b/src/ng-new/application/_files/nsconfig.json @@ -0,0 +1,4 @@ +{ + "appPath": "<%= sourcedir %>", + "useLegacyWorkflow": false +} \ No newline at end of file diff --git a/src/ng-new/application/index_spec.ts b/src/ng-new/application/index_spec.ts index 0c7accc..fffc9e1 100644 --- a/src/ng-new/application/index_spec.ts +++ b/src/ng-new/application/index_spec.ts @@ -25,6 +25,7 @@ describe('Application Schematic', () => { const tree = schematicRunner.runSchematic('application', options); const files = tree.files; expect(files.indexOf('/foo/angular.json')).toBeGreaterThanOrEqual(0); + expect(files.indexOf('/foo/nsconfig.json')).toBeGreaterThanOrEqual(0); expect(files.indexOf('/foo/.gitignore')).toBeGreaterThanOrEqual(0); expect(files.indexOf('/foo/package.json')).toBeGreaterThanOrEqual(0); expect(files.indexOf('/foo/tsconfig.json')).toBeGreaterThanOrEqual(0); diff --git a/src/ng-new/shared/index_spec.ts b/src/ng-new/shared/index_spec.ts index 1c972e8..b4d1494 100644 --- a/src/ng-new/shared/index_spec.ts +++ b/src/ng-new/shared/index_spec.ts @@ -23,6 +23,7 @@ describe('Shared Application Schematic', () => { const tree = schematicRunner.runSchematic('shared', options); const files = tree.files; expect(files.indexOf('/foo/angular.json')).toBeGreaterThanOrEqual(0); + expect(files.indexOf('/foo/nsconfig.json')).toBeGreaterThanOrEqual(0); expect(files.indexOf('/foo/.gitignore')).toBeGreaterThanOrEqual(0); expect(files.indexOf('/foo/package.json')).toBeGreaterThanOrEqual(0); expect(files.indexOf('/foo/tsconfig.tns.json')).toBeGreaterThanOrEqual(0);