Skip to content

Commit 5013676

Browse files
authored
Support Angular 19 (#1082)
* feat: angular 19 * feat: angular cdk upgrade * fix: sass refactor * fix: update peer dependencies * fix: CHANGELOG * feat: rename color files for consistency * feat: new color files * feat: version bump * feat: Indeterminate Checkbox (#1083) * fix: position of check mark when checked set to true * fix: upgrade ng2-file-upload * feat: migrate to yarn * fix: moment issues * fix: ngx-time * fix: format and lint * fix: tests
1 parent 2721921 commit 5013676

File tree

317 files changed

+18859
-27989
lines changed

Some content is hidden

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

317 files changed

+18859
-27989
lines changed

.eslintrc.js

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,46 @@
1-
21
module.exports = {
3-
'root': true,
2+
root: true,
43

5-
ignorePatterns: [
6-
'projects/**/*',
7-
'dist/**/*',
8-
'cypress/**/*'
9-
],
4+
ignorePatterns: ['dist/**/*', 'cypress/**/*'],
105

11-
extends: [
12-
'@swimlane',
13-
'prettier'
14-
],
6+
extends: ['@swimlane', 'prettier'],
157

16-
rules: {
17-
},
8+
rules: {},
189

1910
overrides: [
2011
{
21-
files: [
22-
'*.ts'
23-
],
24-
parser: '@typescript-eslint/parser',
12+
files: ['*.ts'],
2513
parserOptions: {
26-
project: [
27-
'tsconfig.json'
28-
],
29-
createDefaultProgram: true
14+
allowAutomaticSingleRunInference: true,
15+
project: ['tsconfig.json', 'tsconfig.app.json', 'tsconfig.spec.json', 'cypress/tsconfig.json'],
16+
tsconfigRootDir: __dirname
3017
},
3118
extends: [
3219
'@swimlane/eslint-config/typescript',
3320
'plugin:@angular-eslint/recommended',
3421
'plugin:@angular-eslint/template/process-inline-templates',
22+
'plugin:@typescript-eslint/recommended',
3523
'prettier'
3624
],
3725
rules: {
3826
// off for demo packages
3927
'no-console': 'off',
40-
28+
4129
// fix these in this repo, off for now
4230
'guard-for-in': 'off',
43-
'@angular-eslint/no-host-metadata-property': 'off',
4431
'@angular-eslint/no-output-native': 'off',
4532
'@angular-eslint/component-class-suffix': 'off',
4633
'@angular-eslint/directive-class-suffix': 'off',
4734
'@angular-eslint/no-output-on-prefix': 'off',
35+
'@angular-eslint/prefer-standalone': 'off',
4836
'@typescript-eslint/explicit-module-boundary-types': 'off',
49-
'@typescript-eslint/no-explicit-any': 'off',
37+
'@typescript-eslint/no-explicit-any': 'off'
5038
}
5139
},
5240
{
53-
'files': [
54-
'*.html'
55-
],
56-
'extends': [
57-
'plugin:@angular-eslint/template/recommended'
58-
],
59-
'rules': {}
41+
files: ['*.html'],
42+
extends: ['plugin:@angular-eslint/template/recommended'],
43+
rules: {}
6044
}
6145
]
62-
};
46+
};

.github/workflows/test_and_deploy.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
name: Build, Test, and Deploy
22

3-
env:
4-
NODE_LATEST: 18.x
5-
NODE_OPTIONS: --max_old_space_size=6144
6-
73
on: [push]
8-
94
jobs:
105
build:
116
runs-on: ubuntu-latest
127

138
steps:
149
- name: Checkout
15-
uses: actions/checkout@v3
16-
- name: Use Node.js ${{ env.NODE_LATEST }}
10+
uses: actions/checkout@v4.2.0
11+
12+
- name: Setup Node.js
1713
uses: actions/setup-node@v3
1814
with:
19-
node-version: ${{ env.NODE_LATEST }}
15+
node-version: 20.17.0
2016

21-
- name: Install
22-
uses: bahmutov/npm-install@v1
23-
with:
24-
install-command: npm ci --legacy-peer-deps
17+
- name: Enable Corepack
18+
run: corepack enable
19+
20+
- name: Install Yarn
21+
run: corepack prepare yarn@4.5.1 --activate
22+
23+
- name: Install dependencies
24+
run: yarn install --immutable
2525

2626
- name: Build
2727
run: |
28-
npm run build
28+
yarn build
2929
env:
3030
CI: true
3131

3232
- name: Test
3333
run: |
34-
npm run test --if-present
34+
yarn test
3535
env:
3636
CI: true
3737

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ cypress/screenshots
4545

4646
.angular/*
4747
.nx/*
48+
.yarn/*

.yarnrc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
checksumBehavior: update
2+
3+
defaultSemverRangePrefix: ''
4+
5+
nodeLinker: node-modules

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,26 @@ Component & Style Library for Angular by Swimlane.
1111

1212
## Building ngx-ui
1313

14-
Run `npm run build:lib` to build ngx-ui. This must be done prior to building the demo.
14+
Run `yarn build:lib` to build ngx-ui. This must be done prior to building the demo.
1515

1616
## Development server
1717

18-
Run `npm run start` to serve the demo at `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
18+
Run `yarn start` to serve the demo at `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
1919

2020
## Building
2121

22-
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
22+
Run `yarn build` to build the project. The build artifacts will be stored in the `dist/` directory.
2323

2424
## Running tests
2525

26-
- Run `npm run test` to execute unit tests
27-
- Run `ng cypress` to execute the end-to-end tests via Cypress.
26+
- Run `yarn test` to execute the linter, prettier check, unit and end-to-end tests.
2827

2928
## Release
3029

3130
- Checkout master (`git checkout master`)
3231
- Pull master (`git pull`)
3332
- Refresh node modules (`npm ci`)
34-
- Run tests (`npm test`)
33+
- Run tests (`yarn test`)
3534
- Examine log to determine next version (X.Y.Z)
3635
- Run `git checkout -b release/X.Y.Z`
3736
- Update version in `projects/swimlane/ngx-ui/package.json`.

angular.json

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,33 @@
2020
"customWebpackConfig": {
2121
"path": "./extra-webpack.config.js"
2222
},
23-
"allowedCommonJsDependencies": ["moment-timezone", "mousetrap", "ajv", "codemirror"],
23+
"allowedCommonJsDependencies": [
24+
"moment-timezone",
25+
"mousetrap",
26+
"ajv",
27+
"codemirror"
28+
],
2429
"aot": true,
2530
"preserveSymlinks": true,
2631
"outputPath": "dist/ngx-ui",
2732
"index": "src/index.html",
2833
"main": "src/main.ts",
2934
"polyfills": "src/polyfills.ts",
3035
"tsConfig": "src/tsconfig.app.json",
31-
"assets": ["src/favicon.ico", "src/favicon-16x16.png", "src/assets", "src/.nojekyll"],
32-
"styles": ["src/styles.scss"],
36+
"assets": [
37+
"src/favicon.ico",
38+
"src/favicon-16x16.png",
39+
"src/assets",
40+
"src/.nojekyll"
41+
],
42+
"styles": [
43+
"src/styles.scss"
44+
],
3345
"stylePreprocessorOptions": {
34-
"includePaths": ["dist/swimlane/ngx-ui/lib/styles", "dist/swimlane/ngx-ui/lib/assets"]
46+
"includePaths": [
47+
"dist/swimlane/ngx-ui/lib/styles",
48+
"dist/swimlane/ngx-ui/lib/assets"
49+
]
3550
},
3651
"scripts": [],
3752
"sourceMap": {
@@ -74,11 +89,11 @@
7489
"serve": {
7590
"builder": "@angular-builders/custom-webpack:dev-server",
7691
"options": {
77-
"browserTarget": "ngx-ui:build"
92+
"buildTarget": "ngx-ui:build"
7893
},
7994
"configurations": {
8095
"production": {
81-
"browserTarget": "ngx-ui:build:production"
96+
"buildTarget": "ngx-ui:build:production"
8297
}
8398
}
8499
},
@@ -89,24 +104,29 @@
89104
}
90105
},
91106
"test": {
92-
"builder": "@angular-builders/custom-webpack:karma",
107+
"builder": "@angular-devkit/build-angular:web-test-runner",
93108
"options": {
94-
"customWebpackConfig": {
95-
"path": "./extra-webpack.config.js"
96-
},
97109
"main": "src/test.ts",
98110
"polyfills": "src/polyfills.ts",
99111
"tsConfig": "src/tsconfig.spec.json",
100-
"karmaConfig": "src/karma.conf.js",
101-
"styles": ["src/styles.scss"],
112+
"styles": [
113+
"src/styles.scss"
114+
],
102115
"scripts": [],
103-
"assets": ["src/favicon.ico", "src/assets"]
116+
"assets": [
117+
"src/favicon.ico",
118+
"src/assets"
119+
]
104120
}
105121
},
106122
"lint": {
107123
"builder": "@angular-eslint/builder:lint",
108124
"options": {
109-
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html", "cypress/**/*.js"]
125+
"lintFilePatterns": [
126+
"src/**/*.ts",
127+
"src/**/*.html",
128+
"cypress/**/*.js"
129+
]
110130
}
111131
}
112132
}
@@ -179,7 +199,10 @@
179199
"lint": {
180200
"builder": "@angular-eslint/builder:lint",
181201
"options": {
182-
"lintFilePatterns": ["projects/swimlane/ngx-ui/**/*.ts", "projects/swimlane/ngx-ui/**/*.html"]
202+
"lintFilePatterns": [
203+
"projects/swimlane/ngx-ui/**/*.ts",
204+
"projects/swimlane/ngx-ui/**/*.html"
205+
]
183206
}
184207
}
185208
}
@@ -188,4 +211,4 @@
188211
"cli": {
189212
"analytics": false
190213
}
191-
}
214+
}

cypress/e2e/forms/checkbox.cy.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ describe('Checkbox', () => {
1515
beforeEach(() => {
1616
cy.get('#section-1').as('SUT');
1717
cy.getByName('chk1').as('CUT');
18+
cy.getByName('chk6').as('INDETERMINATE_CUT');
1819
});
1920

2021
afterEach(() => {
@@ -46,6 +47,13 @@ describe('Checkbox', () => {
4647
cy.get('@CUT').ngxGetValue().should('equal', true);
4748
});
4849

50+
it('can uncheck from indeterminate state', () => {
51+
cy.get('@INDETERMINATE_CUT').click();
52+
cy.get('@INDETERMINATE_CUT').ngxGetValue().should('equal', false);
53+
cy.get('@INDETERMINATE_CUT').click();
54+
cy.get('@INDETERMINATE_CUT').ngxGetValue().should('equal', true);
55+
});
56+
4957
it('is keyboard accessible', () => {
5058
cy.get('@SUT').find('h1').contains('Demo').realClick();
5159

0 commit comments

Comments
 (0)