Skip to content

Commit 89c5f6c

Browse files
committed
WIP
1 parent cec7c99 commit 89c5f6c

20 files changed

+348
-278
lines changed

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"program": "${workspaceRoot}/lib/nativescript-cli.js",
1616

1717
// example commands
18-
"args": [ "create", "cliapp", "--path", "${workspaceRoot}/scratch"]
18+
"args": [ "run", "ios", "--path", "${workspaceRoot}/scratch/webpackApp", "--bundle"]
1919
// "args": [ "test", "android", "--justlaunch"]
2020
// "args": [ "platform", "add", "android@1.3.0", "--path", "cliapp"]
2121
// "args": [ "platform", "remove", "android", "--path", "cliapp"]

lib/bootstrap.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,5 @@ $injector.require("testInitializationService", "./services/test-initialization-s
201201

202202
$injector.require("networkConnectivityValidator", "./helpers/network-connectivity-validator");
203203
$injector.requirePublic("cleanupService", "./services/cleanup-service");
204+
205+
$injector.require("webpackCompilerService", "./services/webpack/webpack-compiler-service");

lib/commands/appstore-upload.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ export class PublishIOS implements ICommand {
6565
appFilesUpdaterOptions,
6666
projectData: this.$projectData,
6767
config: this.$options,
68-
env: this.$options.env
68+
env: this.$options.env,
69+
webpackCompilerConfig: {
70+
watch: false,
71+
env: this.$options.env
72+
}
6973
};
7074
const buildConfig: IBuildConfig = {
7175
projectDir: this.$options.path,

lib/commands/build.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ export abstract class BuildCommandBase extends ValidatePlatformCommandBase {
2626
appFilesUpdaterOptions,
2727
projectData: this.$projectData,
2828
config: this.$options,
29-
env: this.$options.env
29+
env: this.$options.env,
30+
webpackCompilerConfig: {
31+
watch: false,
32+
env: this.$options.env
33+
}
3034
};
3135

3236
await this.$platformService.preparePlatform(platformInfo);

lib/commands/clean-app.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ export class CleanAppCommandBase extends ValidatePlatformCommandBase implements
2626
platform: this.platform.toLowerCase(),
2727
config: this.$options,
2828
projectData: this.$projectData,
29-
env: this.$options.env
29+
env: this.$options.env,
30+
webpackCompilerConfig: {
31+
watch: false,
32+
env: this.$options.env
33+
}
3034
};
3135

3236
return this.$platformService.cleanDestinationApp(platformInfo);

lib/commands/prepare.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ export class PrepareCommand extends ValidatePlatformCommandBase implements IComm
2323
appFilesUpdaterOptions,
2424
projectData: this.$projectData,
2525
config: this.$options,
26-
env: this.$options.env
26+
env: this.$options.env,
27+
webpackCompilerConfig: {
28+
watch: false,
29+
env: this.$options.env
30+
}
2731
};
2832

2933
await this.$platformService.preparePlatform(platformInfo);

lib/common/declarations.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,7 @@ interface IPromiseActions<T> {
15071507
interface IDeferPromise<T> extends IPromiseActions<T> {
15081508
isRejected(): boolean;
15091509
isPending(): boolean;
1510+
getResult(): any;
15101511
promise: Promise<T>;
15111512
}
15121513

lib/common/helpers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,12 @@ export function deferPromise<T>(): IDeferPromise<T> {
130130
let isResolved = false;
131131
let isRejected = false;
132132
let promise: Promise<T>;
133+
let result: T | PromiseLike<T>;
133134

134135
promise = new Promise<T>((innerResolve, innerReject) => {
135136
resolve = (value?: T | PromiseLike<T>) => {
136137
isResolved = true;
138+
result = value;
137139

138140
return innerResolve(value);
139141
};
@@ -151,7 +153,8 @@ export function deferPromise<T>(): IDeferPromise<T> {
151153
reject,
152154
isResolved: () => isResolved,
153155
isRejected: () => isRejected,
154-
isPending: () => !isResolved && !isRejected
156+
isPending: () => !isResolved && !isRejected,
157+
getResult: () => result
155158
};
156159
}
157160

lib/definitions/platform.d.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,6 @@ interface IPlatformDataComposition {
307307

308308
interface ICopyAppFilesData extends IProjectDataComposition, IAppFilesUpdaterOptionsComposition, IPlatformDataComposition, IOptionalFilesToSync, IOptionalFilesToRemove { }
309309

310-
interface IPreparePlatformService {
311-
addPlatform(info: IAddPlatformInfo): Promise<void>;
312-
preparePlatform(config: IPreparePlatformJSInfo): Promise<void>;
313-
}
314-
315310
interface IAddPlatformInfo extends IProjectDataComposition, IPlatformDataComposition {
316311
frameworkDir: string;
317312
installedVersion: string;
@@ -334,7 +329,9 @@ interface IPreparePlatformCoreInfo extends IPreparePlatformInfoBase, IOptionalPr
334329
platformSpecificData: IPlatformSpecificData;
335330
}
336331

337-
interface IPreparePlatformInfo extends IPreparePlatformInfoBase, IPlatformConfig, ISkipNativeCheckOptional { }
332+
interface IPreparePlatformInfo extends IPreparePlatformInfoBase, IPlatformConfig, ISkipNativeCheckOptional {
333+
webpackCompilerConfig: IWebpackCompilerConfig;
334+
}
338335

339336
interface IPlatformConfig {
340337
config: IPlatformOptions;

lib/definitions/project-changes.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ interface IPrepareInfo extends IAddedNativePlatform, IAppFilesHashes {
1313
}
1414

1515
interface IProjectChangesInfo extends IAddedNativePlatform {
16-
appFilesChanged: boolean;
1716
appResourcesChanged: boolean;
1817
modulesChanged: boolean;
1918
configChanged: boolean;
2019
packageChanged: boolean;
2120
nativeChanged: boolean;
22-
bundleChanged: boolean;
2321
signingChanged: boolean;
2422

2523
readonly hasChanges: boolean;

0 commit comments

Comments
 (0)