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

Commit 583084c

Browse files
committed
update demo NS versions
1 parent 21eb3a3 commit 583084c

File tree

5 files changed

+68
-25
lines changed

5 files changed

+68
-25
lines changed

demo/.migration_backup/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"nativescript": {
3+
"id": "org.nativescript.demo"
4+
},
5+
"dependencies": {
6+
"nativescript-theme-core": "^1.0.4",
7+
"nativescript-unit-test-runner": "0.6.4",
8+
"nativescript-loading-indicator": "file:../src",
9+
"tns-core-modules": "^6.3.2"
10+
},
11+
"devDependencies": {
12+
"jasmine-core": "^2.5.2",
13+
"karma": "4.1.0",
14+
"karma-jasmine": "2.0.1",
15+
"karma-nativescript-launcher": "^0.4.0",
16+
"nativescript-css-loader": "~0.26.1",
17+
"nativescript-dev-webpack": "1.4.1",
18+
"tns-platform-declarations": "6.3.2",
19+
"tslint": "~5.20.1",
20+
"typescript": "3.7.4",
21+
"karma-webpack": "3.0.5"
22+
},
23+
"scripts": {
24+
"build.plugin": "cd ../src && npm run build",
25+
"ci.tslint": "npm i && tslint --config '../tslint.json' 'app/**/*.ts' --exclude '**/node_modules/**' --exclude '**/platforms/**'"
26+
}
27+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig",
3+
"compilerOptions": {
4+
"module": "es2015",
5+
"moduleResolution": "node"
6+
}
7+
}

demo/karma.conf.js

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,70 @@
1-
module.exports = function(config) {
1+
module.exports = function (config) {
22
const options = {
3+
34
// base path that will be used to resolve all patterns (eg. files, exclude)
4-
basePath: "",
5+
basePath: '',
6+
57

68
// frameworks to use
79
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
810
frameworks: ["jasmine"],
911

12+
1013
// list of files / patterns to load in the browser
11-
files: ["app/tests/**/*.*"],
14+
files: ['app/tests/**/*.*'],
15+
1216

1317
// list of files to exclude
14-
exclude: [],
18+
exclude: [
19+
],
20+
1521

1622
// preprocess matching files before serving them to the browser
1723
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
18-
preprocessors: {},
24+
preprocessors: {
25+
},
26+
1927

2028
// test results reporter to use
2129
// possible values: 'dots', 'progress'
2230
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
23-
reporters: ["progress"],
31+
reporters: ['progress'],
32+
2433

2534
// web server port
2635
port: 9876,
2736

37+
2838
// enable / disable colors in the output (reporters and logs)
2939
colors: true,
3040

41+
3142
// level of logging
3243
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
3344
logLevel: config.LOG_INFO,
3445

46+
3547
// enable / disable watching file and executing tests whenever any file changes
3648
autoWatch: true,
3749

50+
3851
// start these browsers
3952
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
4053
browsers: [],
4154

4255
customLaunchers: {
4356
android: {
44-
base: "NS",
45-
platform: "android"
57+
base: 'NS',
58+
platform: 'android'
4659
},
4760
ios: {
48-
base: "NS",
49-
platform: "ios"
61+
base: 'NS',
62+
platform: 'ios'
5063
},
5164
ios_simulator: {
52-
base: "NS",
53-
platform: "ios",
54-
arguments: ["--emulator"]
65+
base: 'NS',
66+
platform: 'ios',
67+
arguments: ['--emulator']
5568
}
5669
},
5770

@@ -64,7 +77,7 @@ module.exports = function(config) {
6477
setWebpack(config, options);
6578

6679
config.set(options);
67-
};
80+
}
6881

6982
function setWebpackPreprocessor(config, options) {
7083
if (config && config.bundle) {
@@ -76,7 +89,7 @@ function setWebpackPreprocessor(config, options) {
7689
if (!options.preprocessors[file]) {
7790
options.preprocessors[file] = [];
7891
}
79-
options.preprocessors[file].push("webpack");
92+
options.preprocessors[file].push('webpack');
8093
});
8194
}
8295
}
@@ -86,15 +99,11 @@ function setWebpack(config, options) {
8699
const env = {};
87100
env[config.platform] = true;
88101
env.sourceMap = config.debugBrk;
89-
options.webpack = require("./webpack.config")(env);
102+
env.appPath = config.appPath;
103+
options.webpack = require('./webpack.config')(env);
90104
delete options.webpack.entry;
91105
delete options.webpack.output.libraryTarget;
92-
const invalidPluginsForUnitTesting = [
93-
"GenerateBundleStarterPlugin",
94-
"GenerateNativeScriptEntryPointsPlugin"
95-
];
96-
options.webpack.plugins = options.webpack.plugins.filter(
97-
p => !invalidPluginsForUnitTesting.includes(p.constructor.name)
98-
);
106+
const invalidPluginsForUnitTesting = ["GenerateBundleStarterPlugin", "GenerateNativeScriptEntryPointsPlugin"];
107+
options.webpack.plugins = options.webpack.plugins.filter(p => !invalidPluginsForUnitTesting.includes(p.constructor.name));
99108
}
100109
}

demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
},
55
"dependencies": {
66
"nativescript-theme-core": "^1.0.4",
7-
"nativescript-unit-test-runner": "0.6.4",
7+
"nativescript-unit-test-runner": "0.7.0",
88
"nativescript-loading-indicator": "file:../src",
99
"tns-core-modules": "^6.3.2"
1010
},

demo/tsconfig.tns.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "./tsconfig",
33
"compilerOptions": {
4-
"module": "es2015",
4+
"module": "esNext",
55
"moduleResolution": "node"
66
}
77
}

0 commit comments

Comments
 (0)