Merge branch 'master' of github.com:NativeScript/NativeScript

# Conflicts:
#	apps/ui/tsconfig.json
#	packages/webpack5/src/helpers/index.ts
This commit is contained in:
Martin Guillon
2022-01-12 15:36:44 +01:00
107 changed files with 1763 additions and 1286 deletions

2
apps/ui/.gitignore vendored
View File

@@ -1 +1 @@
!webpack.custom.config.js
!webpack.config.js

View File

@@ -1,7 +1,7 @@
***e2e tests execution***
1. Local setup
- install appium and all requirments related to `nativescript-dev-appium` plugin usage
- install appium and all requirements related to `nativescript-dev-appium` plugin usage
- download images:
```npm run load-images Emulator-Api23-Default "iPhone X 12"```
@@ -36,7 +36,7 @@
- Run:
`npm run e2e-debug [android|ios]`
run in separate console and don't kill it. This command will start appium server and driver and use the installed app on the device but it will not execute tests.
run in separate console and don't kill it. This command will start appium server and driver and use the installed app on the device, but it will not execute tests.
- Go to vs code debugging and use a config like:
```

View File

@@ -2,10 +2,12 @@ import { NativeScriptConfig } from '@nativescript/core';
export default {
id: 'org.nativescript.uitestsapp',
appPath: 'src',
appResourcesPath: '../../tools/assets/App_Resources',
webpackConfigPath: 'webpack.custom.config.js',
android: {
v8Flags: '--expose_gc',
markingMode: 'none',
},
cli: {
packageManager: 'npm',
},
} as NativeScriptConfig;

View File

@@ -1,5 +1,5 @@
{
"main": "main.js",
"main": "src/main.ts",
"description": "NativeScript Application",
"license": "MIT",
"repository": {

42
apps/ui/project.json Normal file
View File

@@ -0,0 +1,42 @@
{
"root": "apps/ui/",
"sourceRoot": "apps/ui/src",
"projectType": "application",
"prefix": "nativescript",
"targets": {
"build": {
"executor": "@nativescript/nx:build",
"options": {
"noHmr": true,
"production": true,
"uglify": true,
"release": true,
"forDevice": true
}
},
"ios": {
"executor": "@nativescript/nx:build",
"options": {
"platform": "ios"
}
},
"android": {
"executor": "@nativescript/nx:build",
"options": {
"platform": "android"
}
},
"clean": {
"executor": "@nativescript/nx:build",
"options": {
"clean": true
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["apps/ui/**/*.ts", "apps/ui/src/**/*.html"]
}
}
}
}

View File

@@ -1,5 +1,6 @@
#page {
@import url("../css/import.css");
#page {
background-color: lightcoral;
}
@import url("../css/import.css");

View File

@@ -1,11 +1,11 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"diagnostics": false,
"paths": {
"~/*": ["src/*"]
}
},
"include": ["src/**/*", "references.d.ts"],
"exclude": ["node_modules", "tmp", "platforms", "__tests__", "e2"]
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"diagnostics": false,
"paths": {
"~/*": ["src/*"],
"tns-core-modules/*": ["@nativescript/core/*"]
}
},
"exclude": ["e2e"]
}

20
apps/ui/webpack.config.js Normal file
View File

@@ -0,0 +1,20 @@
const webpack = require("@nativescript/webpack");
const { ContextExclusionPlugin } = require('webpack')
module.exports = (env) => {
webpack.init(env);
webpack.chainWebpack(config => {
config.plugin('DefinePlugin').tap(args => {
Object.assign(args[0], {
__CI__: !!process.env.CI,
})
return args
})
})
return webpack.resolveConfig();
};

View File

@@ -1,18 +0,0 @@
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const webpackConfig = require('./webpack.config');
module.exports = (env) => {
env = env || {};
const baseConfig = webpackConfig(env);
baseConfig.plugins.push(new webpack.DefinePlugin({
__CI__: !!process.env.CI,
__UI_USE_XML_PARSER__: true,
__UI_USE_EXTERNAL_RENDERER__: false,
__CSS_PARSER__: JSON.stringify('css-tree')
}))
return baseConfig;
};