Skip to content

Commit

Permalink
feat(webpack): use scoped @nativescript/webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWalker committed Jul 2, 2020
1 parent 037186c commit 8307d78
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/man_pages/general/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ position: 16

### Description

Updates the project with the latest versions of iOS/Android runtimes, cross-platform modules and "nativescript-dev-webpack".
Updates the project with the latest versions of iOS/Android runtimes, cross-platform modules and "@nativescript/webpack".
In order to get the latest development release instead, pass `next` as argument:
`tns update next`

Expand Down
4 changes: 2 additions & 2 deletions lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const TNS_CORE_MODULES_NAME = "tns-core-modules";
export const SCOPED_TNS_CORE_MODULES = "@nativescript/core";
export const TNS_CORE_THEME_NAME = "nativescript-theme-core";
export const SCOPED_TNS_CORE_THEME_NAME = "@nativescript/theme";
export const WEBPACK_PLUGIN_NAME = "nativescript-dev-webpack";
export const WEBPACK_PLUGIN_NAME = "@nativescript/webpack";
export const TNS_CORE_MODULES_WIDGETS_NAME = "tns-core-modules-widgets";
export const TNS_ANDROID_RUNTIME_NAME = "tns-android";
export const TNS_IOS_RUNTIME_NAME = "tns-ios";
Expand Down Expand Up @@ -298,7 +298,7 @@ export class IosProjectConstants {

export class BundleValidatorMessages {
public static MissingBundlePlugin = "Passing --bundle requires a bundling plugin. No bundling plugin found or the specified bundling plugin is invalid.";
public static NotSupportedVersion = `The NativeScript CLI requires nativescript-dev-webpack %s or later to work properly. After updating nativescript-dev-webpack you need to ensure "webpack.config.js" file is up to date with the one in the new version of nativescript-dev-webpack. You can automatically update it using "./node_modules/.bin/update-ns-webpack --configs" command.`;
public static NotSupportedVersion = `The NativeScript CLI requires @nativescript/webpack %s or later to work properly. After updating @nativescript/webpack you need to ensure "webpack.config.js" file is up to date with the one in the new version of @nativescript/webpack. You can automatically update it using "./node_modules/.bin/update-ns-webpack --configs" command.`;
}

export class AndroidBundleValidatorMessages {
Expand Down
1 change: 0 additions & 1 deletion lib/controllers/migrate-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ Running this command will ${MigrateController.COMMON_MIGRATE_MESSAGE}`;
{ packageName: "nativescript-dev-sass", isDev: true, replaceWith: "node-sass" },
{ packageName: "nativescript-dev-typescript", isDev: true, replaceWith: MigrateController.typescriptPackageName },
{ packageName: "nativescript-dev-less", isDev: true, shouldRemove: true, warning: "LESS CSS is not supported out of the box. In order to enable it, follow the steps in this feature request: https://github.com/NativeScript/nativescript-dev-webpack/issues/967" },
{ packageName: constants.WEBPACK_PLUGIN_NAME, isDev: true, shouldAddIfMissing: true, verifiedVersion: "1.0.1" },
{ packageName: "nativescript-camera", verifiedVersion: "4.5.0" },
{ packageName: "nativescript-geolocation", verifiedVersion: "5.1.0" },
{ packageName: "nativescript-imagepicker", verifiedVersion: "6.2.0" },
Expand Down
4 changes: 2 additions & 2 deletions lib/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -921,8 +921,8 @@ interface IXcconfigService {
interface IBundleValidatorHelper {
/**
* Validates bundling options.
* In case when minSupportedVersion is provided, gets the current version of nativescript-dev-webpack from package.json and compares with the provided version.
* @param {string} minSupportedVersion the minimum supported version of nativescript-dev-webpack
* In case when minSupportedVersion is provided, gets the current version of @nativescript/webpack from package.json and compares with the provided version.
* @param {string} minSupportedVersion the minimum supported version of @nativescript/webpack
* @return {void}
*/
validate(projectData: IProjectData, minSupportedVersion?: string): void;
Expand Down
2 changes: 1 addition & 1 deletion lib/services/webpack/webpack-compiler-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
const installedWebpackPluginVersion = await this.$packageInstallationManager.getInstalledDependencyVersion(WEBPACK_PLUGIN_NAME, projectData.projectDir);
const hasWebpackPluginWithWinSnapshotsSupport = !!installedWebpackPluginVersion ? semver.gte(semver.coerce(installedWebpackPluginVersion), minWebpackPluginWithWinSnapshotsVersion) : true;
if (!hasWebpackPluginWithWinSnapshotsSupport) {
this.$errors.fail(`In order to generate Snapshots on Windows, please upgrade your Webpack plugin version (npm i nativescript-dev-webpack@latest).`);
this.$errors.fail(`In order to generate Snapshots on Windows, please upgrade your Webpack plugin version (npm i ${WEBPACK_PLUGIN_NAME}@latest).`);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nativescript",
"preferGlobal": true,
"version": "6.7.8",
"version": "6.8.0-alpha.0",
"author": "NativeScript <support@nativescript.org>",
"description": "Command-line interface for building NativeScript projects",
"bin": {
Expand Down
6 changes: 3 additions & 3 deletions test/controllers/update-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe("update controller method tests", () => {
"tns-core-modules": "0.1.0",
},
devDependencies: {
"nativescript-dev-webpack": "1.1.3"
"@nativescript/webpack": "1.1.3"
}
};
};
Expand All @@ -162,7 +162,7 @@ describe("update controller method tests", () => {
},
devDependencies: {
"devDep1": "1.2.0",
"nativescript-dev-webpack": "1.3.0"
"@nativescript/webpack": "1.3.0"
},
name: "template1"
};
Expand Down Expand Up @@ -193,7 +193,7 @@ describe("update controller method tests", () => {
"tns-core-modules": "1.0.0",
},
devDependencies: {
"nativescript-dev-webpack": "1.3.0"
"@nativescript/webpack": "1.3.0"
}
});
});
Expand Down

0 comments on commit 8307d78

Please sign in to comment.