diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 18043a17..731d8601 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -76,7 +76,7 @@ NOTE: There are three test apps in the repository, located in the `/demo` direct 4. Build the app for Android or iOS. ``` bash - tns run android/ios --bundle + tns run android/ios ``` 5. Install [appium](http://appium.io/) globally. diff --git a/README.md b/README.md index b3b02450..0f0183fd 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,9 @@ For more details, see the [NativeScript docs for building with webpack](http://d ```sh $ npm install --save-dev nativescript-dev-webpack -$ tns run android --bundle +$ tns run android or -$ tns run ios --bundle +$ tns run ios ``` ## Contribute diff --git a/bin/ns-bundle b/bin/ns-bundle index d52d7536..ffbd1a9a 100755 --- a/bin/ns-bundle +++ b/bin/ns-bundle @@ -1,4 +1,4 @@ #!/usr/bin/env node -console.error("Using npm run scripts is no longer supported. Use CLI commands and pass the --bundle flag instead.\nExample:\ntns build android --bundle") +console.error("Using npm run scripts is no longer supported. Use CLI commands instead.\nExample:\ntns build android") process.exit(1); \ No newline at end of file diff --git a/demo/AngularApp/package.json b/demo/AngularApp/package.json index e2241aaa..81f77544 100644 --- a/demo/AngularApp/package.json +++ b/demo/AngularApp/package.json @@ -13,24 +13,24 @@ } }, "dependencies": { - "@angular/common": "8.0.0", - "@angular/compiler": "8.0.0", - "@angular/core": "8.0.0", - "@angular/forms": "8.0.0", + "@angular/common": "8.2.0", + "@angular/compiler": "8.2.0", + "@angular/core": "8.2.0", + "@angular/forms": "8.2.0", "@angular/http": "8.0.0-beta.10", - "@angular/platform-browser": "8.0.0", - "@angular/platform-browser-dynamic": "8.0.0", - "@angular/router": "8.0.0", + "@angular/platform-browser": "8.2.0", + "@angular/platform-browser-dynamic": "8.2.0", + "@angular/router": "8.2.0", "nativescript-angular": "next", "nativescript-theme-core": "~1.0.2", "reflect-metadata": "~0.1.8", "rxjs": "^6.3.3", "tns-core-modules": "next", - "zone.js": "^0.8.4" + "zone.js": "^0.9.1" }, "devDependencies": { - "@angular/compiler-cli": "8.0.0", - "@ngtools/webpack": "8.0.0", + "@angular/compiler-cli": "8.2.0", + "@ngtools/webpack": "8.2.0", "@types/chai": "~4.1.7", "@types/mocha": "~5.2.5", "@types/node": "~10.12.18", @@ -44,7 +44,7 @@ "nativescript-dev-appium": "next", "nativescript-dev-webpack": "next", "node-sass": "^4.12.0", - "typescript": "~3.4.5" + "typescript": "~3.5.3" }, "scripts": { "setup": "npm pack ../../ && npm i -D nativescript-dev-webpack*.tgz", diff --git a/demo/AngularApp/webpack.config.js b/demo/AngularApp/webpack.config.js index 8137073f..04179234 100644 --- a/demo/AngularApp/webpack.config.js +++ b/demo/AngularApp/webpack.config.js @@ -36,8 +36,7 @@ module.exports = env => { const { // The 'appPath' and 'appResourcesPath' values are fetched from - // the nsconfig.json configuration file - // when bundling with `tns run android|ios --bundle`. + // the nsconfig.json configuration file. appPath = "src", appResourcesPath = "App_Resources", @@ -318,4 +317,4 @@ module.exports = env => { } return config; -}; +}; \ No newline at end of file diff --git a/demo/JavaScriptApp/webpack.config.js b/demo/JavaScriptApp/webpack.config.js index ec4ea0b5..c4684e61 100644 --- a/demo/JavaScriptApp/webpack.config.js +++ b/demo/JavaScriptApp/webpack.config.js @@ -31,8 +31,7 @@ module.exports = env => { const { // The 'appPath' and 'appResourcesPath' values are fetched from - // the nsconfig.json configuration file - // when bundling with `tns run android|ios --bundle`. + // the nsconfig.json configuration file. appPath = "app", appResourcesPath = "app/App_Resources", @@ -257,4 +256,4 @@ module.exports = env => { return config; -}; +}; \ No newline at end of file diff --git a/demo/TypeScriptApp/webpack.config.js b/demo/TypeScriptApp/webpack.config.js index 64ad184c..2418be9d 100644 --- a/demo/TypeScriptApp/webpack.config.js +++ b/demo/TypeScriptApp/webpack.config.js @@ -32,8 +32,7 @@ module.exports = env => { const { // The 'appPath' and 'appResourcesPath' values are fetched from - // the nsconfig.json configuration file - // when bundling with `tns run android|ios --bundle`. + // the nsconfig.json configuration file. appPath = "app", appResourcesPath = "app/App_Resources", @@ -288,4 +287,4 @@ module.exports = env => { return config; -}; +}; \ No newline at end of file diff --git a/dependencyManager.js b/dependencyManager.js index 7ed804de..8f348013 100644 --- a/dependencyManager.js +++ b/dependencyManager.js @@ -73,11 +73,11 @@ function getRequiredDeps(packageJson) { } const deps = { - "@angular/compiler-cli": "8.0.0", + "@angular/compiler-cli": "8.2.0", }; if (!dependsOn(packageJson, "@angular-devkit/build-angular")) { - deps["@ngtools/webpack"] = "8.0.0"; + deps["@ngtools/webpack"] = "8.2.0"; } return deps; diff --git a/hmr/hmr-update.ts b/hmr/hmr-update.ts index 6ad9b3d1..e4778c33 100644 --- a/hmr/hmr-update.ts +++ b/hmr/hmr-update.ts @@ -1,10 +1,13 @@ import * as hot from "../hot"; -import { knownFolders } from "tns-core-modules/file-system"; +import { knownFolders, path, File } from "tns-core-modules/file-system"; declare const __webpack_require__: any; export function hmrUpdate() { - const applicationFiles = knownFolders.currentApp(); + const currentAppFolder = knownFolders.currentApp(); const latestHash = __webpack_require__["h"](); - return hot(latestHash, filename => applicationFiles.getFile(filename)); + return hot(latestHash, filename => { + const fullFilePath = path.join(currentAppFolder.path, filename); + return File.exists(fullFilePath) ? currentAppFolder.getFile(filename) : null; + }); } \ No newline at end of file diff --git a/hot.js b/hot.js index 84de3b1e..4d9f5c77 100644 --- a/hot.js +++ b/hot.js @@ -147,6 +147,10 @@ function update(latestHash, options) { function getNextHash(hash, getFileContent) { const file = getFileContent(`${hash}.hot-update.json`); + if (!file) { + return Promise.resolve(hash); + } + return file.readText().then(hotUpdateContent => { if (hotUpdateContent) { const manifest = JSON.parse(hotUpdateContent); diff --git a/package.json b/package.json index 06b4cdb3..7421d2e5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nativescript-dev-webpack", - "version": "1.0.3", + "version": "1.1.0", "main": "index", "description": "", "homepage": "http://www.telerik.com", @@ -46,7 +46,7 @@ "generate-android-snapshot": "./bin/generate-android-snapshot" }, "dependencies": { - "@angular-devkit/core": "8.0.0", + "@angular-devkit/core": "8.2.0", "clean-webpack-plugin": "~1.0.0", "copy-webpack-plugin": "~4.6.0", "css-loader": "~2.1.1", @@ -75,9 +75,9 @@ "webpack-sources": "~1.3.0" }, "devDependencies": { - "@angular/compiler": "8.0.0", - "@angular/compiler-cli": "8.0.0", - "@ngtools/webpack": "8.0.0", + "@angular/compiler": "8.2.0", + "@angular/compiler-cli": "8.2.0", + "@ngtools/webpack": "8.2.0", "@types/jasmine": "^3.3.7", "@types/loader-utils": "^1.1.3", "@types/node": "^10.12.12", @@ -89,6 +89,6 @@ "jasmine-spec-reporter": "^4.2.1", "proxyquire": "2.1.0", "tns-core-modules": "next", - "typescript": "~3.4.0" + "typescript": "~3.5.3" } } \ No newline at end of file diff --git a/templates/webpack.angular.js b/templates/webpack.angular.js index fa623eee..e6110ff0 100644 --- a/templates/webpack.angular.js +++ b/templates/webpack.angular.js @@ -35,8 +35,7 @@ module.exports = env => { const { // The 'appPath' and 'appResourcesPath' values are fetched from - // the nsconfig.json configuration file - // when bundling with `tns run android|ios --bundle`. + // the nsconfig.json configuration file. appPath = "src", appResourcesPath = "App_Resources", diff --git a/templates/webpack.javascript.js b/templates/webpack.javascript.js index f9add996..7460dd2a 100644 --- a/templates/webpack.javascript.js +++ b/templates/webpack.javascript.js @@ -30,8 +30,7 @@ module.exports = env => { const { // The 'appPath' and 'appResourcesPath' values are fetched from - // the nsconfig.json configuration file - // when bundling with `tns run android|ios --bundle`. + // the nsconfig.json configuration file. appPath = "app", appResourcesPath = "app/App_Resources", diff --git a/templates/webpack.typescript.js b/templates/webpack.typescript.js index 9e0a3e84..44a60a10 100644 --- a/templates/webpack.typescript.js +++ b/templates/webpack.typescript.js @@ -31,8 +31,7 @@ module.exports = env => { const { // The 'appPath' and 'appResourcesPath' values are fetched from - // the nsconfig.json configuration file - // when bundling with `tns run android|ios --bundle`. + // the nsconfig.json configuration file. appPath = "app", appResourcesPath = "app/App_Resources", diff --git a/templates/webpack.vue.js b/templates/webpack.vue.js index 61068c7f..28bbfe9f 100644 --- a/templates/webpack.vue.js +++ b/templates/webpack.vue.js @@ -34,8 +34,7 @@ module.exports = env => { const { // The 'appPath' and 'appResourcesPath' values are fetched from - // the nsconfig.json configuration file - // when bundling with `tns run android|ios --bundle`. + // the nsconfig.json configuration file. appPath = "app", appResourcesPath = "app/App_Resources",