Skip to content

Commit 17751e5

Browse files
authored
Merge pull request #381 from IgniteUI/vnext
Updating master from vnext for React release
2 parents bc2ba76 + c56a508 commit 17751e5

1,730 files changed

Lines changed: 522860 additions & 49202 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.

CODEOWNERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# code owners must approve PRs
2+
* @HUSSAR-mtrela
3+
4+
# *.md @HUSSAR-mtrela
5+
# *.js @HUSSAR-mtrela
6+
# *.ts @HUSSAR-mtrela
7+
# *.json @HUSSAR-mtrela

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,22 @@ NOTE this will re-generate the Readme.md file in the new sample
158158
## Learn More
159159

160160
To learn more about **Ignite UI for React** components, check out the [React documentation](https://www.infragistics.com/products/ignite-ui-react/react/components/general-getting-started.html).
161+
162+
163+
# Updating Version of IgniteUI Packages
164+
165+
Perform these steps to update version of **Ignite UI for React** packages in all samples. NOTE that the order of these steps is very important.
166+
167+
- open this repo in VS Code
168+
- open [gulp-samples.js](./browser/tasks/gulp-samples.js) file
169+
- navigate to the `updateIG` function
170+
- change version of **Ignite UI for React** packages in the `packageUpgrades` array
171+
- open terminal window
172+
- run `cd browser` command
173+
- run `gulp updateIG` command
174+
- run `npm install --legacy-peer-deps` command
175+
- create pull request with your changes
176+
- open the [Igniteui-xplat-example](https://github.com/IgniteUI/igniteui-xplat-examples) repo in VS Code
177+
- update version of **Ignite UI for React** packages in [React template](https://github.com/IgniteUI/igniteui-xplat-examples/blob/23.2.x/editor-templates/React/main-template/package.json)
178+
- create pull request with your changes in [Igniteui-xplat-example](https://github.com/IgniteUI/igniteui-xplat-examples) repo
179+

azure-pipelines/build-pipeline.yml

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ trigger:
44
- vnext
55
- master
66

7-
pr:
8-
branches:
9-
exclude:
10-
- '*' # must quote since "*" is a YAML reserved character; we want a string
7+
pr: none
118

129
parameters:
1310
- name: isVerbose
@@ -34,31 +31,76 @@ stages:
3431
versionSource: 'spec'
3532
versionSpec: '16.x'
3633

34+
- task: RegexReplace@3
35+
enabled: false
36+
displayName: 'Replace deps with scoped ones'
37+
inputs:
38+
InputSearchPattern: 'browser\package.json'
39+
FindRegex: 'igniteui-react-[a-z]+'
40+
ReplaceRegex: '@infragistics/$1'
41+
UseUTF8: true
42+
UseRAW: true
43+
3744
- task: Npm@1
38-
displayName: 'npm install'
45+
displayName: 'Register licensed npm registry in .npmrc'
3946
inputs:
40-
command: custom
47+
command: 'custom'
4148
workingDir: '$(Build.SourcesDirectory)\browser'
42-
verbose: ${{ parameters.isVerbose }}
43-
customCommand: 'install --legacy-peer-deps'
44-
customEndpoint: 'public proget'
49+
customCommand: 'config -L project set @infragistics:registry=https://packages.infragistics.com/npm/js-licensed/'
50+
customEndpoint: 'internal proget'
51+
52+
- task: PowerShell@2
53+
displayName: 'Replace references to IG trial packages with licensed ones'
54+
inputs:
55+
failOnStderr: true
56+
showWarnings: true
57+
workingDirectory: '$(Build.SourcesDirectory)\browser'
58+
targetType: 'inline'
59+
script: |
60+
$packageJson = Get-Content -Raw .\package.json | ConvertFrom-Json
61+
$properties = $packageJson.dependencies.PSObject.Properties `
62+
| where-object { $_.Name.StartsWith("igniteui-react") -or $_.Name.StartsWith("igniteui-dockmanager") }
63+
64+
foreach( $property in $properties )
65+
{
66+
$oldName = $property.Name;
67+
$newName = "@infragistics/" + $oldName
68+
69+
# remember the current value of the old property
70+
$value = $property.Value;
71+
72+
# remove reference to the trial package reference
73+
$packageJson.dependencies.psobject.Properties.Remove($oldName);
74+
75+
# add reference to the licensed package reference
76+
$packageJson.dependencies | Add-Member -NotePropertyName $newName -NotePropertyValue $value;
77+
}
4578
79+
ConvertTo-Json -InputObject $packageJson | Set-Content -Path .\package.json
4680
- task: Npm@1
47-
displayName: 'npm uninstall igniteui-dockmanager (trial)'
81+
displayName: 'npm install'
4882
inputs:
4983
command: custom
5084
workingDir: '$(Build.SourcesDirectory)\browser'
5185
verbose: ${{ parameters.isVerbose }}
52-
customCommand: 'uninstall igniteui-dockmanager --no-save'
86+
customCommand: 'install --legacy-peer-deps'
87+
customEndpoint: 'public proget'
5388

54-
- task: CmdLine@2
55-
displayName: 'Install jq - using choco.'
89+
- task: PowerShell@2
90+
displayName: 'Replace references to IG trial packages with licensed ones in TSX files'
5691
inputs:
57-
script: 'choco install jq -y'
5892
failOnStderr: true
93+
showWarnings: true
94+
workingDirectory: '$(Build.SourcesDirectory)'
95+
targetType: 'inline'
96+
script: |
97+
Get-ChildItem -Include "*.tsx","*.ts" -Recurse | `
98+
ForEach { (Get-Content $_.PSPath | ForEach { ($_ -replace '([from|import])\s?[''"](igniteui-[react|dockmanager].*)[''"]', '$1 "@infragistics/$2"') }) | `
99+
Set-Content $_.PSPath }
59100
60101
- task: PowerShell@2
61102
displayName: 'npm install igniteui-dockmanager (licensed)'
103+
enabled: false # Disable this extra step because we are already going for the licensed version in the package.json - 2 steps above
62104
inputs:
63105
targetType: 'inline'
64106
# We are using a PowerShell script because the npm step doesn't allow for explicit use of variable expansion which is what we use here.

browser/.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module.exports = {
2424
"no-undef": "off",
2525
"camelcase": "off",
2626
"no-unused-vars": "off",
27+
"no-extra-semi": "off",
2728
"no-extend-native": "off",
2829
"no-throw-literal": "off",
2930
"no-useless-concat": "off",
@@ -56,6 +57,7 @@ module.exports = {
5657
"no-unused-vars": "off",
5758
"no-extend-native": "off",
5859
"no-throw-literal": "off",
60+
"no-extra-semi": "off",
5961
"no-useless-concat": "off",
6062
"no-mixed-operators": "off",
6163
"no-prototype-builtins": "off",
@@ -77,4 +79,4 @@ module.exports = {
7779
}
7880
}
7981
]
80-
};
82+
};

browser/config-overrides.js

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,61 @@
1+
const path = require('path');
2+
let pathsConfig = require("./tsconfig.paths.json");
3+
const {alias, configPaths, expandResolveAlias, expandRulesInclude, expandPluginsScope} = require('react-app-rewire-alias')
4+
5+
//this works around the fact that alias doesn't support multiple paths
6+
function aliasMultiple(aliasMap) {
7+
const alias0 = Object.keys(aliasMap).reduce( (a,i) => {
8+
a[i] = aliasMap[i][0]
9+
return a
10+
}, {});
11+
const alias1 = Object.keys(aliasMap).reduce( (a,i) => {
12+
a[i] = aliasMap[i][1]
13+
return a
14+
}, {});
15+
return function(config) {
16+
expandResolveAlias(config.resolve, aliasMap);
17+
expandRulesInclude(config.module.rules, Object.values(alias0));
18+
expandRulesInclude(config.module.rules, Object.values(alias1));
19+
expandPluginsScope(config.resolve.plugins, Object.values(alias0), Object.values(alias0));
20+
expandPluginsScope(config.resolve.plugins, Object.values(alias1), Object.values(alias1));
21+
return config;
22+
}
23+
}
24+
125
/* eslint-disable no-undef */
226
/* eslint-disable @typescript-eslint/no-var-requires */
327
module.exports = function override(config, env) {
428
console.log("config-overrides.js started");
529
const paths = require('./node_modules/react-scripts/config/paths');
630
// console.log("config-overrides.js paths");
7-
// console.log(paths);
31+
console.log(paths);
32+
33+
console.log(pathsConfig);
34+
let tspaths = pathsConfig.compilerOptions.paths;
35+
tspaths = Object.keys(tspaths).reduce((a, p) => {
36+
let target = tspaths[p];
37+
a[p.replace(/\/\*$/,'')] = Array.isArray(target) ? target.map((t) => t.replace(/\/\*$/,'')) : target.replace(/\/\*$/,'');
38+
return a;
39+
}, {});
40+
console.log(tspaths);
41+
tspaths = Object.keys(tspaths).reduce((a, p) => {
42+
let target = tspaths[p];
43+
a[p.replace(/\/\*$/,'')] = Array.isArray(target) ? target.map((t) => path.resolve(__dirname, t)) : path.resolve(__dirname, target);
44+
45+
return a;
46+
}, {});
47+
console.log(tspaths);
48+
49+
// config.resolve = {
50+
// ...config.resolve,
51+
// alias: {
52+
// ...config.alias,
53+
// ...tspaths
54+
// },
55+
// };
56+
57+
//console.log(config.resolve);
58+
859
let rules = config.module.rules;
960
//let paths = config._paths;
1061
let oneOf = null; // rules[1].oneOf;
@@ -112,5 +163,10 @@ module.exports = function override(config, env) {
112163
}
113164

114165
console.log("\n\n\n\n");
115-
return config;
166+
//let newConfig = alias(configPathsMultiple('./tsconfig.paths.json'))(config);
167+
//console.log(newConfig);
168+
169+
let newConfig = aliasMultiple(tspaths)(config);
170+
console.log(newConfig);
171+
return newConfig;
116172
}

browser/gulpfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ exports.updateBrowser = updateBrowser = gulp.series(
4747
sb.updateVersion,
4848
sb.getSamples,
4949
sb.copySamples,
50-
sb.updateCodeViewer
50+
sb.updateCodeViewer,
51+
sb.updateReadme,
5152
// sb.copyPackageJson,
5253
);
5354

0 commit comments

Comments
 (0)