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

Commit 54e0280

Browse files
committed
Updates
1 parent e2dd902 commit 54e0280

File tree

7 files changed

+39
-31
lines changed

7 files changed

+39
-31
lines changed

demo/app/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ You can use this file to perform app-level initialization, but the primary
44
purpose of the file is to pass control to the app’s first module.
55
*/
66

7-
var application = require("tns-core-modules/application");
7+
var application = require("@nativescript/core/application");
88

99
application.run({ moduleName: "app-root" });
1010

demo/app/main-page.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const sqlite = require('@proplugins/nativescript-sqlite');
2-
const ObservableArray = require("tns-core-modules/data/observable-array").ObservableArray;
2+
const ObservableArray = require("@nativescript/core/data/observable-array").ObservableArray;
33

44

55
//var Tracing = require('./tracing.js');
@@ -119,7 +119,7 @@ exports.addNewName = function() {
119119
};
120120

121121
exports.openMT = function() {
122-
const utils = require('tns-core-modules/utils/utils');
122+
const utils = require('@nativescript/core/utils/utils');
123123
utils.openUrl("https://www.master-technology.com");
124124
};
125125

demo/app/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"main": "app.js",
33
"android": {
4-
"v8Flags": "--expose_gc"
4+
"v8Flags": "--expose_gc",
5+
"markingMode": "none"
56
}
6-
}
7+
}

demo/package.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,23 @@
22
"nativescript": {
33
"id": "org.proplugins.demo.sqlite",
44
"tns-ios": {
5-
"version": "6.0.1"
5+
"version": "6.2.0"
66
},
77
"tns-android": {
8-
"version": "6.0.0"
8+
"version": "6.3.1"
99
}
1010
},
1111
"description": "SQLite Demo Application",
1212
"license": "MIT",
1313
"repository": "<fill-your-repository-here>",
1414
"dependencies": {
1515
"@proplugins/nativescript-sqlite": "file:../src",
16-
"nativescript-sqlite": "file:../src",
17-
"nativescript-sqlite-commercial": "../commercial",
18-
"nativescript-sqlite-encrypted": "file:../encrypted",
19-
"nativescript-sqlite-sync": "file:../sync",
16+
"nativescript-sqlite-commercial": "file:../nativescript-sqlite-commercial-1.4.1.tgz",
2017
"nativescript-theme-core": "~1.0.4",
21-
"tns-core-modules": "6.0.1"
18+
"tns-core-modules": "~6.3.0"
2219
},
2320
"devDependencies": {
24-
"nativescript-dev-webpack": "1.0.1",
21+
"nativescript-dev-webpack": "~1.4.0",
2522
"nativescript-worker-loader": "^0.9.5"
2623
},
2724
"readme": "SQLite Demo Application"

demo/webpack.config.js

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ module.exports = env => {
3030

3131
const {
3232
// The 'appPath' and 'appResourcesPath' values are fetched from
33-
// the nsconfig.json configuration file
34-
// when bundling with `tns run android|ios --bundle`.
33+
// the nsconfig.json configuration file.
3534
appPath = "app",
3635
appResourcesPath = "app/App_Resources",
3736

@@ -45,11 +44,25 @@ module.exports = env => {
4544
hmr, // --env.hmr,
4645
unitTesting, // --env.unitTesting,
4746
verbose, // --env.verbose
47+
snapshotInDocker, // --env.snapshotInDocker
48+
skipSnapshotTools, // --env.skipSnapshotTools
49+
compileSnapshot // --env.compileSnapshot
4850
} = env;
4951

52+
const useLibs = compileSnapshot;
5053
const isAnySourceMapEnabled = !!sourceMap || !!hiddenSourceMap;
5154
const externals = nsWebpack.getConvertedExternals(env.externals);
5255
const appFullPath = resolve(projectRoot, appPath);
56+
const hasRootLevelScopedModules = nsWebpack.hasRootLevelScopedModules({ projectDir: projectRoot });
57+
let coreModulesPackageName = "tns-core-modules";
58+
const alias = {
59+
'~': appFullPath
60+
};
61+
62+
if (hasRootLevelScopedModules) {
63+
coreModulesPackageName = "@nativescript/core";
64+
alias["tns-core-modules"] = coreModulesPackageName;
65+
}
5366
const appResourcesFullPath = resolve(projectRoot, appResourcesPath);
5467

5568
const entryModule = nsWebpack.getEntryModule(appFullPath, platform);
@@ -96,22 +109,16 @@ module.exports = env => {
96109
extensions: [".js", ".scss", ".css"],
97110
// Resolve {N} system modules from tns-core-modules
98111
modules: [
99-
resolve(__dirname, "node_modules/tns-core-modules"),
112+
resolve(__dirname, `node_modules/${coreModulesPackageName}`),
100113
resolve(__dirname, "node_modules"),
101-
"node_modules/tns-core-modules",
114+
`node_modules/${coreModulesPackageName}`,
102115
"node_modules",
103116
],
104-
alias: {
105-
'~': appFullPath
106-
},
117+
alias,
107118
// resolve symlinks to symlinked modules
108119
symlinks: true
109120
},
110121
resolveLoader: {
111-
modules: [
112-
resolve(__dirname, "node_modules"),
113-
"node_modules"
114-
],
115122
// don't resolve symlinks to symlinked loaders
116123
symlinks: false
117124
},
@@ -126,6 +133,7 @@ module.exports = env => {
126133
devtool: hiddenSourceMap ? "hidden-source-map" : (sourceMap ? "inline-source-map" : "none"),
127134
optimization: {
128135
runtimeChunk: "single",
136+
noEmitOnErrors: true,
129137
splitChunks: {
130138
cacheGroups: {
131139
vendor: {
@@ -165,7 +173,7 @@ module.exports = env => {
165173
module: {
166174
rules: [
167175
{
168-
test: nsWebpack.getEntryPathRegExp(appFullPath, entryPath),
176+
include: join(appFullPath, entryPath),
169177
use: [
170178
// Require all Android app components
171179
platform === "android" && {
@@ -195,13 +203,13 @@ module.exports = env => {
195203

196204
{
197205
test: /\.css$/,
198-
use: { loader: "css-loader", options: { url: false } }
206+
use: "nativescript-dev-webpack/css2json-loader"
199207
},
200208

201209
{
202210
test: /\.scss$/,
203211
use: [
204-
{ loader: "css-loader", options: { url: false } },
212+
"nativescript-dev-webpack/css2json-loader",
205213
"sass-loader"
206214
]
207215
},
@@ -221,7 +229,7 @@ module.exports = env => {
221229
{ from: { glob: "**/*.jpg" } },
222230
{ from: { glob: "**/*.png" } },
223231
{ from: { glob: "**/*.sqlite" } },
224-
], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }), /** */
232+
], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
225233
new nsWebpack.GenerateNativeScriptEntryPointsPlugin("bundle"),
226234

227235
// For instructions on how to set up workers with webpack
@@ -255,6 +263,9 @@ module.exports = env => {
255263
],
256264
projectRoot,
257265
webpackConfig: config,
266+
snapshotInDocker,
267+
skipSnapshotTools,
268+
useLibs
258269
}));
259270
}
260271

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@proplugins/nativescript-sqlite",
2+
"name": "nativescript-sqlite",
33
"version": "2.5.0",
44
"description": "A sqlite NativeScript module for Android and iOS",
55
"main": "sqlite",

src/sqlite.android.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,8 +1044,7 @@ function _getContext() {
10441044

10451045
//noinspection JSUnresolvedFunction,JSUnresolvedVariable
10461046
ctx = java.lang.Class.forName("android.app.ActivityThread").getMethod("currentApplication", null).invoke(null, null);
1047-
if (ctx) return ctx;
1048-
1047+
10491048
return ctx;
10501049
}
10511050

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy