Skip to content

Commit 566d96b

Browse files
committed
chore: bump angular to v21
1 parent 529cec6 commit 566d96b

27 files changed

+7502
-1247
lines changed

.github/workflows/ci.yml

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,51 @@ jobs:
99
- name: checkout
1010
uses: actions/checkout@master
1111

12-
- uses: borales/actions-yarn@v4
12+
- uses: pnpm/action-setup@v4
1313
with:
14-
cmd: install
14+
run_install: false
15+
16+
- name: Use Node.js
17+
uses: actions/setup-node@v6
18+
with:
19+
node-version-file: '.nvmrc'
20+
cache: 'pnpm'
21+
22+
- name: Install dependencies
23+
run: pnpm install
1524

1625
- name: run
1726
run: |
18-
yarn run build
27+
pnpm run build
1928
2029
test:
2130
runs-on: ubuntu-latest
2231
steps:
2332
- name: checkout
2433
uses: actions/checkout@master
2534

26-
- uses: borales/actions-yarn@v4
35+
- uses: pnpm/action-setup@v4
2736
with:
28-
cmd: install
37+
run_install: false
38+
39+
- name: Use Node.js
40+
uses: actions/setup-node@v6
41+
with:
42+
node-version-file: '.nvmrc'
43+
cache: 'pnpm'
44+
45+
- name: Install dependencies
46+
run: pnpm install
2947

3048
- name: run
31-
run: yarn run test
49+
run: pnpm run test
3250

3351
- uses: codecov/codecov-action@v5
3452
name: upload
3553
with:
3654
token: ${{ secrets.CODECOV_TOKEN }}
3755
flags: unittests
38-
files: ./coverage/cobertura-coverage.xml
56+
files: ./coverage/ngx-highlight-js/clover.xml
3957
fail_ci_if_error: true
4058
verbose: true
4159

@@ -45,32 +63,49 @@ jobs:
4563
- name: checkout
4664
uses: actions/checkout@master
4765

48-
- uses: borales/actions-yarn@v4
66+
- uses: pnpm/action-setup@v4
4967
with:
50-
cmd: install
68+
run_install: false
5169

52-
- uses: borales/actions-yarn@v4
70+
- name: Use Node.js
71+
uses: actions/setup-node@v6
5372
with:
54-
cmd: lint
73+
node-version-file: '.nvmrc'
74+
cache: 'pnpm'
75+
76+
- name: Install dependencies
77+
run: pnpm install
78+
79+
- name: lint
80+
run: pnpm run lint
5581

5682
site:
5783
runs-on: ubuntu-latest
5884
steps:
5985
- name: checkout
6086
uses: actions/checkout@master
6187

62-
- uses: borales/actions-yarn@v4
88+
- uses: pnpm/action-setup@v4
6389
with:
64-
cmd: install
90+
run_install: false
91+
92+
- name: Use Node.js
93+
uses: actions/setup-node@v6
94+
with:
95+
node-version-file: '.nvmrc'
96+
cache: 'pnpm'
97+
98+
- name: Install dependencies
99+
run: pnpm install
65100

66101
- name: build
67102
run: |
68103
node ./node_modules/@angular/cli/bin/ng build --base-href /ngx-highlight-js/
69-
cp ./dist/ngx-highlight-js/browser/index.html ./dist/ngx-highlight-js/browser/404.html
70-
ls ./dist/ngx-highlight-js/browser
104+
cp ./dist/site/browser/index.html ./dist/site/browser/404.html
105+
ls ./dist/site/browser
71106
72107
- name: deploy-to-gh-pages
73-
uses: peaceiris/actions-gh-pages@v3
108+
uses: peaceiris/actions-gh-pages@v4
74109
with:
75110
github_token: ${{ secrets.GITHUB_TOKEN }}
76-
publish_dir: ./dist/ngx-highlight-js/browser
111+
publish_dir: ./dist/site/browser

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22.16.0
1+
22.21.1

.yarn/releases/yarn-4.9.1.cjs

Lines changed: 0 additions & 948 deletions
This file was deleted.

angular.json

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,52 @@
22
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
33
"version": 1,
44
"newProjectRoot": "projects",
5+
"cli": {
6+
"packageManager": "npm",
7+
"schematicCollections": [
8+
"angular-eslint"
9+
]
10+
},
511
"projects": {
612
"ngx-highlight-js": {
13+
"projectType": "library",
14+
"root": "lib",
15+
"sourceRoot": "lib",
16+
"prefix": "",
17+
"architect": {
18+
"build": {
19+
"builder": "@angular/build:ng-packagr",
20+
"configurations": {
21+
"production": {
22+
"tsConfig": "lib/tsconfig.lib.prod.json"
23+
},
24+
"development": {
25+
"tsConfig": "lib/tsconfig.lib.json"
26+
}
27+
},
28+
"defaultConfiguration": "production"
29+
},
30+
"test": {
31+
"builder": "@angular/build:unit-test",
32+
"options": {
33+
"tsConfig": "lib/tsconfig.spec.json"
34+
}
35+
},
36+
"lint": {
37+
"builder": "@angular-eslint/builder:lint",
38+
"options": {
39+
"lintFilePatterns": [
40+
"lib/**/*.ts",
41+
"lib/**/*.html",
42+
"src/**/*.ts",
43+
"src/**/*.html"
44+
],
45+
"eslintConfig": "eslint.config.js"
46+
}
47+
}
48+
}
49+
},
50+
"site": {
751
"projectType": "application",
852
"schematics": {
953
"@schematics/angular:component": {
@@ -14,27 +58,22 @@
1458
}
1559
},
1660
"root": "",
17-
"sourceRoot": "",
61+
"sourceRoot": "src",
1862
"prefix": "app",
1963
"architect": {
2064
"build": {
2165
"builder": "@angular/build:application",
2266
"options": {
2367
"index": "src/index.html",
2468
"browser": "src/main.ts",
25-
"polyfills": [
26-
"zone.js"
27-
],
2869
"tsConfig": "tsconfig.app.json",
2970
"assets": [
3071
{
3172
"glob": "**/*",
3273
"input": "public"
3374
}
3475
],
35-
"inlineStyleLanguage": "less",
36-
"styles": [],
37-
"scripts": []
76+
"inlineStyleLanguage": "less"
3877
},
3978
"configurations": {
4079
"production": {
@@ -71,34 +110,6 @@
71110
}
72111
},
73112
"defaultConfiguration": "development"
74-
},
75-
"test": {
76-
"builder": "@angular/build:karma",
77-
"options": {
78-
"karmaConfig": "./karma.conf.js",
79-
"polyfills": [
80-
"zone.js",
81-
"zone.js/testing"
82-
],
83-
"tsConfig": "tsconfig.spec.json",
84-
"scripts": [
85-
"public/highlight.min.js"
86-
],
87-
"include": [
88-
"lib/**/*.spec.ts"
89-
]
90-
}
91-
},
92-
"lint": {
93-
"builder": "@angular-eslint/builder:lint",
94-
"options": {
95-
"lintFilePatterns": [
96-
"src/**/*.ts",
97-
"src/**/*.html",
98-
"lib/**/*.ts",
99-
"lib/**/*.html"
100-
]
101-
}
102113
}
103114
}
104115
}

eslint.config.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
// @ts-check
22
const eslint = require("@eslint/js");
3+
const { defineConfig } = require("eslint/config");
34
const tseslint = require("typescript-eslint");
45
const angular = require("angular-eslint");
56

6-
module.exports = tseslint.config(
7+
module.exports = defineConfig([
78
{
89
files: ["**/*.ts"],
910
extends: [
1011
eslint.configs.recommended,
11-
...tseslint.configs.recommended,
12-
...tseslint.configs.stylistic,
13-
...angular.configs.tsRecommended,
12+
tseslint.configs.recommended,
13+
tseslint.configs.stylistic,
14+
angular.configs.tsRecommended,
1415
],
1516
processor: angular.processInlineTemplates,
1617
rules: {
@@ -24,9 +25,9 @@ module.exports = tseslint.config(
2425
{
2526
files: ["**/*.html"],
2627
extends: [
27-
...angular.configs.templateRecommended,
28-
...angular.configs.templateAccessibility,
28+
angular.configs.templateRecommended,
29+
angular.configs.templateAccessibility,
2930
],
3031
rules: {},
3132
}
32-
);
33+
]);

karma.conf.js

Lines changed: 0 additions & 50 deletions
This file was deleted.

lib/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/ng-package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"dest": "../publish",
44
"deleteDestPath": true,
55
"lib": {
6-
"entryFile": "public-api.ts"
6+
"entryFile": "src/public-api.ts"
77
},
8-
"allowedNonPeerDependencies": ["tslib", "angular", "highlight.js"]
9-
}
8+
"allowedNonPeerDependencies": [
9+
"highlight.js"
10+
]
11+
}

lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
},
2222
"homepage": "https://cipchk.github.io/ngx-highlight-js/",
2323
"dependencies": {
24-
"highlight.js": "^11.9.0"
24+
"highlight.js": "^11.11.1"
2525
}
2626
}

lib/public-api.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)