Skip to content

Commit

Permalink
ngx-editor@alpha release
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Sep 27, 2017
1 parent 364327e commit c9fa11a
Show file tree
Hide file tree
Showing 70 changed files with 7,781 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .angular-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "ngx-editor"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"styles.scss"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "e2e/tsconfig.e2e.json",
"exclude": "**/node_modules/**"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"component": {},
"serve": {
"port": 5000,
"host": "0.0.0.0"
}
}
}
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc
/.ng_build
/build

# dependencies
/node_modules

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

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

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

# e2e
/e2e/*.js
/e2e/*.map

# System Files
.DS_Store
Thumbs.db
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# NgxEditor

<p align="center">
<img src="./icons/ngx-editor.svg">
</p>

A Simple WYSIWYG Editor for Angular Applications.

## Getting Started

### Installation

Install via Package managers such as [npm][npm] or [yarn][yarn]

```bash
npm install [email protected] --save
# or
yarn add [email protected]
```

### Usage

Import `ngx-editor` module

```typescript
import { NgxEditorModule } from 'ngx-editor'

@NgModule({
imports: [ NgxEditorModule ]
})
```
In HTML

```html
<app-ngx-editor [placeholder]="'Enter text here...'"></app-ngx-editor>
```
14 changes: 14 additions & 0 deletions e2e/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { AppPage } from './app.po';

describe('ngx-editor App', () => {
let page: AppPage;

beforeEach(() => {
page = new AppPage();
});

it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to app!');
});
});
11 changes: 11 additions & 0 deletions e2e/app.po.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { browser, by, element } from 'protractor';

export class AppPage {
navigateTo() {
return browser.get('/');
}

getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}
14 changes: 14 additions & 0 deletions e2e/tsconfig.e2e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"baseUrl": "./",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
Binary file added icons/ngx-editor-opt1/ang_edit1_128.ico
Binary file not shown.
Binary file added icons/ngx-editor-opt1/ang_edit1_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/ngx-editor-opt1/ang_edit1_256.ico
Binary file not shown.
Binary file added icons/ngx-editor-opt1/ang_edit1_256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/ngx-editor-opt1/ang_edit1_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/ngx-editor-opt1/ang_edit1_64.ico
Binary file not shown.
Binary file added icons/ngx-editor-opt1/ang_edit1_64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/ngx-editor-opt1/ang_editv1_32_128.ico
Binary file not shown.
Binary file added icons/ngx-editor-opt1/ang_editv1_32_256.ico
Binary file not shown.
Binary file added icons/ngx-editor-opt1/ngx-editor1.gvdesign
Binary file not shown.
Binary file added icons/ngx-editor-opt1/ngx-editor1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/ngx-editor-opt1/ngx-editor1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/ngx-editor-opt1/ngx-editor1_64x64.ico
Binary file not shown.
Binary file added icons/ngx-editor-opt2/ang_editv4_128.ico
Binary file not shown.
Binary file added icons/ngx-editor-opt2/ang_editv4_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/ngx-editor-opt2/ang_editv4_256.ico
Binary file not shown.
Binary file added icons/ngx-editor-opt2/ang_editv4_256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/ngx-editor-opt2/ang_editv4_32.ico
Binary file not shown.
Binary file added icons/ngx-editor-opt2/ang_editv4_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/ngx-editor-opt2/ang_editv4_32_128.ico
Binary file not shown.
Binary file added icons/ngx-editor-opt2/ang_editv4_32_256.ico
Binary file not shown.
Binary file added icons/ngx-editor-opt2/ang_editv4_64.ico
Binary file not shown.
Binary file added icons/ngx-editor-opt2/ang_editv4_64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/ngx-editor-opt2/ngx-editor2.gvdesign
Binary file not shown.
Binary file added icons/ngx-editor-opt2/ngx-editor2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions icons/ngx-editor-opt2/ngx-editor2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/ngx-editor-opt2/ngx-editor2_64x64.ico
Binary file not shown.
1 change: 1 addition & 0 deletions icons/ngx-editor.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// 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/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};
7 changes: 7 additions & 0 deletions ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
"dest": "build/",
"lib": {
"entryFile": "public_api.ts"
}
}
58 changes: 58 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "ngx-editor",
"version": "1.0.0-alpha",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"build:prod": "ng build --prod && sh scripts/build.sh",
"prenpm:publish": "yarn run build:prod",
"npm:publish": "sh scripts/publish.sh"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.4.3",
"@angular/common": "^4.4.3",
"@angular/compiler": "^4.4.3",
"@angular/core": "^4.4.3",
"@angular/forms": "^4.4.3",
"@angular/http": "^4.4.3",
"@angular/platform-browser": "^4.4.3",
"@angular/platform-browser-dynamic": "^4.4.3",
"@angular/router": "^4.4.3",
"core-js": "^2.5.1",
"font-awesome": "^4.7.0",
"rxjs": "^5.4.3",
"zone.js": "^0.8.17"
},
"devDependencies": {
"@angular/cli": "1.4.3",
"@angular/compiler-cli": "^4.4.3",
"@angular/language-service": "^4.4.3",
"@types/jasmine": "~2.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.0.31",
"codelyzer": "~3.2.0",
"commitizen": "^2.9.6",
"cz-conventional-changelog": "^2.0.0",
"husky": "^0.14.3",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.3.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"ng-packagr": "^1.2.0",
"protractor": "~5.1.2",
"rimraf": "^2.6.2",
"ts-node": "~3.3.0",
"tslint": "~5.7.0",
"typescript": "~2.5.3"
}
}
28 changes: 28 additions & 0 deletions protractor.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter } = require('jasmine-spec-reporter');

exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
1 change: 1 addition & 0 deletions public_api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src/app/ngx-editor/ngx-editor.module';
13 changes: 13 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# remove existing builds
rm -rf build/
rm -rf dist/

# build
./node_modules/.bin/ng-packagr -p ng-package.json

# copy icons to build directory
mkdir build/icons/
cp -r icons/ngx-editor.svg build/icons/

# delete unwanted folders
rm -rf .ng_build
6 changes: 6 additions & 0 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# open build folder and publish
cd build && npm publish

# remove distribution directories
rm -rf .ng_build
rm -rf dist/
1 change: 1 addition & 0 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<app-ngx-editor [config]="editorConfig" [placeholder]="'Enter text here...'"></app-ngx-editor>
Empty file added src/app/app.component.scss
Empty file.
Loading

0 comments on commit c9fa11a

Please sign in to comment.