Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Commit

Permalink
feat: Support reuse route
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Jan 5, 2018
1 parent 8ecf26e commit 9479ecd
Show file tree
Hide file tree
Showing 340 changed files with 47,156 additions and 44,438 deletions.
35 changes: 25 additions & 10 deletions .angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@
},
"apps": [
{
"root": "demo/src",
"outDir": "demo/dist",
"root": "src",
"outDir": "dist",
"assets": [
"assets"
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "../../scripts/test.ts",
"tsconfig": "tsconfig.json",
"testTsconfig": "../../src/tsconfig.spec.json",
"prefix": "",
"serviceWorker": false,
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"styles.css"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
Expand All @@ -30,12 +31,26 @@
],
"e2e": {
"protractor": {
"config": "protractor.conf.js"
"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"
"config": "./karma.conf.js"
}
},
"defaults": {
Expand Down
10 changes: 6 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# http://editorconfig.org

# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
/node_modules
npm-debug.log
.lib
.ng_build

# WebStorm
.idea
Expand Down
19 changes: 17 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
sudo: false
language: node_js
node_js:
- "6"
- "8.5.0"

addons:
chrome: stable

git:
depth: 1

before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

install:
- npm install

script:
- npm run pretest
- npm run test
19 changes: 0 additions & 19 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 卡色
Copyright (c) 2017-present 卡色

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 0 additions & 4 deletions demo/bs-config.json

This file was deleted.

Empty file.
42 changes: 0 additions & 42 deletions demo/src/index.html

This file was deleted.

11 changes: 0 additions & 11 deletions demo/src/typings.d.ts

This file was deleted.

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-ueditor 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"
]
}
}
78 changes: 78 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
const gulp = require('gulp');
const rollup = require('gulp-rollup');
const rename = require('gulp-rename');
const replace = require('gulp-replace');
const less = require('gulp-less');
const bump = require('gulp-bump');
const inline_recources = require('./scripts/inline-resources');
// @ts-ignore
const VERSION = require('./package.json').version;

const paths = {
build: './.ng_build',
lib: './.lib'
};

gulp.task('copy-sources', copySources);
gulp.task('inline-resources', copyResources);
// @ts-ignore
gulp.task('bundle', bundleUmd);
gulp.task('bump', bumpVersions);

function bumpVersions() {
gulp.src([ './package.json'], {base: './'})
.pipe(bump({
version: VERSION
}))
.pipe(gulp.dest('./'));
}
function copySources() {
gulp.src('./lib/**/*')
.pipe(gulp.dest(paths.build))
.on('end', replaceLessWithCSS)
;
}

function replaceLessWithCSS() {
gulp.src(`${paths.build}/**/*.ts`)
.pipe(replace('.less', '.css'))
.pipe(gulp.dest(paths.build))
.on('end', compileLess);
}

function compileLess() {
gulp.src([
`${paths.build}/**/*.less`
])
.pipe(less())
.pipe(gulp.dest(paths.build));
}

function copyResources() {
gulp.src([
`./LICENSE`,
`./README.md`,
`./rollup.config.js`,
`./package.json`,
`${paths.build}/**/*.html`,
`${paths.build}/**/*.css`,
`${paths.build}/**/*.less`
])
.pipe(gulp.dest(paths.lib))
.on('end', () => inline_recources(paths.lib));
}

function bundleUmd() {
bundle(`${paths.lib}/`);
}

function bundle(path) {
const config = require(path + 'rollup.config.js');
gulp.src(path + `**/*.js`)
.pipe(rollup(Object.assign({}, config, {
name: config.name,
input: `${path}index.js`
})))
.pipe(rename(config.output))
.pipe(gulp.dest(`${path}bundles`));
}
15 changes: 2 additions & 13 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
Expand All @@ -15,25 +15,14 @@ module.exports = function (config) {
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
files: [
{ pattern: './scripts/test.ts', watched: false }
],
preprocessors: {
'./scripts/test.ts': ['@angular/cli']
},
mime: {
'text/x-typescript': ['ts','tsx']
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'coverage-istanbul']
: ['progress', 'kjhtml'],
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
Expand Down
10 changes: 5 additions & 5 deletions src/index.ts → lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { CommonModule } from '@angular/common';
import { NgModule, ModuleWithProviders } from '@angular/core';

import { UEditorComponent } from './components/ueditor.component';
import { UEditorConfig } from './components/ueditor.config';
import { ScriptService } from './components/script.service';
import { UEditorComponent } from './src/ueditor.component';
import { UEditorConfig } from './src/ueditor.config';
import { ScriptService } from './src/script.service';

export { UEditorComponent } from './components/ueditor.component';
export { UEditorConfig } from './components/ueditor.config';
export { UEditorComponent } from './src/ueditor.component';
export { UEditorConfig } from './src/ueditor.config';

@NgModule({
imports: [CommonModule],
Expand Down
File renamed without changes.
Loading

0 comments on commit 9479ecd

Please sign in to comment.