Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 52 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,51 @@ jobs:
- name: checkout
uses: actions/checkout@master

- uses: borales/actions-yarn@v4
- uses: pnpm/action-setup@v4
with:
cmd: install
run_install: false

- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: run
run: |
yarn run build
pnpm run build

test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master

- uses: borales/actions-yarn@v4
- uses: pnpm/action-setup@v4
with:
cmd: install
run_install: false

- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: run
run: yarn run test
run: pnpm run test

- uses: codecov/codecov-action@v5
name: upload
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
files: ./coverage/cobertura-coverage.xml
files: ./coverage/ngx-highlight-js/clover.xml
fail_ci_if_error: true
verbose: true

Expand All @@ -45,32 +63,49 @@ jobs:
- name: checkout
uses: actions/checkout@master

- uses: borales/actions-yarn@v4
- uses: pnpm/action-setup@v4
with:
cmd: install
run_install: false

- uses: borales/actions-yarn@v4
- name: Use Node.js
uses: actions/setup-node@v6
with:
cmd: lint
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: lint
run: pnpm run lint

site:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master

- uses: borales/actions-yarn@v4
- uses: pnpm/action-setup@v4
with:
cmd: install
run_install: false

- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: build
run: |
node ./node_modules/@angular/cli/bin/ng build --base-href /ngx-highlight-js/
cp ./dist/ngx-highlight-js/browser/index.html ./dist/ngx-highlight-js/browser/404.html
ls ./dist/ngx-highlight-js/browser
cp ./dist/site/browser/index.html ./dist/site/browser/404.html
ls ./dist/site/browser

- name: deploy-to-gh-pages
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist/ngx-highlight-js/browser
publish_dir: ./dist/site/browser
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.16.0
22.21.1
948 changes: 0 additions & 948 deletions .yarn/releases/yarn-4.9.1.cjs

This file was deleted.

81 changes: 46 additions & 35 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,52 @@
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"cli": {
"packageManager": "npm",
"schematicCollections": [
"angular-eslint"
]
},
"projects": {
"ngx-highlight-js": {
"projectType": "library",
"root": "lib",
"sourceRoot": "lib",
"prefix": "",
"architect": {
"build": {
"builder": "@angular/build:ng-packagr",
"configurations": {
"production": {
"tsConfig": "lib/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "lib/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular/build:unit-test",
"options": {
"tsConfig": "lib/tsconfig.spec.json"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"lib/**/*.ts",
"lib/**/*.html",
"src/**/*.ts",
"src/**/*.html"
],
"eslintConfig": "eslint.config.js"
}
}
}
},
"site": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
Expand All @@ -14,27 +58,22 @@
}
},
"root": "",
"sourceRoot": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular/build:application",
"options": {
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"inlineStyleLanguage": "less",
"styles": [],
"scripts": []
"inlineStyleLanguage": "less"
},
"configurations": {
"production": {
Expand Down Expand Up @@ -71,34 +110,6 @@
}
},
"defaultConfiguration": "development"
},
"test": {
"builder": "@angular/build:karma",
"options": {
"karmaConfig": "./karma.conf.js",
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"scripts": [
"public/highlight.min.js"
],
"include": [
"lib/**/*.spec.ts"
]
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html",
"lib/**/*.ts",
"lib/**/*.html"
]
}
}
}
}
Expand Down
15 changes: 8 additions & 7 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
// @ts-check
const eslint = require("@eslint/js");
const { defineConfig } = require("eslint/config");
const tseslint = require("typescript-eslint");
const angular = require("angular-eslint");

module.exports = tseslint.config(
module.exports = defineConfig([
{
files: ["**/*.ts"],
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
...angular.configs.tsRecommended,
tseslint.configs.recommended,
tseslint.configs.stylistic,
angular.configs.tsRecommended,
],
processor: angular.processInlineTemplates,
rules: {
Expand All @@ -24,9 +25,9 @@ module.exports = tseslint.config(
{
files: ["**/*.html"],
extends: [
...angular.configs.templateRecommended,
...angular.configs.templateAccessibility,
angular.configs.templateRecommended,
angular.configs.templateAccessibility,
],
rules: {},
}
);
]);
50 changes: 0 additions & 50 deletions karma.conf.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/index.ts

This file was deleted.

8 changes: 5 additions & 3 deletions lib/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"dest": "../publish",
"deleteDestPath": true,
"lib": {
"entryFile": "public-api.ts"
"entryFile": "src/public-api.ts"
},
"allowedNonPeerDependencies": ["tslib", "angular", "highlight.js"]
}
"allowedNonPeerDependencies": [
"highlight.js"
]
}
4 changes: 2 additions & 2 deletions lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-highlight-js",
"version": "20.0.1",
"version": "21.0.0",
"description": "Angular for syntax highlighting with highlight.js",
"keywords": [
"highlight",
Expand All @@ -21,6 +21,6 @@
},
"homepage": "https://cipchk.github.io/ngx-highlight-js/",
"dependencies": {
"highlight.js": "^11.9.0"
"highlight.js": "^11.11.1"
}
}
3 changes: 0 additions & 3 deletions lib/public-api.ts

This file was deleted.

File renamed without changes.
Loading