Skip to content

Commit b7c6ea8

Browse files
authored
WEB-201 Merge angular-update-18 into dev to upgrade Angular from v17 to v18 (#2513)
1 parent 0a8aa1d commit b7c6ea8

File tree

735 files changed

+8204
-20822
lines changed

Some content is hidden

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

735 files changed

+8204
-20822
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,44 @@ name: build-run
44
on:
55
# Triggers the workflow on push or pull request events for specific branches
66
push:
7-
branches: [main, dev, angular-update-17-2]
7+
branches: [main, dev, angular-update-18]
88
pull_request:
9-
branches: [main, dev, angular-update-17-2]
9+
branches: [main, dev, angular-update-18]
1010

1111
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1212
jobs:
1313
# This workflow contains a single job called "build"
1414
build:
1515
# The type of runner that the job will run on
16-
name: Run Lint and Deploy
16+
name: Run Lint, Build and Deploy
1717
runs-on: ubuntu-latest
1818

1919
# Steps represent a sequence of tasks that will be executed as part of the job
2020
steps:
21-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22-
- uses: actions/checkout@v4
21+
- name: Checkout code
22+
uses: actions/checkout@v4
2323

2424
- name: Use Node.js 22
25-
uses: actions/setup-node@v1
25+
uses: actions/setup-node@v3
2626
with:
2727
# no support for lts as of now with github actions.
2828
# issue link : https://github.com/actions/setup-node/issues/26
2929
# lts/gallium node v19.7.0 (npm v9.5.0)
3030
node-version: '22.9.0'
31+
32+
- name: Remove node_modules
33+
run: rm -rf node_modules
34+
3135
- name: Run CI
3236
run: npm ci
3337

38+
- name: Fallback – Clean install with regenerated lockfile
39+
if: failure()
40+
run: |
41+
echo "npm ci failed — regenerating lockfile and retrying"
42+
rm -rf node_modules package-lock.json
43+
npm install
44+
3445
- name: Run eslint
3546
run: npx eslint .
3647

@@ -40,10 +51,10 @@ jobs:
4051
- name: Run prettier
4152
run: npx prettier . --check
4253

43-
- name: HTMLHint
54+
- name: Run HTMLHint
4455
run: npx htmlhint "src" --config .htmlhintrc
4556

46-
- name: Run build
57+
- name: Run production build
4758
run: npm run build:prod
4859

4960
- name: Deploy to github pages

angular.json

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@
1818
},
1919
"architect": {
2020
"build": {
21-
"builder": "@angular-devkit/build-angular:browser",
21+
"builder": "@angular-devkit/build-angular:application",
2222
"options": {
2323
"aot": true,
24-
"outputPath": "dist/web-app",
24+
"outputPath": {
25+
"base": "dist/web-app"
26+
},
2527
"index": "src/index.html",
26-
"main": "src/main.ts",
2728
"tsConfig": "src/tsconfig.app.json",
28-
"polyfills": "src/polyfills.ts",
29+
"polyfills": [
30+
"src/polyfills.ts",
31+
"@angular/localize/init"
32+
],
2933
"assets": [
3034
"src/favicon.ico",
3135
"src/robots.txt",
@@ -47,7 +51,13 @@
4751
"lodash",
4852
"@ckeditor/ckeditor5-build-classic",
4953
"moment"
50-
]
54+
],
55+
"browser": "src/main.ts",
56+
"stylePreprocessorOptions": {
57+
"includePaths": [
58+
"src"
59+
]
60+
}
5161
},
5262
"configurations": {
5363
"production": {
@@ -74,18 +84,14 @@
7484
"namedChunks": true,
7585
"outputHashing": "all",
7686
"extractLicenses": true,
77-
"aot": true,
78-
"buildOptimizer": true,
79-
"vendorChunk": false
87+
"aot": true
8088
},
8189
"development": {
8290
"optimization": false,
8391
"sourceMap": true,
8492
"namedChunks": true,
8593
"extractLicenses": true,
86-
"aot": true,
87-
"buildOptimizer": true,
88-
"vendorChunk": false
94+
"aot": true
8995
}
9096
},
9197
"defaultConfiguration": "production"
@@ -112,28 +118,9 @@
112118
}
113119
},
114120
"test": {
115-
"builder": "@angular-devkit/build-angular:karma",
121+
"builder": "@angular-builders/jest:run",
116122
"options": {
117-
"browsers": "ChromeHeadless",
118-
"main": "src/test.ts",
119-
"karmaConfig": "src/karma.conf.ts",
120-
"polyfills": "src/polyfills.ts",
121-
"tsConfig": "src/tsconfig.spec.json",
122-
"scripts": [],
123-
"styles": [
124-
"src/main.scss",
125-
{
126-
"inject": false,
127-
"input": "src/theme/mifosx-theme.scss",
128-
"bundleName": "mifosx-theme"
129-
}
130-
],
131-
"assets": [
132-
"src/favicon.ico",
133-
"src/robots.txt",
134-
"src/manifest.json",
135-
"src/assets"
136-
]
123+
"configPath": "./jest.config.ts"
137124
}
138125
},
139126
"lint": {

jest.config.ts

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
/**
2+
* For a detailed explanation regarding each configuration property, visit:
3+
* https://jestjs.io/docs/configuration
4+
*/
5+
6+
import type { Config } from 'jest';
7+
8+
const config: Config = {
9+
// All imported modules in your tests should be mocked automatically
10+
// automock: false,
11+
12+
// Stop running tests after `n` failures
13+
// bail: 0,
14+
15+
// The directory where Jest should store its cached dependency information
16+
// cacheDirectory: "C:\\Users\\felix\\AppData\\Local\\Temp\\jest",
17+
18+
// Automatically clear mock calls, instances, contexts and results before every test
19+
clearMocks: true,
20+
21+
// Indicates whether the coverage information should be collected while executing the test
22+
collectCoverage: true,
23+
24+
// An array of glob patterns indicating a set of files for which coverage information should be collected
25+
// collectCoverageFrom: undefined,
26+
27+
// The directory where Jest should output its coverage files
28+
coverageDirectory: 'coverage',
29+
30+
// An array of regexp pattern strings used to skip coverage collection
31+
// coveragePathIgnorePatterns: [
32+
// "\\\\node_modules\\\\"
33+
// ],
34+
35+
// Indicates which provider should be used to instrument code for coverage
36+
coverageProvider: 'v8',
37+
38+
// A list of reporter names that Jest uses when writing coverage reports
39+
// coverageReporters: [
40+
// "json",
41+
// "text",
42+
// "lcov",
43+
// "clover"
44+
// ],
45+
46+
// An object that configures minimum threshold enforcement for coverage results
47+
// coverageThreshold: undefined,
48+
49+
// A path to a custom dependency extractor
50+
// dependencyExtractor: undefined,
51+
52+
// Make calling deprecated APIs throw helpful error messages
53+
// errorOnDeprecated: false,
54+
55+
// The default configuration for fake timers
56+
// fakeTimers: {
57+
// "enableGlobally": false
58+
// },
59+
60+
// Force coverage collection from ignored files using an array of glob patterns
61+
// forceCoverageMatch: [],
62+
63+
// A path to a module which exports an async function that is triggered once before all test suites
64+
// globalSetup: undefined,
65+
66+
// A path to a module which exports an async function that is triggered once after all test suites
67+
// globalTeardown: undefined,
68+
69+
// A set of global variables that need to be available in all test environments
70+
// globals: {},
71+
72+
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
73+
// maxWorkers: "50%",
74+
75+
// An array of directory names to be searched recursively up from the requiring module's location
76+
// moduleDirectories: [
77+
// "node_modules"
78+
// ],
79+
80+
// An array of file extensions your modules use
81+
// moduleFileExtensions: [
82+
// "js",
83+
// "mjs",
84+
// "cjs",
85+
// "jsx",
86+
// "ts",
87+
// "tsx",
88+
// "json",
89+
// "node"
90+
// ],
91+
92+
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
93+
// moduleNameMapper: {},
94+
95+
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
96+
// modulePathIgnorePatterns: [],
97+
98+
// Activates notifications for test results
99+
// notify: false,
100+
101+
// An enum that specifies notification mode. Requires { notify: true }
102+
// notifyMode: "failure-change",
103+
104+
// A preset that is used as a base for Jest's configuration
105+
// preset: undefined,
106+
107+
// Run tests from one or more projects
108+
// projects: undefined,
109+
110+
// Use this configuration option to add custom reporters to Jest
111+
// reporters: undefined,
112+
113+
// Automatically reset mock state before every test
114+
// resetMocks: false,
115+
116+
// Reset the module registry before running each individual test
117+
// resetModules: false,
118+
119+
// A path to a custom resolver
120+
// resolver: undefined,
121+
122+
// Automatically restore mock state and implementation before every test
123+
// restoreMocks: false,
124+
125+
// The root directory that Jest should scan for tests and modules within
126+
// rootDir: undefined,
127+
128+
// A list of paths to directories that Jest should use to search for files in
129+
// roots: [
130+
// "<rootDir>"
131+
// ],
132+
133+
// Allows you to use a custom runner instead of Jest's default test runner
134+
// runner: "jest-runner",
135+
136+
// The paths to modules that run some code to configure or set up the testing environment before each test
137+
// setupFiles: [],
138+
139+
// A list of paths to modules that run some code to configure or set up the testing framework before each test
140+
// setupFilesAfterEnv: [],
141+
142+
// The number of seconds after which a test is considered as slow and reported as such in the results.
143+
// slowTestThreshold: 5,
144+
145+
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
146+
// snapshotSerializers: [],
147+
148+
// The test environment that will be used for testing
149+
testEnvironment: 'jsdom'
150+
151+
// Options that will be passed to the testEnvironment
152+
// testEnvironmentOptions: {},
153+
154+
// Adds a location field to test results
155+
// testLocationInResults: false,
156+
157+
// The glob patterns Jest uses to detect test files
158+
// testMatch: [
159+
// "**/__tests__/**/*.[jt]s?(x)",
160+
// "**/?(*.)+(spec|test).[tj]s?(x)"
161+
// ],
162+
163+
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
164+
// testPathIgnorePatterns: [
165+
// "\\\\node_modules\\\\"
166+
// ],
167+
168+
// The regexp pattern or array of patterns that Jest uses to detect test files
169+
// testRegex: [],
170+
171+
// This option allows the use of a custom results processor
172+
// testResultsProcessor: undefined,
173+
174+
// This option allows use of a custom test runner
175+
// testRunner: "jest-circus/runner",
176+
177+
// A map from regular expressions to paths to transformers
178+
// transform: undefined,
179+
180+
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
181+
// transformIgnorePatterns: [
182+
// "\\\\node_modules\\\\",
183+
// "\\.pnp\\.[^\\\\]+$"
184+
// ],
185+
186+
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
187+
// unmockedModulePathPatterns: undefined,
188+
189+
// Indicates whether each individual test should be reported during the run
190+
// verbose: undefined,
191+
192+
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
193+
// watchPathIgnorePatterns: [],
194+
195+
// Whether to use watchman for file crawling
196+
// watchman: true,
197+
};
198+
199+
export default config;

0 commit comments

Comments
 (0)