Skip to content

Commit 0a66bac

Browse files
committed
feat: move all the source code to app folder
Till now `nativescript-dev-webpack` plugin requires automatically all (root|page)(.css|.xml|.js|.ts) files from the unit-test-runner. However, this behavior was changed and now `nativescript-dev-webpack` plugin requires automatically all files except the files from App_Resources and .d.ts files. This led to the problem that `preuninstall.js` and `postinstall.js` scripts are automatically required. These scripts require `nativescript-hook`. On the other side `nativescript-hook` has a dynamic require here https://github.com/NativeScript/nativescript-hook/blob/master/index.js#L56. As this dynamic require is not compatible with webpack's concept for dynamic requires, the following warning is shown: ``` WARNING in ../node_modules/nativescript-hook/index.js 56:27-51 Critical dependency: the request of a dependency is an expression @ ../node_modules/nativescript-unit-test-runner/postinstall.js @ ../node_modules/nativescript-unit-test-runner sync (?<!App_Resources.*).(xml|css|js|(?<!d.)ts|scss)$ @ ./app.js ``` This PR moves all the app's related code to the app folder. This way `nativescript-dev-webpack` will require automatically all files from app folder and the unneeded files (as postinstall and preuninstall) will not be required.
1 parent 6d5a1d7 commit 0a66bac

21 files changed

+3
-3
lines changed
File renamed without changes.
File renamed without changes.

app.ts renamed to app/app.ts

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

main-view-model.ts renamed to app/main-view-model.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// <reference path="./declarations.d.ts"/>
1+
/// <reference path="../declarations.d.ts"/>
22
import { Observable } from "tns-core-modules/data/observable";
33
import { ObservableArray } from "tns-core-modules/data/observable-array";
44
import * as http from "tns-core-modules/http";
@@ -21,7 +21,7 @@ function enableSocketIoDebugging() {
2121
global.window = global;
2222
}
2323

24-
var config: INetworkConfiguration = require('./config');
24+
var config: INetworkConfiguration = require('../config');
2525
config.options = config.options || {};
2626
if (!config.options.appDirectoryRelativePath) {
2727
config.options.appDirectoryRelativePath = "app";
@@ -207,7 +207,7 @@ export class TestBrokerViewModel extends Observable {
207207
};
208208

209209
this.updateView({ serverInfo: `connecting to ${this.baseUrl}`});
210-
let io = require('./socket.io');
210+
let io = require('../socket.io');
211211
const socket = this.socket = io.connect(this.baseUrl, { forceBase64: true });
212212

213213
socket.on('connect', err => {

0 commit comments

Comments
 (0)