Skip to content

Commit

Permalink
Initial commit in an attempt to make this lib work with Angular 18.
Browse files Browse the repository at this point in the history
- Remove unit tests: these weren't testing the code anyway.
- Remove e2e tests: Protractor isn't supported anymore and the tests were empty anyway.
- Upgrade TS, Angular, Zone, Codelyzer, Husky, NgPackagr and Summernote to latest
- Update TypeScript configuration to fix warnings during startup
- Fix warnings in angular.json
- Lock node version to 18.20.3
- Add Github workflow actions
- Replace tslint with eslint
  • Loading branch information
MarkCuypersPpw committed Nov 8, 2024
1 parent b2b1554 commit 517a47a
Show file tree
Hide file tree
Showing 31 changed files with 14,052 additions and 9,298 deletions.
47 changes: 47 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
]
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended",
"plugin:@angular-eslint/template/accessibility"
],
"rules": {}
}
]
}
17 changes: 17 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Build & Test

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'
- run: npm install
- run: npm run lint
- run: npm run build-lib
- run: npm run build
23 changes: 23 additions & 0 deletions .github/workflows/publish-npmjs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish New Release to NPM

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm run lint
- run: npm run build-lib
- run: npm run build
- run: npm publish dist/ngx-summernote --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.20.3
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.20.3
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,7 @@ Compatibility:

Angular | ngx-summernote
------- | --------------
\> 14 | 1.0.0 (Ivy support)
\> 14 | 0.9.0
13 | 0.8.8
12 | 0.8.5
11 | 0.8.4
10 | 0.8.x
9 | 0.7.x
8 | 0.7.x
7 | 0.6.x
6 | 0.5.4
\> 18 | 18.0.0

## Editor

Expand Down
52 changes: 14 additions & 38 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,56 +65,31 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "ngx-summernote-app:build"
"buildTarget": "ngx-summernote-app:build"
},
"configurations": {
"production": {
"browserTarget": "ngx-summernote-app:build:production"
"buildTarget": "ngx-summernote-app:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ngx-summernote-app:build"
"buildTarget": "ngx-summernote-app:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.css",
"node_modules/summernote/dist/summernote-lite.css"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/summernote/dist/summernote-lite.js"
],
"assets": [
"src/favicon.ico",
"src/assets"
"lintFilePatterns": [
"projects/ngx-summernote/**/*.ts",
"projects/ngx-summernote/**/*.html"
]
}
}
}
},
"ngx-summernote-app-e2e": {
"root": "e2e/",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "ngx-summernote-app:serve"
}
}
}
},
"ngx-summernote": {
"root": "projects/ngx-summernote",
"sourceRoot": "projects/ngx-summernote/src",
Expand All @@ -134,12 +109,13 @@
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"main": "projects/ngx-summernote/src/test.ts",
"tsConfig": "projects/ngx-summernote/tsconfig.spec.json",
"karmaConfig": "projects/ngx-summernote/karma.conf.js"
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
Expand Down
28 changes: 0 additions & 28 deletions e2e/protractor.conf.js

This file was deleted.

14 changes: 0 additions & 14 deletions e2e/src/app.e2e-spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions e2e/src/app.po.ts

This file was deleted.

13 changes: 0 additions & 13 deletions e2e/tsconfig.e2e.json

This file was deleted.

Loading

0 comments on commit 517a47a

Please sign in to comment.