Skip to content

Commit 3360770

Browse files
Merge branch 'vnext' into ikitanov/textarea-samples-react
2 parents af7dbbf + c00c8ff commit 3360770

1,042 files changed

Lines changed: 125861 additions & 80318 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

azure-pipelines/build-pipeline.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ parameters:
1111
displayName: 'Get verbose output from steps - where configurable'
1212
type: boolean
1313
default: false
14+
- name: shouldCleanPostExectuion
15+
displayName: 'Clean all pipeline dirs after the pipeline finishes?'
16+
type: boolean
17+
default: true
1418

1519
name: $(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
1620

@@ -133,3 +137,6 @@ stages:
133137
inputs:
134138
targetPath: '$(Build.ArtifactStagingDirectory)/ReactSamples.zip'
135139
artifact: 'ReactSamplesBrowser'
140+
141+
- ${{ if eq(parameters.shouldCleanPostExectuion, true) }}:
142+
- task: PostBuildCleanup@4

browser/.eslintrc.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ module.exports = {
6161
"no-useless-concat": "off",
6262
"no-mixed-operators": "off",
6363
"no-prototype-builtins": "off",
64-
"no-empty-function": "off",
65-
"@typescript-eslint/no-empty-function": "error",
6664
"prefer-const": "off",
6765
"prefer-rest-params": "off",
6866
"jsx-a11y/alt-text": "off",

browser/config-overrides.js

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
const path = require('path');
22
let pathsConfig = require("./tsconfig.paths.json");
33
const {alias, configPaths, expandResolveAlias, expandRulesInclude, expandPluginsScope} = require('react-app-rewire-alias')
4+
const resolve = require('resolve');
5+
const shouldUseSourceMap = false; // process.env.GENERATE_SOURCEMAP !== 'false';
6+
const ForkTsCheckerWebpackPlugin =
7+
process.env.TSC_COMPILE_ON_ERROR === 'true'
8+
? require('react-dev-utils/ForkTsCheckerWarningWebpackPlugin')
9+
: require('react-dev-utils/ForkTsCheckerWebpackPlugin');
410

511
//this works around the fact that alias doesn't support multiple paths
612
function aliasMultiple(aliasMap) {
@@ -26,6 +32,15 @@ function aliasMultiple(aliasMap) {
2632
/* eslint-disable @typescript-eslint/no-var-requires */
2733
module.exports = function override(config, env) {
2834
console.log("config-overrides.js started");
35+
console.log("env: " + env);
36+
const isEnvDevelopment = env === 'development';
37+
const isEnvProduction = env === 'production';
38+
39+
// Variable used for enabling profiling in Production
40+
// passed into alias object. Uses a flag if passed into the build command
41+
const isEnvProductionProfile =
42+
isEnvProduction && process.argv.includes('--profile');
43+
2944
const paths = require('./node_modules/react-scripts/config/paths');
3045
// console.log("config-overrides.js paths");
3146
console.log(paths);
@@ -166,7 +181,70 @@ module.exports = function override(config, env) {
166181
//let newConfig = alias(configPathsMultiple('./tsconfig.paths.json'))(config);
167182
//console.log(newConfig);
168183

184+
if (!config.resolve) {
185+
config.resolve = {};
186+
}
187+
config.resolve.mainFields = ["esm2015", "module", "main"];
188+
189+
let checkerInd = -1;
190+
for (var i = 0; i < config.plugins.length; i++) {
191+
if (config.plugins[i] instanceof ForkTsCheckerWebpackPlugin) {
192+
checkerInd = i;
193+
break;
194+
}
195+
}
196+
if (checkerInd >= 0) {
197+
let checker = new ForkTsCheckerWebpackPlugin({
198+
async: isEnvDevelopment,
199+
typescript: {
200+
memoryLimit: 10240,
201+
typescriptPath: resolve.sync('typescript', {
202+
basedir: paths.appNodeModules,
203+
}),
204+
configOverwrite: {
205+
compilerOptions: {
206+
sourceMap: isEnvProduction
207+
? shouldUseSourceMap
208+
: isEnvDevelopment,
209+
skipLibCheck: true,
210+
inlineSourceMap: false,
211+
declarationMap: false,
212+
noEmit: true,
213+
incremental: true,
214+
tsBuildInfoFile: paths.appTsBuildInfoFile,
215+
},
216+
},
217+
context: paths.appPath,
218+
diagnosticOptions: {
219+
syntactic: true,
220+
},
221+
mode: 'write-references',
222+
// profile: true,
223+
},
224+
issue: {
225+
// This one is specifically to match during CI tests,
226+
// as micromatch doesn't match
227+
// '../cra-template-typescript/template/src/App.tsx'
228+
// otherwise.
229+
include: [
230+
{ file: '../**/src/**/*.{ts,tsx}' },
231+
{ file: '**/src/**/*.{ts,tsx}' },
232+
],
233+
exclude: [
234+
{ file: '**/src/**/__tests__/**' },
235+
{ file: '**/src/**/?(*.){spec|test}.*' },
236+
{ file: '**/src/setupProxy.*' },
237+
{ file: '**/src/setupTests.*' },
238+
],
239+
},
240+
logger: {
241+
infrastructure: 'silent',
242+
},
243+
});
244+
config.plugins[checkerInd] = checker;
245+
}
246+
169247
let newConfig = aliasMultiple(tspaths)(config);
170248
console.log(newConfig);
171249
return newConfig;
172-
}
250+
}

browser/package-lock.json

Lines changed: 76 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)