Skip to content

Commit d79e3bb

Browse files
committed
Building is 100% working now
1 parent 955189f commit d79e3bb

File tree

5 files changed

+15
-31
lines changed

5 files changed

+15
-31
lines changed

demo/App.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import * as React from 'react';
2-
import { Value } from '../src/types/Value';
3-
import { ReactMde } from '../src/ReactMde';
4-
import { defaultCommands } from '../src/ReactMdeCommands';
2+
import ReactMde, { ReactMdeCommands, ReactMdeValue, ReactMdeTextSelection } from '../src';
53

64
interface AppProps {
75
}
86

97
interface AppState {
10-
reactMdeValue: Value;
8+
reactMdeValue: ReactMdeValue;
119
}
1210

1311
export class App extends React.Component<AppProps, AppState> {
@@ -34,7 +32,7 @@ export class App extends React.Component<AppProps, AppState> {
3432
}}
3533
value={this.state.reactMdeValue}
3634
onChange={this.handleValueChange}
37-
commands={defaultCommands}
35+
commands={ReactMdeCommands}
3836
/>
3937
</div>
4038
);

gulpfile.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ const webpackConfig = require('./webpack.config.demo.prod.js');
88
const tsProject = ts.createProject('./tsconfig.json');
99

1010
gulp.task('build_styles', function () {
11-
return gulp.src('./src/styles/*.scss')
11+
return gulp.src('./src/styles/**/*.scss')
1212
.pipe(sass().on('error', sass.logError))
13-
.pipe(gulp.dest('./lib/styles'));
13+
.pipe(gulp.dest('./lib/styles/css'));
1414
});
1515

1616
// library
1717
gulp.task('copy_styles', function () {
18-
return gulp.src('./src/styles/!**!/!*')
19-
.pipe(gulp.dest('./lib/styles'));
18+
return gulp.src('./src/styles/**/*.scss')
19+
.pipe(gulp.dest('./lib/styles/scss'));
2020
});
2121

22-
gulp.task('build', function () {
22+
gulp.task('build', ['copy_styles', 'build_styles'], function () {
2323
const tsResult = gulp.src('src/**/*.{ts,tsx}')
2424
.pipe(tsProject({
2525
declaration: true
2626
}));
2727
return merge([
2828
tsResult.dts.pipe(gulp.dest('lib/definitions')),
29-
tsResult.js.pipe(gulp.dest('lib'))
29+
tsResult.js.pipe(gulp.dest('lib/js'))
3030
]);
3131
});
3232

src/index.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export { defaultCommands as ReactMdeCommands } from './ReactMdeCommands';
2+
export { Value as ReactMdeValue } from './types/Value' ;
3+
export { TextSelection as ReactMdeTextSelection } from './types/TextSelection' ;
4+
import { ReactMde } from './ReactMde';
5+
export default ReactMde;

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
"compilerOptions": {
3-
"outDir": "./ts-out/",
43
"sourceMap": true,
54
"noImplicitAny": false,
65
"jsx": "react",
76
"target": "es5",
8-
"allowJs": true,
7+
"declaration": true,
98
"typeRoots": [
109
"./node_modules/@types"
1110
],

0 commit comments

Comments
 (0)