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

Commit 00454da

Browse files
committed
Merge branch 'master' into trifonov/android-settings-file
2 parents 2566cf7 + 625cbdd commit 00454da

34 files changed

+774
-632
lines changed

CHANGELOG.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,65 @@
1+
<a name="0.11.0"></a>
2+
# [0.11.0](https://github.com/NativeScript/nativescript-dev-webpack/compare/0.10.2...0.11.0) (2018-04-25)
3+
4+
5+
### Bug Fixes
6+
7+
* allow using the plugin via symlink ([#501](https://github.com/NativeScript/nativescript-dev-webpack/issues/501)) ([a7acb4d](https://github.com/NativeScript/nativescript-dev-webpack/commit/a7acb4d))
8+
* bundling of Angular apps using linked TS plugins ([#505](https://github.com/NativeScript/nativescript-dev-webpack/issues/505)) ([41779ad](https://github.com/NativeScript/nativescript-dev-webpack/commit/41779ad))
9+
10+
11+
### Features
12+
13+
* configure v8Version for snapshot tools ([#503](https://github.com/NativeScript/nativescript-dev-webpack/issues/503)) ([cf0d76b](https://github.com/NativeScript/nativescript-dev-webpack/commit/cf0d76b))
14+
15+
### BREAKING CHANGES
16+
17+
> The command below will overwrite the existing project's webpack configuration files with the most recent ones, so you don't have to manually apply the required changes:
18+
> ```
19+
> ./node_modules/.bin/update-ns-webpack --configs
20+
> ```
21+
22+
* The NativeScriptAngularCompilerPlugin is loaded in a different way now. The existing projects using the plugin should add the following line to their `webpack.config.js` file:
23+
``` js
24+
// webpack.config.js
25+
26+
module.exports = env => {
27+
const platform = env && (env.android && "android" || env.ios && "ios");
28+
if (!platform) {
29+
throw new Error("You need to provide a target platform!");
30+
}
31+
32+
const platforms = ["ios", "android"];
33+
const projectRoot = __dirname;
34+
nsWebpack.loadAdditionalPlugins({ projectDir: projectRoot }); // <----- Add this line
35+
36+
// ...
37+
```
38+
39+
* The `getAppPath` method expects two arguments now - `platform` and `projectRoot`. The usage inside the project's `webpack.config.js` should be changed in the following way:
40+
41+
Before:
42+
``` js
43+
// webpack.config.js
44+
45+
// Default destination inside platforms/<platform>/...
46+
const dist = resolve(projectRoot, nsWebpack.getAppPath(platform));
47+
48+
// ...
49+
```
50+
51+
After:
52+
``` js
53+
// webpack.config.js
54+
55+
// Default destination inside platforms/<platform>/...
56+
const dist = resolve(projectRoot, nsWebpack.getAppPath(platform, projectRoot));
57+
58+
// ...
59+
```
60+
61+
62+
163
<a name="0.10.2"></a>
264
## [0.10.2](https://github.com/NativeScript/nativescript-dev-webpack/compare/0.10.1...0.10.2) (2018-04-18)
365

CONTRIBUTING.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,33 +153,28 @@ Thank you for your contribution!
153153
npm install
154154
```
155155
156-
2. Remove the `package-lock.json` file if it was generated.
157-
```bash
158-
rm package-lock.json
159-
```
160-
161-
3. Add the following to your `.npmrc`.
156+
2. Add the following to your `.npmrc`.
162157
```
163158
tag-version-prefix=""
164159
message="release: cut the %s release"
165160
```
166161
167-
4. Create new branch for the release:
162+
3. Create new branch for the release:
168163
```
169164
git checkout -b username/release-version
170165
```
171166
172-
5. Run `npm version` to bump the version in the `package.json`, tag the release and update the CHANGELOG.md:
167+
4. Run `npm version` to bump the version in the `package.json`, tag the release and update the CHANGELOG.md:
173168
```
174169
npm version [patch|minor|major]
175170
```
176171
177-
6. Push all changes to your branch and create a PR.
172+
5. Push all changes to your branch and create a PR.
178173
```bash
179174
git push --set-upstream origin username/release-version --tags
180175
```
181176
182-
7. Publish the package to npm after the PR is merged.
177+
6. Publish the package to npm after the PR is merged.
183178
```bash
184179
npm publish
185180
```

android-app-components-loader.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = function(source) {
2+
this.cacheable();
3+
const { modules } = this.query;
4+
const imports = modules.map(m => `require("${m}");`).join("\n");
5+
const augmentedSource = `
6+
if (!global["__snapshot"]) {
7+
${imports}
8+
}
9+
10+
${source}
11+
`;
12+
13+
this.callback(null, augmentedSource);
14+
};

demo/.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ test-results.xml
1414
tsconfig.aot.json
1515

1616
vendor.js
17-
vendor-platform.android.js
18-
vendor-platform.ios.js
19-
2017
vendor.ts
21-
vendor-platform.android.ts
22-
vendor-platform.ios.ts
2318

2419
webpack.config.js

demo/AngularApp/package.json

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,25 @@
1313
}
1414
},
1515
"dependencies": {
16-
"@angular/common": "~5.2.0",
17-
"@angular/compiler": "~5.2.0",
18-
"@angular/core": "~5.2.0",
19-
"@angular/forms": "~5.2.0",
20-
"@angular/http": "~5.2.0",
21-
"@angular/platform-browser": "~5.2.0",
22-
"@angular/platform-browser-dynamic": "~5.2.0",
23-
"@angular/router": "~5.2.0",
24-
"nativescript-angular": "next",
16+
"@angular/common": "~6.0.0-rc.0",
17+
"@angular/compiler": "~6.0.0-rc.0",
18+
"@angular/core": "~6.0.0-rc.0",
19+
"@angular/forms": "~6.0.0-rc.0",
20+
"@angular/http": "~6.0.0-rc.0",
21+
"@angular/platform-browser": "~6.0.0-rc.0",
22+
"@angular/platform-browser-dynamic": "~6.0.0-rc.0",
23+
"@angular/router": "~6.0.0-rc.0",
24+
"nativescript-angular": "rc",
2525
"nativescript-theme-core": "~1.0.2",
2626
"reflect-metadata": "~0.1.8",
27-
"rxjs": "^5.5.0",
27+
"rxjs": "~6.0.0-beta.1",
2828
"tns-core-modules": "next",
2929
"zone.js": "^0.8.4"
3030
},
3131
"devDependencies": {
32-
"@angular/compiler-cli": "~5.2.0",
33-
"@ngtools/webpack": "~1.9.4",
32+
"@angular-devkit/core": "~0.5.5",
33+
"@angular/compiler-cli": "~6.0.0-rc.0",
34+
"@ngtools/webpack": "~6.0.0-rc.3",
3435
"@types/chai": "^4.0.2",
3536
"@types/mocha": "^2.2.41",
3637
"@types/node": "^7.0.5",
@@ -39,7 +40,8 @@
3940
"babylon": "6.18.0",
4041
"chai": "~4.1.1",
4142
"chai-as-promised": "~7.1.1",
42-
"copy-webpack-plugin": "~4.3.0",
43+
"clean-webpack-plugin": "~0.1.19",
44+
"copy-webpack-plugin": "~4.5.1",
4345
"css-loader": "~0.28.7",
4446
"extract-text-webpack-plugin": "~3.0.2",
4547
"lazy": "1.0.11",
@@ -51,14 +53,15 @@
5153
"nativescript-dev-typescript": "next",
5254
"nativescript-dev-webpack": "file:../..",
5355
"nativescript-worker-loader": "~0.8.1",
54-
"node-sass": "^4.7.1",
5556
"raw-loader": "~0.5.1",
56-
"resolve-url-loader": "~2.2.1",
57-
"sass-loader": "^6.0.6",
58-
"typescript": "~2.6.2",
59-
"webpack": "~3.10.0",
57+
"resolve-url-loader": "~2.3.0",
58+
"sass-loader": "~6.0.6",
59+
"typescript": "~2.7.2",
60+
"uglifyjs-webpack-plugin": "~1.2.4",
61+
"webpack": "~4.5.0",
6062
"webpack-bundle-analyzer": "^2.9.1",
61-
"webpack-sources": "^1.1.0"
63+
"webpack-cli": "~2.0.14",
64+
"webpack-sources": "~1.1.0"
6265
},
6366
"scripts": {
6467
"ns-bundle": "ns-bundle",

demo/JavaScriptApp/package.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@
1717
"tns-core-modules": "next"
1818
},
1919
"devDependencies": {
20+
"@types/chai": "^4.0.2",
21+
"@types/mocha": "^2.2.41",
22+
"@types/node": "^7.0.5",
2023
"babel-traverse": "6.26.0",
2124
"babel-types": "6.26.0",
2225
"babylon": "6.18.0",
23-
"copy-webpack-plugin": "~4.0.1",
26+
"clean-webpack-plugin": "~0.1.19",
27+
"copy-webpack-plugin": "~4.5.1",
2428
"css-loader": "~0.28.7",
25-
"extract-text-webpack-plugin": "~3.0.0",
29+
"extract-text-webpack-plugin": "~3.0.2",
2630
"lazy": "1.0.11",
2731
"mocha": "~3.5.0",
2832
"mocha-junit-reporter": "^1.13.0",
@@ -33,11 +37,13 @@
3337
"nativescript-worker-loader": "~0.8.1",
3438
"node-sass": "^4.7.1",
3539
"raw-loader": "~0.5.1",
36-
"resolve-url-loader": "~2.1.0",
37-
"sass-loader": "^6.0.6",
38-
"webpack": "~3.10.0",
40+
"resolve-url-loader": "~2.3.0",
41+
"sass-loader": "~6.0.6",
42+
"uglifyjs-webpack-plugin": "~1.2.4",
43+
"webpack": "~4.5.0",
3944
"webpack-bundle-analyzer": "^2.9.1",
40-
"webpack-sources": "^1.1.0"
45+
"webpack-cli": "~2.0.14",
46+
"webpack-sources": "~1.1.0"
4147
},
4248
"scripts": {
4349
"ns-bundle": "ns-bundle",

demo/TypeScriptApp/package.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@
1717
"tns-core-modules": "next"
1818
},
1919
"devDependencies": {
20-
"awesome-typescript-loader": "~3.1.3",
2120
"@types/chai": "^4.0.2",
2221
"@types/mocha": "^2.2.41",
2322
"@types/node": "^7.0.5",
23+
"awesome-typescript-loader": "~5.0.0-1",
2424
"babel-traverse": "6.26.0",
2525
"babel-types": "6.26.0",
2626
"babylon": "6.18.0",
27-
"copy-webpack-plugin": "~4.0.1",
27+
"clean-webpack-plugin": "~0.1.19",
28+
"copy-webpack-plugin": "~4.5.1",
2829
"css-loader": "~0.28.7",
29-
"extract-text-webpack-plugin": "~3.0.0",
30+
"extract-text-webpack-plugin": "~3.0.2",
3031
"lazy": "1.0.11",
3132
"mocha": "~3.5.0",
3233
"mocha-junit-reporter": "^1.13.0",
@@ -36,14 +37,15 @@
3637
"nativescript-dev-typescript": "next",
3738
"nativescript-dev-webpack": "file:../..",
3839
"nativescript-worker-loader": "~0.8.1",
39-
"node-sass": "^4.7.2",
4040
"raw-loader": "~0.5.1",
41-
"resolve-url-loader": "~2.1.0",
42-
"sass-loader": "^6.0.6",
43-
"typescript": "~2.6.2",
44-
"webpack": "~3.10.0",
41+
"resolve-url-loader": "~2.3.0",
42+
"sass-loader": "~6.0.6",
43+
"typescript": "~2.7.2",
44+
"uglifyjs-webpack-plugin": "~1.2.4",
45+
"webpack": "~4.5.0",
4546
"webpack-bundle-analyzer": "^2.9.1",
46-
"webpack-sources": "^1.1.0"
47+
"webpack-cli": "~2.0.14",
48+
"webpack-sources": "~1.1.0"
4749
},
4850
"scripts": {
4951
"ns-bundle": "ns-bundle",

dependencyManager.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,28 @@ function addDependency(deps, name, version, force) {
5858

5959
function getRequiredDeps(packageJson) {
6060
const deps = {
61-
"webpack": "~3.10.0",
61+
"webpack": "~4.5.0",
62+
"webpack-cli": "~2.0.14",
6263
"webpack-bundle-analyzer": "^2.9.1",
6364
"webpack-sources": "~1.1.0",
6465
"clean-webpack-plugin": "~0.1.19",
65-
"copy-webpack-plugin": "~4.3.0",
66+
"copy-webpack-plugin": "~4.5.1",
6667
"raw-loader": "~0.5.1",
6768
"css-loader": "~0.28.7",
6869
"nativescript-worker-loader": "~0.8.1",
69-
"resolve-url-loader": "~2.2.1",
70+
"resolve-url-loader": "~2.3.0",
7071
"extract-text-webpack-plugin": "~3.0.2",
71-
"uglifyjs-webpack-plugin": "~1.1.6",
72+
"uglifyjs-webpack-plugin": "~1.2.4",
7273
};
7374

7475
if (isAngular({packageJson})) {
7576
Object.assign(deps, {
7677
"@angular/compiler-cli": packageJson.dependencies["@angular/core"],
77-
"@ngtools/webpack": "~1.9.4",
78+
"@ngtools/webpack": "~6.0.0-rc.3",
79+
"@angular-devkit/core": "~0.5.5",
7880
});
7981
} else if (isTypeScript({packageJson})) {
80-
Object.assign(deps, { "awesome-typescript-loader": "~3.1.3" });
82+
Object.assign(deps, { "awesome-typescript-loader": "~5.0.0" });
8183
}
8284

8385
if (isSass({packageJson})) {

lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function buildEnvData($projectData, platform, env) {
1919
const appResourcesPath = getAppResourcesPathFromProjectData($projectData);
2020
Object.assign(envData,
2121
appPath && { appPath },
22-
appResourcesPath && { appResourcesPath }
22+
appResourcesPath && { appResourcesPath },
2323
);
2424

2525
return envData;

0 commit comments

Comments
 (0)