Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NativeScript/nativescript-dev-webpack
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.10.1
Choose a base ref
...
head repository: NativeScript/nativescript-dev-webpack
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.10.2
Choose a head ref
  • 5 commits
  • 8 files changed
  • 4 contributors

Commits on Apr 11, 2018

  1. Copy the full SHA
    0b0fe4e View commit details

Commits on Apr 18, 2018

  1. Copy the full SHA
    d2bcb52 View commit details
  2. chore: Do not set INIT_CWD on any hook (#493)

    Previously the INIT_CWD environment variable was set only in one of the hooks. In a recent PR, we've changed the logic of all `before-*` hooks to set the INIT_CWD environment variable.
    After some discussions and investigation, we've found that we do not need the INIT_CWD variable. So remove the setting of the variable from all hooks and delete the method that sets it.
    rosen-vladimirov authored and dtopuzov committed Apr 18, 2018
    Copy the full SHA
    afe6208 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ed4ad04 View commit details
  4. Copy the full SHA
    075c445 View commit details
Showing with 23 additions and 25 deletions.
  1. +17 −0 CHANGELOG.md
  2. +1 −4 lib/before-cleanApp.js
  3. +1 −5 lib/before-prepareJS.js
  4. +0 −2 lib/before-shouldPrepare.js
  5. +1 −4 lib/before-watch.js
  6. +0 −2 lib/before-watchPatterns.js
  7. +1 −6 lib/utils.js
  8. +2 −2 package.json
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
<a name="0.10.2"></a>
## [0.10.2](https://github.com/NativeScript/nativescript-dev-webpack/compare/0.10.1...0.10.2) (2018-04-18)


### Bug Fixes

* **hooks:** do not set INIT_CWD on any hook ([#494](https://github.com/NativeScript/nativescript-dev-webpack/issues/494)) ([afe6208](https://github.com/NativeScript/nativescript-dev-webpack/commit/afe6208))


<a name="0.10.1"></a>
## [0.10.1](https://github.com/NativeScript/nativescript-dev-webpack/compare/0.10.0...0.10.1) (2018-04-11)


### Bug Fixes

* **configs/angular:** use path relative to the appDir for the root ([8e7aa0c](https://github.com/NativeScript/nativescript-dev-webpack/commit/8e7aa0c))

<a name="0.10.0"></a>
# [0.10.0](https://github.com/NativeScript/nativescript-dev-webpack/compare/0.9.1...0.10.0) (2018-04-05)

5 changes: 1 addition & 4 deletions lib/before-cleanApp.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
const { cleanSnapshotArtefacts } = require("../snapshot/android/project-snapshot-generator");
const { isAndroid } = require("../projectHelpers");
const { setProcessInitDirectory } = require("./utils");

module.exports = function (hookArgs) {
if (isAndroid(hookArgs.platformInfo.platform)) {
const projectDir = hookArgs.platformInfo.projectData.projectDir;
setProcessInitDirectory(projectDir);
cleanSnapshotArtefacts(projectDir);
cleanSnapshotArtefacts(hookArgs.platformInfo.projectData.projectDir);
}
}
6 changes: 1 addition & 5 deletions lib/before-prepareJS.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { runWebpackCompiler } = require("./compiler");
const { setProcessInitDirectory } = require("./utils");

module.exports = function ($logger, hookArgs) {
const env = hookArgs.config.env || {};
@@ -12,9 +11,6 @@ module.exports = function ($logger, hookArgs) {
release: appFilesUpdaterOptions.release,
};

const projectData = hookArgs.config.projectData;
setProcessInitDirectory(projectData.projectDir);

const result = config.bundle && runWebpackCompiler.bind(runWebpackCompiler, config, projectData, $logger, hookArgs);
const result = config.bundle && runWebpackCompiler.bind(runWebpackCompiler, config, hookArgs.config.projectData, $logger, hookArgs);
return result;
}
2 changes: 0 additions & 2 deletions lib/before-shouldPrepare.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
const { join } = require("path");
const { readFileSync, existsSync, writeFileSync } = require("fs");
const { setProcessInitDirectory } = require("./utils");
const envOptionsCacheFileLocation = join(__dirname, "env.cache.json");

module.exports = function (hookArgs) {
const platformInfo = hookArgs.shouldPrepareInfo && hookArgs.shouldPrepareInfo.platformInfo;
if (platformInfo && platformInfo.appFilesUpdaterOptions && platformInfo.appFilesUpdaterOptions.bundle) {
setProcessInitDirectory(platformInfo.projectData.projectDir);

return (args, originalMethod) => {
return originalMethod(...args).then(originalShouldPrepare => {
5 changes: 1 addition & 4 deletions lib/before-watch.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { runWebpackCompiler } = require("./compiler");
const { setProcessInitDirectory } = require("./utils");

module.exports = function ($logger, hookArgs) {
if (hookArgs.config) {
@@ -16,9 +15,7 @@ module.exports = function ($logger, hookArgs) {
watch: true
};

const projectData = hookArgs.projectData;
setProcessInitDirectory(projectData.projectDir);
return runWebpackCompiler(config, projectData, $logger, hookArgs);
return runWebpackCompiler(config, hookArgs.projectData, $logger, hookArgs);
}));
}
}
2 changes: 0 additions & 2 deletions lib/before-watchPatterns.js
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@ const { basename } = require("path");
const {
buildEnvData,
getCompilationContext,
setProcessInitDirectory,
} = require("./utils");

module.exports = function (hookArgs) {
@@ -11,7 +10,6 @@ module.exports = function (hookArgs) {
return;
}

setProcessInitDirectory(hookArgs.projectData.projectDir);
const { platforms } = hookArgs;
const { env } = liveSyncData;
return (args, originalMethod) => {
7 changes: 1 addition & 6 deletions lib/utils.js
Original file line number Diff line number Diff line change
@@ -41,13 +41,8 @@ function shouldSnapshot(config) {
return config.bundle && config.release && platformSupportsSnapshot && osSupportsSnapshot;
}

function setProcessInitDirectory(dir) {
process.env.INIT_CWD = dir;
}

module.exports = {
buildEnvData,
getCompilationContext,
shouldSnapshot,
setProcessInitDirectory,
shouldSnapshot
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-dev-webpack",
"version": "0.10.0",
"version": "0.10.2",
"main": "index",
"description": "",
"homepage": "http://www.telerik.com",
@@ -68,7 +68,7 @@
"dependencies": {
"global-modules-path": "2.0.0",
"minimatch": "3.0.4",
"nativescript-hook": "0.2.3",
"nativescript-hook": "0.2.4",
"proxy-lib": "0.4.0",
"request": "2.83.0",
"schema-utils": "0.4.3",