Skip to content

Commit

Permalink
build: bump to angular 17
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Nov 2, 2023
1 parent 2f7f77c commit 7bb10c1
Show file tree
Hide file tree
Showing 31 changed files with 292 additions and 269 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ jobs:
cmd: install

- name: run
run: |
yarn run test
cat ./coverage/lcov.info | ./node_modules/.bin/codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: yarn run test

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

lint:
runs-on: ubuntu-latest
Expand Down
27 changes: 15 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,42 +1,45 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
# Compiled output
/dist
/tmp
/out-tsc
/publish
/yarn.lock
/.angular/cache
/bazel-out

# dependencies
# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
/.idea
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.sass-cache
# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
# System files
.DS_Store
Thumbs.db

/publish
/yarn.lock
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.16.1
18.12.0
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { NgxTinymceModule } from 'ngx-tinymce';
@NgModule({
imports: [
NgxTinymceModule.forRoot({
// Local assets
baseURL: './assets/tinymce/',
// or cdn
baseURL: '//cdnjs.cloudflare.com/ajax/libs/tinymce/5.7.1/'
Expand All @@ -37,6 +38,37 @@ import { NgxTinymceModule } from 'ngx-tinymce';
export class AppModule { }
```

If the local path should be adding assets configuration in `angular.json`:

```json
"assets": [
{
"glob": "**/tinymce.min.js",
"input": "./node_modules/tinymce",
"output": "assets/tinymce/"
}
]
```

### Standalone

```ts
@Component({
template: `<tinymce />`,
standalone: true,
imports: [TinymceComponent],
})
export class App
```

Globa config:

```ts
bootstrapApplication(AppComponent, {
providers: [provideTinymce({baseURL: '//cdn.tiny.cloud/1/no-api-key/tinymce/6/'})]
});
```

### Usage

```ts
Expand Down
40 changes: 16 additions & 24 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
}
},
"root": "",
"sourceRoot": "src",
"sourceRoot": "",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
Expand All @@ -49,21 +49,12 @@
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
"sourceMap": true
}
},
"defaultConfiguration": "production"
Expand All @@ -72,27 +63,32 @@
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "ngx-tinymce:build:production"
"buildTarget": "ngx-tinymce:build:production"
},
"development": {
"browserTarget": "ngx-tinymce:build:development"
"buildTarget": "ngx-tinymce:build:development"
}
},
"defaultConfiguration": "development"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "lib/test.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"karmaConfig": "./karma.conf.js",
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"include": [
"../lib/test.ts",
"../lib/**/*.spec.ts"
"lib/**/*.spec.ts"
],
"assets": [
{
"glob": "**/tinymce.min.js",
"input": "./node_modules/tinymce",
"output": "assets/tinymce/"
}
]
}
},
Expand All @@ -109,9 +105,5 @@
}
}
}
},
"defaultProject": "ngx-tinymce",
"cli": {
"defaultCollection": "@angular-eslint/schematics"
}
}
101 changes: 51 additions & 50 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,51 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true,
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
}
});
};
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' },
{ type: 'cobertura' },
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true,
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
}
});
};
2 changes: 1 addition & 1 deletion lib/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"lib": {
"entryFile": "src/public_api.ts"
},
"allowedNonPeerDependencies": ["@ng-util/util", "@ng-util/lazy"]
"allowedNonPeerDependencies": ["@ng-util/lazy"]
}
3 changes: 1 addition & 2 deletions lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
},
"homepage": "https://cipchk.github.io/ngx-tinymce/",
"dependencies": {
"@ng-util/lazy": "^14.0.0",
"@ng-util/util": "^14.0.0"
"@ng-util/lazy": "^17.0.0-rc.0"
}
}
13 changes: 13 additions & 0 deletions lib/src/provide.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';
import { TinymceOptions } from './tinymce.options';

/**
* Sets up providers necessary to config for the Tinymce.
* @example
* bootstrapApplication(AppComponent, {
* providers: [provideTinymce({baseURL: '//cdn.tiny.cloud/1/no-api-key/tinymce/6/'})]
* });
*/
export function provideTinymce(options: TinymceOptions): EnvironmentProviders {
return makeEnvironmentProviders([{ provide: TinymceOptions, useValue: options }]);
}
1 change: 1 addition & 0 deletions lib/src/public_api.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './tinymce.options';
export { TinymceComponent } from './tinymce.component';
export * from './tinymce.module';
export * from './provide';
Loading

0 comments on commit 7bb10c1

Please sign in to comment.