Skip to content

chore: version bump + minor info.plist update #368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/App_Resources/iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
<dict>
<key>CFBundleURLName</key>
<string><your org.nativescript.nativescriptsdkexamplesng></string>
<key>CFBundleTypeRole</key>
<string>None</string>
<key>CFBundleURLSchemes</key>
<array>
<string>examplesgo</string>
Expand Down
43 changes: 21 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,46 +21,43 @@
"license": "Apache-2.0",
"nativescript": {
"id": "org.nativescript.nativescriptsdkexamplesng",
"tns-android": {
"version": "5.1.0"
},
"tns-ios": {
"version": "5.1.0"
"version": "5.3.0-rc-2019-03-25-101854-01"
}
},
"dependencies": {
"@angular/common": "~7.1.0",
"@angular/compiler": "~7.1.0",
"@angular/core": "~7.1.0",
"@angular/forms": "~7.1.0",
"@angular/http": "~7.1.0",
"@angular/platform-browser": "~7.1.0",
"@angular/platform-browser-dynamic": "~7.1.0",
"@angular/router": "~7.1.0",
"nativescript-angular": "^7.1.0",
"nativescript-camera": "^4.1.1",
"nativescript-geolocation": "^4.3.1",
"@angular/common": "~7.2.0",
"@angular/compiler": "~7.2.0",
"@angular/core": "~7.2.0",
"@angular/forms": "~7.2.0",
"@angular/http": "~7.2.0",
"@angular/platform-browser": "~7.2.0",
"@angular/platform-browser-dynamic": "~7.2.0",
"@angular/router": "~7.2.0",
"nativescript-angular": "^7.2.3",
"nativescript-camera": "^4.4.0",
"nativescript-geolocation": "^5.0.0",
"nativescript-intl": "~3.0.0",
"nativescript-theme-core": "^1.0.4",
"reflect-metadata": "~0.1.12",
"rxjs": "^6.3.3",
"tns-core-modules": "^5.1.1",
"tns-core-modules": "^5.2.2",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/compiler-cli": "~7.1.0",
"@ngtools/webpack": "~7.1.0",
"@angular/compiler-cli": "~7.2.0",
"@ngtools/webpack": "~7.2.0",
"codelyzer": "^3.0.1",
"fs-extra": "^0.30.0",
"glob": "^7.1.3",
"lazy": "1.0.11",
"markdown-snippet-injector": "^0.2.2",
"nativescript-dev-typescript": "^0.7.8",
"nativescript-dev-webpack": "^0.18.5",
"nativescript-dev-typescript": "^0.9.0",
"nativescript-dev-webpack": "^0.20.3",
"opener": "^1.4.1",
"rimraf": "^2.5.3",
"tar.gz": "^1.0.5",
"tns-platform-declarations": "^5.1.1",
"tns-platform-declarations": "^5.2.2",
"tslint": "^5.11.0",
"typescript": "~3.1.1"
},
Expand All @@ -73,6 +70,8 @@
"build": "node scripts/build.js",
"postbuild": "npm run inject && npm run archive",
"inject": "mdinject --root=app --docsroot=dist/code-samples --sourceext=\".ts|.css|.html\" --snippettitles=\"TypeScript|CSS|HTML\"",
"archive": "node scripts/archive.js"
"archive": "node scripts/archive.js",
"update-webpack": "./node_modules/.bin/update-ns-webpack --deps --configs",
"update-angular": "./node_modules/.bin/update-app-ng-deps"
}
}
55 changes: 42 additions & 13 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
const { join, relative, resolve, sep } = require("path");
const { join, relative, resolve, sep, dirname } = require("path");

const webpack = require("webpack");
const nsWebpack = require("nativescript-dev-webpack");
const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target");
const { nsReplaceBootstrap } = require("nativescript-dev-webpack/transformers/ns-replace-bootstrap");
const { nsReplaceLazyLoader } = require("nativescript-dev-webpack/transformers/ns-replace-lazy-loader");
const { nsSupportHmrNg } = require("nativescript-dev-webpack/transformers/ns-support-hmr-ng");
const { getMainModulePath } = require("nativescript-dev-webpack/utils/ast-utils");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const { AngularCompilerPlugin } = require("@ngtools/webpack");
const hashSalt = Date.now().toString();

module.exports = env => {
// Add your custom Activities, Services and other Android app components here.
Expand All @@ -33,8 +37,8 @@ module.exports = env => {
// The 'appPath' and 'appResourcesPath' values are fetched from
// the nsconfig.json configuration file
// when bundling with `tns run android|ios --bundle`.
appPath = "app",
appResourcesPath = "app/App_Resources",
appPath = "src",
appResourcesPath = "App_Resources",

// You can provide the following flags when running 'tns run android|ios'
aot, // --env.aot
Expand All @@ -44,23 +48,45 @@ module.exports = env => {
sourceMap, // --env.sourceMap
hmr, // --env.hmr,
} = env;
const externals = (env.externals || []).map((e) => { // --env.externals
return new RegExp(e + ".*");
});

const externals = nsWebpack.getConvertedExternals(env.externals);
const appFullPath = resolve(projectRoot, appPath);
const appResourcesFullPath = resolve(projectRoot, appResourcesPath);

const tsConfigName = "tsconfig.tns.json";
const entryModule = `${nsWebpack.getEntryModule(appFullPath)}.ts`;
const entryPath = `.${sep}${entryModule}`;
const ngCompilerTransformers = [];
const additionalLazyModuleResources = [];
if (aot) {
ngCompilerTransformers.push(nsReplaceBootstrap);
}

if (hmr) {
ngCompilerTransformers.push(nsSupportHmrNg);
}

// when "@angular/core" is external, it's not included in the bundles. In this way, it will be used
// directly from node_modules and the Angular modules loader won't be able to resolve the lazy routes
// fixes https://github.com/NativeScript/nativescript-cli/issues/4024
if (env.externals && env.externals.indexOf("@angular/core") > -1) {
const appModuleRelativePath = getMainModulePath(resolve(appFullPath, entryModule), tsConfigName);
if (appModuleRelativePath) {
const appModuleFolderPath = dirname(resolve(appFullPath, appModuleRelativePath));
// include the lazy loader inside app module
ngCompilerTransformers.push(nsReplaceLazyLoader);
// include the new lazy loader path in the allowed ones
additionalLazyModuleResources.push(appModuleFolderPath);
}
}

const ngCompilerPlugin = new AngularCompilerPlugin({
hostReplacementPaths: nsWebpack.getResolver([platform, "tns"]),
platformTransformers: aot ? [nsReplaceBootstrap(() => ngCompilerPlugin)] : null,
platformTransformers: ngCompilerTransformers.map(t => t(() => ngCompilerPlugin, resolve(appFullPath, entryModule))),
mainPath: resolve(appPath, entryModule),
tsConfigPath: join(__dirname, "tsconfig.tns.json"),
tsConfigPath: join(__dirname, tsConfigName),
skipCodeGeneration: !aot,
sourceMap: !!sourceMap,
additionalLazyModuleResources: additionalLazyModuleResources
});

const config = {
Expand All @@ -84,6 +110,7 @@ module.exports = env => {
libraryTarget: "commonjs2",
filename: "[name].js",
globalObject: "global",
hashSalt
},
resolve: {
extensions: [".ts", ".js", ".scss", ".css"],
Expand Down Expand Up @@ -171,14 +198,15 @@ module.exports = env => {
// tns-core-modules reads the app.css and its imports using css-loader
{
test: /[\/|\\]app\.css$/,
use: {
loader: "css-loader",
options: { minimize: false, url: false },
}
use: [
"nativescript-dev-webpack/style-hot-loader",
{ loader: "css-loader", options: { minimize: false, url: false } }
]
},
{
test: /[\/|\\]app\.scss$/,
use: [
"nativescript-dev-webpack/style-hot-loader",
{ loader: "css-loader", options: { minimize: false, url: false } },
"sass-loader"
]
Expand All @@ -192,6 +220,7 @@ module.exports = env => {
test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/,
use: [
"nativescript-dev-webpack/moduleid-compat-loader",
"nativescript-dev-webpack/lazy-ngmodule-hot-loader",
"@ngtools/webpack",
]
},
Expand Down