Skip to content

Commit

Permalink
React-pdf v2.0 (#617)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomura committed Apr 6, 2021
1 parent 5e99574 commit 6ea1723
Show file tree
Hide file tree
Showing 519 changed files with 36,265 additions and 13,326 deletions.
15 changes: 0 additions & 15 deletions .babelrc

This file was deleted.

4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.gitignore
examples/dom-bindings
node_modules
lib
rollup.config.js
151 changes: 0 additions & 151 deletions .eslintrc

This file was deleted.

37 changes: 37 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module.exports = {
parser: 'babel-eslint',
env: {
browser: true,
es6: true,
node: true,
'jest/globals': true,
},
extends: ['plugin:react/recommended', 'airbnb', 'prettier'],
globals: {
URL: false,
BROWSER: false,
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['react', 'jest'],
rules: {
'no-continue': 1,
'no-cond-assign': 1,
'react/prop-types': 0,
'prefer-destructuring': 1,
'no-use-before-define': 1,
'no-underscore-dangle': 0,
'import/no-named-as-default': 0,
'react/state-in-constructor': 0,
'react/jsx-filename-extension': 0,
'react/jsx-props-no-spreading': 1,
'react/destructuring-assignment': 0,
},
};
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
node_modules
*.log
dist
coverage
.jshintrc
.idea
dist
.DS_Store
.cache
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yoga-layout
13 changes: 9 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js

node_js:
- '10'
- '10'

os:
- linux
Expand All @@ -14,14 +14,19 @@ addons:
cache:
yarn: true
directories:
- node_modules
- node_modules

before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CXX=g++-4.9 ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CFLAGS="$CFLAGS -std=c99" ; fi
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH

install: yarn
before_script:
- yarn run bootstrap

script: yarn test
install:
- yarn

script:
- yarn test
57 changes: 0 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,63 +84,6 @@ import ReactPDF from '@react-pdf/renderer';
ReactPDF.render(<MyDocument />, `${__dirname}/example.pdf`);
```

## Examples
For each example, try opening `output.pdf` to see the result.

<table>
<tbody>
<tr>
<td align="center" valign="top">
<img width="150" height="150" src="https://github.com/diegomura/react-pdf/blob/master/examples/text/thumb.png">
<br>
<a href="https://github.com/diegomura/react-pdf/tree/master/examples/text/">Text</a>
</td>
<td align="center" valign="top">
<img width="150" height="150" src="https://github.com/diegomura/react-pdf/blob/master/examples/images/thumb.png">
<br>
<a href="https://github.com/diegomura/react-pdf/tree/master/examples/images/">Images</a>
</td>
<td align="center" valign="top">
<img width="150" height="150" src="https://github.com/diegomura/react-pdf/blob/master/examples/resume/thumb.png">
<br>
<a href="https://github.com/diegomura/react-pdf/tree/master/examples/resume/">Resume</a>
</td>
<td align="center" valign="top">
<img width="150" height="150" src="https://github.com/diegomura/react-pdf/blob/master/examples/fractals/thumb.png">
<br>
<a href="https://github.com/diegomura/react-pdf/tree/master/examples/fractals/">Fractals</a>
</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td align="center" valign="top">
<img width="150" height="150" src="https://github.com/diegomura/react-pdf/blob/master/examples/knobs/thumb.png">
<br>
<a href="https://github.com/diegomura/react-pdf/tree/master/examples/knobs/">Knobs</a>
</td>
<td align="center" valign="top">
<img width="150" height="150" src="https://github.com/diegomura/react-pdf/blob/master/examples/pageWrap/thumb.png">
<br>
<a href="https://github.com/diegomura/react-pdf/tree/master/examples/pageWrap/">Page wrap</a>
</td>
</tr>
</tbody>
</table>

To run the examples, first clone the project and install the dependencies:
```sh
git clone https://github.com/diegomura/react-pdf.git
cd react-pdf
yarn install
```
Then, run `yarn example -- <example-name>`
```sh
yarn example -- fractals
```

## Contributors

This project exists thanks to all the people who contribute. [[Contribute]](CONTRIBUTING.md).
Expand Down
20 changes: 20 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
loose: true,
targets: {
node: '12',
browsers: 'last 2 versions',
},
},
],
'@babel/preset-react',
],
plugins: [
'@babel/plugin-transform-runtime',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-optional-chaining',
],
};
34 changes: 0 additions & 34 deletions examples/fractals/Fractal.js

This file was deleted.

5 changes: 0 additions & 5 deletions examples/fractals/README.md

This file was deleted.

Loading

0 comments on commit 6ea1723

Please sign in to comment.