Skip to content

Commit 692a2e9

Browse files
authored
chore: bump angular to v21 (#14)
1 parent 6e0f037 commit 692a2e9

25 files changed

Lines changed: 7459 additions & 1188 deletions

.github/workflows/ci.yml

Lines changed: 51 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +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
27-
name: install
35+
- uses: pnpm/action-setup@v4
2836
with:
29-
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
3047

3148
- name: run
32-
run: yarn run test
49+
run: pnpm run test
3350

3451
- uses: codecov/codecov-action@v5
3552
name: upload
3653
with:
3754
token: ${{ secrets.CODECOV_TOKEN }}
3855
flags: unittests
39-
files: ./coverage/cobertura-coverage.xml
56+
files: ./coverage/ng-github-button/clover.xml
4057
fail_ci_if_error: true
4158
verbose: true
4259

@@ -46,32 +63,49 @@ jobs:
4663
- name: checkout
4764
uses: actions/checkout@master
4865

49-
- uses: borales/actions-yarn@v4
66+
- uses: pnpm/action-setup@v4
5067
with:
51-
cmd: install
68+
run_install: false
5269

53-
- uses: borales/actions-yarn@v4
70+
- name: Use Node.js
71+
uses: actions/setup-node@v6
5472
with:
55-
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
5681

5782
site:
5883
runs-on: ubuntu-latest
5984
steps:
6085
- name: checkout
6186
uses: actions/checkout@master
6287

63-
- uses: borales/actions-yarn@v4
88+
- uses: pnpm/action-setup@v4
6489
with:
65-
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
66100

67101
- name: build
68102
run: |
69103
node ./node_modules/@angular/cli/bin/ng build --base-href /ng-github-button/
70-
cp ./dist/ng-github-button/browser/index.html ./dist/ng-github-button/browser/404.html
71-
ls ./dist/ng-github-button/browser
104+
cp ./dist/site/browser/index.html ./dist/site/browser/404.html
105+
ls ./dist/site/browser
72106
73107
- name: deploy-to-gh-pages
74108
uses: peaceiris/actions-gh-pages@v4
75109
with:
76110
github_token: ${{ secrets.GITHUB_TOKEN }}
77-
publish_dir: ./dist/ng-github-button/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.2.cjs

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

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ enableImmutableInstalls: false
22

33
nodeLinker: node-modules
44

5-
yarnPath: .yarn/releases/yarn-4.9.2.cjs
5+
yarnPath: .yarn/releases/yarn-4.9.1.cjs

angular.json

Lines changed: 46 additions & 32 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
"ng-github-button": {
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,31 +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-
"include": [
85-
"lib/**/*.spec.ts"
86-
]
87-
}
88-
},
89-
"lint": {
90-
"builder": "@angular-eslint/builder:lint",
91-
"options": {
92-
"lintFilePatterns": [
93-
"src/**/*.ts",
94-
"src/**/*.html",
95-
"lib/**/*.ts",
96-
"lib/**/*.html"
97-
]
98-
}
99113
}
100114
}
101115
}

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/ng-package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"dest": "../publish",
44
"deleteDestPath": true,
55
"lib": {
6-
"entryFile": "public-api.ts"
6+
"entryFile": "src/public-api.ts"
77
}
8-
}
8+
}

lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ng-github-button",
3-
"version": "20.0.0",
3+
"version": "21.0.0",
44
"description": "Unofficial GitHub buttons in Angular.",
55
"author": "cipchk <cipchk@qq.com>",
66
"license": "MIT",

lib/public-api.ts

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

0 commit comments

Comments
 (0)