Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci:force] Migrate to NG15 #8922

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ca04d19
[CI:FORCE] - testing changes to migrate to NG15
VitoAlbano Sep 21, 2023
b361d44
Fixed wrong path
VitoAlbano Sep 21, 2023
7127053
Enabled unit test now start fixing them
VitoAlbano Sep 24, 2023
b838df4
Migrating mataerial
VitoAlbano Sep 26, 2023
ea4f73a
Fixed some wrong import and removed floatLabel never
VitoAlbano Sep 26, 2023
7c93919
Migration to NG15 - stabilising unit test
VitoAlbano Sep 27, 2023
744e24e
fixed unit tests for content-services
tomaszhanaj Sep 27, 2023
d4b405c
Fixed extension-loader tests
VitoAlbano Sep 27, 2023
be02533
Fixed build for all the libs'
VitoAlbano Sep 27, 2023
64b39ed
Fixed style and spellcheck? i hope so
VitoAlbano Sep 27, 2023
bfe0c82
Fixing unit test for core
VitoAlbano Sep 28, 2023
e1fb787
Fixed unit test for core
VitoAlbano Sep 28, 2023
63982d3
[ci:force] - fixed and skipped process service cloud test
VitoAlbano Sep 29, 2023
cdc0638
[ci:force] - rebased
VitoAlbano Sep 29, 2023
e550a89
[ci:force] - fixed lint errors and wrong imports
VitoAlbano Sep 29, 2023
5566d98
fixed unit tests for content-services v2
tomaszhanaj Sep 29, 2023
58be1db
fixed theme, typography related issues
tomaszhanaj Sep 29, 2023
881b813
Lint fixing
VitoAlbano Sep 29, 2023
b4d9477
[ci:force] - again again
VitoAlbano Sep 29, 2023
2490427
fix for storybook builds
tomaszhanaj Sep 29, 2023
9d4a390
[ci:force] - do not stop belivin
VitoAlbano Sep 29, 2023
356ac46
fixed unit tests for radio-button-widget
tomaszhanaj Sep 29, 2023
4d4c289
Fixed import problem and reduced coverage for old process package
VitoAlbano Oct 2, 2023
6ea02c9
[ci:force] excluded test'
VitoAlbano Oct 2, 2023
e5ccc50
Upgraded affected command
VitoAlbano Oct 2, 2023
af135c5
Fixed some locator and removed chart.js from karma config
VitoAlbano Oct 3, 2023
6042f3b
Fixed import for content-node-share
VitoAlbano Oct 3, 2023
1999a2b
Fixed migration for storybook
VitoAlbano Oct 10, 2023
0bec684
Fixed failing unit test for process after rebase
VitoAlbano Oct 10, 2023
d8c3d97
Migration - rebased and fixed unit test after the removal of moment
VitoAlbano Oct 20, 2023
61cbd61
Migration - start fixing e2e
VitoAlbano Oct 24, 2023
8a2b4f4
Fixed project.json wrongly destroyed after rebase
VitoAlbano Oct 24, 2023
fd9f82c
Missed one <sad-face>
VitoAlbano Oct 24, 2023
84136ee
It was missing here as well
VitoAlbano Oct 24, 2023
87e9396
rebased
VitoAlbano Oct 25, 2023
4adcf67
Dramatic rebase - check
VitoAlbano Nov 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 7 additions & 10 deletions .browserslistrc → .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

# This file is used by the build system to adjust CSS and JS output to support the specified browsers below
# For additional information regarding the format and rule options, please see
# <https://github.com/browserslist/browserslist#queries>
# For the full list of supported browsers by the Angular framework, please see
# <https://angular.io/guide/browser-support>
# You can see what browsers were selected by your queries by running
# npx browserslist
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
Expand Down
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
root: true,

ignorePatterns: [
'projects/**/*',
'**/node_modules/**/*',
Expand All @@ -10,6 +11,7 @@ module.exports = {
'**/scripts',
'**/docs'
],

plugins: ['@nrwl/nx'],
overrides: [
{
Expand Down Expand Up @@ -184,5 +186,7 @@ module.exports = {
extends: ['plugin:@angular-eslint/template/recommended'],
rules: {}
}
]
],

extends: ['plugin:storybook/recommended']
};
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
description: 'devel'
required: false
type: string
default: false
default: 'false'
cron-run:
description: 'disables jobs which should not run when cron runs e2es'
required: false
Expand Down
16 changes: 12 additions & 4 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
module.exports = {
framework: {
name: '@storybook/angular',
options: {}
},

staticDirs: [{ from: '../../../demo-shell/src/app.config.json', to: 'app.config.json' }],

docs: {
autodocs: true
},

stories: [],
addons: ['@storybook/addon-essentials'],
framework: '@storybook/angular',
staticDirs: [ { from: '../../../demo-shell/src/app.config.json', to: 'app.config.json' } ],
core: { builder: 'webpack5' }
addons:[],
};
12 changes: 11 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
}
],
"styles": [
"demo-shell/src/assets/fonts/muli/muli.css",
"demo-shell/src/styles.scss",
"demo-shell/src/custom-style-dev.scss",
"node_modules/cropperjs/dist/cropper.min.css",
Expand All @@ -116,7 +117,8 @@
"scripts": [
"node_modules/pdfjs-dist/build/pdf.js",
"node_modules/pdfjs-dist/web/pdf_viewer.js",
"node_modules/raphael/raphael.min.js"
"node_modules/raphael/raphael.min.js",
"node_modules/moment/min/moment.min.js"
],
"vendorChunk": true,
"extractLicenses": false,
Expand Down Expand Up @@ -305,6 +307,7 @@
"configDir": "lib/core/.storybook",
"compodoc": false,
"styles": [
"demo-shell/src/assets/fonts/muli/muli.css",
"demo-shell/src/styles.scss",
"demo-shell/src/custom-style-dev.scss",
"node_modules/cropperjs/dist/cropper.min.css",
Expand All @@ -330,6 +333,7 @@
"outputDir": "dist/storybook/core",
"compodoc": false,
"styles": [
"demo-shell/src/assets/fonts/muli/muli.css",
"demo-shell/src/styles.scss",
"demo-shell/src/custom-style-dev.scss",
"node_modules/cropperjs/dist/cropper.min.css",
Expand Down Expand Up @@ -451,6 +455,7 @@
"configDir": "lib/content-services/.storybook",
"compodoc": false,
"styles": [
"demo-shell/src/assets/fonts/muli/muli.css",
"demo-shell/src/styles.scss",
"demo-shell/src/custom-style-dev.scss",
"node_modules/cropperjs/dist/cropper.min.css",
Expand All @@ -476,6 +481,7 @@
"outputDir": "dist/storybook/content-services",
"compodoc": false,
"styles": [
"demo-shell/src/assets/fonts/muli/muli.css",
"demo-shell/src/styles.scss",
"demo-shell/src/custom-style-dev.scss",
"node_modules/cropperjs/dist/cropper.min.css",
Expand Down Expand Up @@ -643,6 +649,7 @@
"configDir": "lib/process-services-cloud/.storybook",
"compodoc": false,
"styles": [
"demo-shell/src/assets/fonts/muli/muli.css",
"demo-shell/src/styles.scss",
"demo-shell/src/custom-style-dev.scss",
"node_modules/cropperjs/dist/cropper.min.css",
Expand All @@ -668,6 +675,7 @@
"outputDir": "dist/storybook/process-services-cloud",
"compodoc": false,
"styles": [
"demo-shell/src/assets/fonts/muli/muli.css",
"demo-shell/src/styles.scss",
"demo-shell/src/custom-style-dev.scss",
"node_modules/cropperjs/dist/cropper.min.css",
Expand Down Expand Up @@ -1110,6 +1118,7 @@
]
},
"styles": [
"demo-shell/src/assets/fonts/muli/muli.css",
"demo-shell/src/styles.scss",
"demo-shell/src/custom-style-dev.scss",
"node_modules/cropperjs/dist/cropper.min.css",
Expand All @@ -1130,6 +1139,7 @@
"outputDir": "dist/storybook/stories",
"compodoc": false,
"styles": [
"demo-shell/src/assets/fonts/muli/muli.css",
"demo-shell/src/styles.scss",
"demo-shell/src/custom-style-dev.scss",
"node_modules/cropperjs/dist/cropper.min.css",
Expand Down
86 changes: 42 additions & 44 deletions decorate-angular-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,75 +21,73 @@
* - Delete and reinstall your node_modules
*/

const fs = require("fs");
const os = require("os");
const cp = require("child_process");
const isWindows = os.platform() === "win32";
const { output } = require("@nrwl/workspace");
const fs = require('fs');
const os = require('os');
const cp = require('child_process');
const isWindows = os.platform() === 'win32';
const { output } = require('@nx/workspace');

/**
* Paths to files being patched
*/
const angularCLIInitPath = "node_modules/@angular/cli/lib/cli/index.js";
const angularCLIInitPath = 'node_modules/@angular/cli/lib/cli/index.js';

/**
* Patch index.js to warn you if you invoke the undecorated Angular CLI.
*/
function patchAngularCLI(initPath) {
const angularCLIInit = fs.readFileSync(initPath, "utf-8").toString();
const angularCLIInit = fs.readFileSync(initPath, 'utf-8').toString();

if (!angularCLIInit.includes("NX_CLI_SET")) {
fs.writeFileSync(
initPath,
`
if (!angularCLIInit.includes('NX_CLI_SET')) {
fs.writeFileSync(
initPath,
`
if (!process.env['NX_CLI_SET']) {
const { output } = require('@nrwl/workspace');
const { output } = require('@nx/workspace');
output.warn({ title: 'The Angular CLI was invoked instead of the Nx CLI. Use "npx ng [command]" or "nx [command]" instead.' });
}
${angularCLIInit}
`
);
}
);
}
}

/**
* Symlink of ng to nx, so you can keep using `ng build/test/lint` and still
* invoke the Nx CLI and get the benefits of computation caching.
*/
function symlinkNgCLItoNxCLI() {
try {
const ngPath = "./node_modules/.bin/ng";
const nxPath = "./node_modules/.bin/nx";
if (isWindows) {
/**
* This is the most reliable way to create symlink-like behavior on Windows.
* Such that it works in all shells and works with npx.
*/
["", ".cmd", ".ps1"].forEach(ext => {
fs.writeFileSync(ngPath + ext, fs.readFileSync(nxPath + ext));
});
} else {
// If unix-based, symlink
cp.execSync(`ln -sf ./nx ${ngPath}`);
try {
const ngPath = './node_modules/.bin/ng';
const nxPath = './node_modules/.bin/nx';
if (isWindows) {
/**
* This is the most reliable way to create symlink-like behavior on Windows.
* Such that it works in all shells and works with npx.
*/
['', '.cmd', '.ps1'].forEach((ext) => {
fs.writeFileSync(ngPath + ext, fs.readFileSync(nxPath + ext));
});
} else {
// If unix-based, symlink
cp.execSync(`ln -sf ./nx ${ngPath}`);
}
} catch (e) {
output.error({
title: 'Unable to create a symlink from the Angular CLI to the Nx CLI:' + e.message
});
throw e;
}
} catch (e) {
output.error({
title:
"Unable to create a symlink from the Angular CLI to the Nx CLI:" +
e.message
});
throw e;
}
}

try {
symlinkNgCLItoNxCLI();
patchAngularCLI(angularCLIInitPath);
output.log({
title: "Angular CLI has been decorated to enable computation caching."
});
symlinkNgCLItoNxCLI();
patchAngularCLI(angularCLIInitPath);
output.log({
title: 'Angular CLI has been decorated to enable computation caching.'
});
} catch (e) {
output.error({
title: "Decoration of the Angular CLI did not complete successfully"
});
output.error({
title: 'Decoration of the Angular CLI did not complete successfully'
});
}
Loading
Loading