Skip to content

Commit

Permalink
use rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengrenzhe committed Aug 8, 2018
1 parent a51a88f commit 1652164
Show file tree
Hide file tree
Showing 13 changed files with 348 additions and 334 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
node_modules
.cache
.rpt2_cache
node_modules
dist/index.html
dist/style.*
dist/test.*
dist/*.jpg
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ dist/style.*
dist/test.*
dist/*.html
release
.rpt2_cache
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- **truncate across dom nodes within the target element, keep the original dom node within the target element**
- **insert the html string at the end of the truncation**
- zero dependency
- very lightweight (3.2kb)
- very lightweight (1.9kb)

## Browser Support

Expand All @@ -24,12 +24,16 @@

## Install

yarn

```
yarn add shear.js
```

or

```
<script src="https://rawgit.com/zhengrenzhe/shear.js/master/dist/shear.js"></script>
```

## Usage

```
Expand Down
Binary file removed dist/c.24d73af6.jpg
Binary file not shown.
20 changes: 18 additions & 2 deletions dist/shear.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
declare module 'utils' {
export const isMS: boolean;
export function toArr<T>(iterable: ArrayLike<T>): T[];
export function createFragment(htmlString: string): DocumentFragment;
export function getTextNodes(root: Node): Text[];

}
declare module 'edge' {
function getTextNodes(root: Node): Text[]; function getPos(targetNode: Node, lineClamp: number): Range;
function getPos(targetNode: Node, lineClamp: number): Range;
export default getPos;
export { getTextNodes };

}
declare module 'returns' {
function returns(isCuted: boolean, fullHTML?: string, cutedHTML?: string, cutedWithAfterHTML?: string): {
isCuted: boolean;
fullHTML: string;
cutedHTML: string;
cutedWithAfterHTML: string;
};
export { returns };

}
declare module 'shear.js' {
Expand Down
7 changes: 1 addition & 6 deletions dist/shear.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion dist/shear.map

This file was deleted.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
"license": "MIT",
"scripts": {
"start": "parcel example/index.html -p 3000",
"build": "parcel build src/shear.js.ts -o shear.js && node_modules/.bin/dts-generator --project . --out dist/shear.d.ts",
"release": "parcel build --global shear -d release src/shear.js.ts -o shear.js"
"build": "rollup --config rollup.config.js && dts-generator --project . --out dist/shear.d.ts"
},
"devDependencies": {
"dts-generator": "^2.1.0",
"node-sass": "^4.9.2",
"parcel-bundler": "^1.9.7",
"rollup": "^0.64.1",
"rollup-plugin-typescript2": "^0.16.1",
"rollup-plugin-uglify": "^4.0.0",
"typescript": "^3.0.1"
}
}
6 changes: 0 additions & 6 deletions release/shear.js

This file was deleted.

Loading

0 comments on commit 1652164

Please sign in to comment.